2018-12-08 23:44:41 -07:00
|
|
|
#include "CSerialVersion.h"
|
|
|
|
|
|
2025-12-17 13:44:30 -05:00
|
|
|
#include "Common/CFourCC.h"
|
|
|
|
|
#include "Common/FileIO/IInputStream.h"
|
|
|
|
|
#include "Common/FileIO/IOutputStream.h"
|
|
|
|
|
|
2018-12-08 23:44:41 -07:00
|
|
|
CSerialVersion::CSerialVersion(IInputStream& rInput)
|
|
|
|
|
{
|
|
|
|
|
Read(rInput);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSerialVersion::Read(IInputStream& rInput)
|
|
|
|
|
{
|
2026-01-12 11:09:45 -05:00
|
|
|
mArchiveVersion = rInput.ReadU16();
|
|
|
|
|
mFileVersion = rInput.ReadU16();
|
2018-12-08 23:44:41 -07:00
|
|
|
CFourCC GameID(rInput);
|
|
|
|
|
mGame = GameFrom4CC(GameID);
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-13 21:43:10 -05:00
|
|
|
void CSerialVersion::Write(IOutputStream& rOutput) const
|
2018-12-08 23:44:41 -07:00
|
|
|
{
|
2026-01-12 14:32:52 -05:00
|
|
|
rOutput.WriteU16(mArchiveVersion);
|
|
|
|
|
rOutput.WriteU16(mFileVersion);
|
2018-12-08 23:44:41 -07:00
|
|
|
CFourCC GameID = GameTo4CC(mGame);
|
|
|
|
|
GameID.Write(rOutput);
|
|
|
|
|
}
|