mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-11 05:36:12 +00:00
TINSEL: Added Serializer::skip() convenience method
svn-id: r39350
This commit is contained in:
parent
ca4bdb8572
commit
25b39e217a
@ -149,10 +149,7 @@ static bool syncSaveGameHeader(Serializer &s, SaveGameHeader &hdr) {
|
|||||||
if (tmp < 0 || hdr.id != SAVEGAME_ID || hdr.ver > CURRENT_VER || hdr.size > 1024)
|
if (tmp < 0 || hdr.id != SAVEGAME_ID || hdr.ver > CURRENT_VER || hdr.size > 1024)
|
||||||
return false;
|
return false;
|
||||||
// Skip over any extra bytes
|
// Skip over any extra bytes
|
||||||
while (tmp-- > 0) {
|
s.skip(tmp);
|
||||||
byte b = 0;
|
|
||||||
s.syncAsByte(b);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
|
|
||||||
uint bytesSynced() const { return _bytesSynced; }
|
uint bytesSynced() const { return _bytesSynced; }
|
||||||
|
|
||||||
void syncBytes(byte *buf, uint16 size) {
|
void syncBytes(byte *buf, uint32 size) {
|
||||||
if (_loadStream)
|
if (_loadStream)
|
||||||
_loadStream->read(buf, size);
|
_loadStream->read(buf, size);
|
||||||
else
|
else
|
||||||
@ -69,6 +69,16 @@ public:
|
|||||||
_bytesSynced += size;
|
_bytesSynced += size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void skip(uint32 size) {
|
||||||
|
if (_loadStream)
|
||||||
|
_loadStream->skip(size);
|
||||||
|
else {
|
||||||
|
while (size--)
|
||||||
|
_saveStream->writeByte(0);
|
||||||
|
}
|
||||||
|
_bytesSynced += size;
|
||||||
|
}
|
||||||
|
|
||||||
SYNC_AS(Byte, byte, 1)
|
SYNC_AS(Byte, byte, 1)
|
||||||
|
|
||||||
SYNC_AS(Uint16LE, uint16, 2)
|
SYNC_AS(Uint16LE, uint16, 2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user