From 1847b0f7059328e195d9fca2372ab2b8a12aad06 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Wed, 21 Sep 2016 16:16:21 -0500 Subject: SCI32: Fix warnings and incompatible save games when built without SCI32 --- engines/sci/engine/savegame.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'engines/sci/engine/savegame.cpp') 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); } } -- cgit v1.2.3