28#ifndef GOB_SAVE_SAVEFILE_H
29#define GOB_SAVE_SAVEFILE_H
31#include "common/endian.h"
32#include "common/array.h"
33#include "common/savefile.h"
53 static const uint32 kID1 =
MKTAG(0,
'S',
'C',
'V');
54 static const uint32 kID2 =
MKTAG(
'M',
'G',
'O',
'B');
56 SaveHeader(uint32 type = 0, uint32 version = 0, uint32 size = 0);
58 bool operator==(
const SaveHeader &header)
const;
59 bool operator!=(
const SaveHeader &header)
const;
72 uint32 getType()
const;
73 uint32 getVersion()
const;
74 uint32 getSize()
const;
76 void setType(uint32 type);
77 void setVersion(uint32 version);
78 void setSize(uint32 size);
110 static const uint32 kVersion = 1;
111 static const uint32 kID =
MKTAG(
'P',
'M',
'E',
'M');
120 bool readFrom(
const byte *data, uint32 offset, uint32 size);
122 bool writeInto(
byte *data, uint32 offset, uint32 size)
const;
132 static const uint32 kVersion = 1;
133 static const uint32 kID =
MKTAG(
'V',
'A',
'R',
'S');
142 bool readFrom(uint32 var, uint32 offset, uint32 size);
144 bool writeInto(uint32 var, uint32 offset, uint32 size)
const;
152 const byte* data()
const {
return _data; }
164 static const uint32 kVersion = 2;
165 static const uint32 kID =
MKTAG(
'S',
'P',
'R',
'T');
167 SavePartSprite(uint32 width, uint32 height,
bool trueColor =
false);
202 static const uint32 kVersion = 1;
203 static const uint32 kID =
MKTAG(
'I',
'N',
'F',
'O');
214 uint32 gameVersion,
byte endian, uint32 varCount);
234 uint32 _descMaxLength;
244 static const uint32 kVersion = 1;
245 static const uint32 kID =
MKTAG(
'C',
'O',
'N',
'T');
255 uint32 getSlot()
const;
256 uint32 getSize()
const;
303 uint32 calcSize()
const;
321 bool readPart(uint32 partN,
SavePart *part)
const;
322 bool readPartHeader(uint32 partN,
SaveHeader *header)
const;
346 bool writePart(uint32 partN,
const SavePart *part);
T * iterator
Definition: array.h:54
const T * const_iterator
Definition: array.h:55
Definition: savefile.h:54
Definition: savefile.h:242
SaveContainer(uint32 partCount, uint32 slot)
bool readPart(uint32 partN, SavePart *part) const
bool writePart(uint32 partN, const SavePart *part)
bool readPartHeader(uint32 partN, SaveHeader *header) const
static bool isSave(Common::SeekableReadStream &stream)
static Common::Array< PartInfo > * getPartsInfo(Common::SeekableReadStream &stream)
Definition: savefile.h:90
virtual bool read(Common::ReadStream &stream)=0
virtual bool write(Common::WriteStream &stream) const =0
virtual uint32 getSize() const
Definition: savefile.h:200
void setVarCount(uint32 varCount)
bool write(Common::WriteStream &stream) const override
bool read(Common::ReadStream &stream) override
void setDesc(const char *desc=0)
const char * getDesc() const
uint32 getDescMaxLength() const
SavePartInfo(uint32 descMaxLength, uint32 gameID, uint32 gameVersion, byte endian, uint32 varCount)
void setDesc(const byte *desc, uint32 size)
Definition: savefile.h:108
bool readFrom(const byte *data, uint32 offset, uint32 size)
bool write(Common::WriteStream &stream) const override
bool writeInto(byte *data, uint32 offset, uint32 size) const
bool read(Common::ReadStream &stream) override
Definition: savefile.h:162
bool write(Common::WriteStream &stream) const override
bool read(Common::ReadStream &stream) override
bool readSprite(const Surface &sprite)
bool writePalette(byte *palette) const
bool writeSprite(Surface &sprite) const
bool readPalette(const byte *palette)
bool readSpriteRaw(const byte *data, uint32 size)
Definition: savefile.h:130
bool writeInto(uint32 var, uint32 offset, uint32 size) const
bool read(Common::ReadStream &stream) override
bool readFrom(uint32 var, uint32 offset, uint32 size)
bool readFromRaw(const byte *data, uint32 offset, uint32 size)
bool writeIntoRaw(byte *data, uint32 offset, uint32 size) const
bool write(Common::WriteStream &stream) const override
Definition: savefile.h:313
static bool getInfo(Common::SeekableReadStream &stream, SavePartInfo &info)
static bool getInfo(const Common::String &fileName, SavePartInfo &info)
Definition: savefile.h:340
Definition: surface.h:106
#define MKTAG(a0, a1, a2, a3)
Definition: endian.h:188
Definition: savefile.h:276
Definition: savefile.h:288