aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/savegame.cpp
diff options
context:
space:
mode:
authorColin Snover2016-09-21 16:16:21 -0500
committerColin Snover2016-09-29 19:39:16 -0500
commit1847b0f7059328e195d9fca2372ab2b8a12aad06 (patch)
treee7e20257231c81b6728445ae2084fcc7065c457f /engines/sci/engine/savegame.cpp
parent3e75f42d85d82cc77d2607def29f4b63208844c1 (diff)
downloadscummvm-rg350-1847b0f7059328e195d9fca2372ab2b8a12aad06.tar.gz
scummvm-rg350-1847b0f7059328e195d9fca2372ab2b8a12aad06.tar.bz2
scummvm-rg350-1847b0f7059328e195d9fca2372ab2b8a12aad06.zip
SCI32: Fix warnings and incompatible save games when built without SCI32
Diffstat (limited to 'engines/sci/engine/savegame.cpp')
-rw-r--r--engines/sci/engine/savegame.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index aee11ef998..d50df94f4b 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -331,20 +331,26 @@ static void sync_SavegameMetadata(Common::Serializer &s, SavegameMetadata &obj)
s.syncAsUint32LE(obj.playTime);
}
- // Some games require additional metadata to display the load screen
+ // Some games require additional metadata to display their restore screens
// correctly
if (s.getVersion() >= 38) {
if (s.isSaving()) {
const reg_t *globals = g_sci->getEngineState()->variables[VAR_GLOBAL];
if (g_sci->getGameId() == GID_SHIVERS) {
- obj.score = globals[kScore].toUint16();
- obj.score |= globals[kShivers1Score].toUint16() << 16;
+ obj.lowScore = globals[kScore].toUint16();
+ obj.highScore = globals[kShivers1Score].toUint16();
+ obj.avatarId = 0;
} else if (g_sci->getGameId() == GID_MOTHERGOOSEHIRES) {
+ obj.lowScore = obj.highScore = 0;
obj.avatarId = readSelectorValue(g_sci->getEngineState()->_segMan, globals[kEgo], SELECTOR(view));
+ } else {
+ obj.lowScore = obj.highScore = obj.avatarId = 0;
}
}
- s.syncAsUint32LE(obj.score);
+ s.syncAsUint16LE(obj.lowScore);
+ s.syncAsUint16LE(obj.highScore);
+ s.syncAsByte(obj.avatarId);
}
}