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);
96 virtual uint32 getSize()
const;
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;
147 bool readFromRaw(
const byte *data, uint32 offset, uint32 size);
150 bool writeIntoRaw(byte *data, 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);
174 bool readPalette(
const byte *palette);
176 bool readSprite(
const Surface &sprite);
179 bool readSpriteRaw(
const byte *data, uint32 size);
182 bool writePalette(byte *palette)
const;
184 bool writeSprite(
Surface &sprite)
const;
202 static const uint32 kVersion = 1;
203 static const uint32 kID =
MKTAG(
'I',
'N',
'F',
'O');
214 uint32 gameVersion, byte endian, uint32 varCount);
218 const char *getDesc()
const;
220 uint32 getDescMaxLength()
const;
223 void setVarCount(uint32 varCount);
225 void setDesc(
const char *desc = 0);
227 void setDesc(
const byte *desc, uint32 size);
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;
259 bool hasAllParts()
const;
265 bool writePart(uint32 partN,
const SavePart *part);
267 bool readPart(uint32 partN,
SavePart *part)
const;
269 bool readPartHeader(uint32 partN,
SaveHeader *header)
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);
357 bool canSave()
const;
365 #endif // GOB_SAVE_SAVEFILE_H
Definition: savefile.h:313
Definition: savefile.h:54
Definition: savefile.h:340
Definition: savefile.h:108
T * iterator
Definition: array.h:54
Definition: savefile.h:130
Definition: savefile.h:242
Definition: savefile.h:200
Definition: savefile.h:276
const T * const_iterator
Definition: array.h:55
Definition: savefile.h:90
Definition: savefile.h:162
Definition: surface.h:100
#define MKTAG(a0, a1, a2, a3)
Definition: endian.h:188
Definition: savefile.h:288