mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-05 18:41: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)
|
||||
return false;
|
||||
// Skip over any extra bytes
|
||||
while (tmp-- > 0) {
|
||||
byte b = 0;
|
||||
s.syncAsByte(b);
|
||||
}
|
||||
s.skip(tmp);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
|
||||
uint bytesSynced() const { return _bytesSynced; }
|
||||
|
||||
void syncBytes(byte *buf, uint16 size) {
|
||||
void syncBytes(byte *buf, uint32 size) {
|
||||
if (_loadStream)
|
||||
_loadStream->read(buf, size);
|
||||
else
|
||||
@ -69,6 +69,16 @@ public:
|
||||
_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(Uint16LE, uint16, 2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user