aboutsummaryrefslogtreecommitdiff
path: root/engines/lastexpress/game
diff options
context:
space:
mode:
authorLittleboy2012-08-01 02:58:55 -0400
committerLittleboy2012-08-01 02:58:55 -0400
commit7f05e1413c8b7b3913f64ddb29622dcdf40b2c65 (patch)
tree78d3c5997a58d8eb126ea1a612eb82fc8b1a3919 /engines/lastexpress/game
parenteb6c60cec034a7758b8d25e29f501b10fc06c1a4 (diff)
downloadscummvm-rg350-7f05e1413c8b7b3913f64ddb29622dcdf40b2c65.tar.gz
scummvm-rg350-7f05e1413c8b7b3913f64ddb29622dcdf40b2c65.tar.bz2
scummvm-rg350-7f05e1413c8b7b3913f64ddb29622dcdf40b2c65.zip
LASTEXPRESS: Remove use of skip from savegame functions when loading
We cannot accurately skip over compressed data as it is not know before decoding how much data will be used
Diffstat (limited to 'engines/lastexpress/game')
-rw-r--r--engines/lastexpress/game/savepoint.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/lastexpress/game/savepoint.cpp b/engines/lastexpress/game/savepoint.cpp
index 557468e222..6b2dfc5930 100644
--- a/engines/lastexpress/game/savepoint.cpp
+++ b/engines/lastexpress/game/savepoint.cpp
@@ -242,7 +242,15 @@ void SavePoints::saveLoadWithSerializer(Common::Serializer &s) {
}
// Skip uninitialized data if any
- s.skip((_savePointsMaxSize - dataSize) * 16);
+ // (we are using a compressed stream, so we cannot seek on load)
+ uint32 unusedDataSize = (_savePointsMaxSize - dataSize) * 16;
+ if (s.isLoading()) {
+ byte *empty = (byte *)malloc(unusedDataSize);
+ s.syncBytes(empty, unusedDataSize);
+ free(empty);
+ } else {
+ s.skip(unusedDataSize);
+ }
// Number of savepoints
uint32 numSavepoints = _savepoints.size();