From 1760fb3e0d25704685e9b44f0792536da962082d Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sun, 28 Aug 2016 13:04:02 -0500 Subject: SCI32: Fix incorrect/missing cursor after restoring a save game --- engines/sci/engine/savegame.cpp | 13 ++++++++++--- engines/sci/engine/savegame.h | 5 +++-- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index eeddda8390..be2d7660cb 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -427,6 +427,7 @@ void EngineState::saveLoadWithSerializer(Common::Serializer &s) { if (getSciVersion() >= SCI_VERSION_2) { g_sci->_gfxPalette32->saveLoadWithSerializer(s); g_sci->_gfxRemap32->saveLoadWithSerializer(s); + g_sci->_gfxCursor32->saveLoadWithSerializer(s); } else #endif g_sci->_gfxPalette16->saveLoadWithSerializer(s); @@ -892,11 +893,15 @@ void GfxRemap32::saveLoadWithSerializer(Common::Serializer &s) { } void GfxCursor32::saveLoadWithSerializer(Common::Serializer &s) { - if (s.getVersion() < 37) { + if (s.getVersion() < 38) { return; } - s.syncAsSint32LE(_hideCount); + int32 hideCount; + if (s.isSaving()) { + hideCount = _hideCount; + } + s.syncAsSint32LE(hideCount); s.syncAsSint16LE(_restrictedArea.left); s.syncAsSint16LE(_restrictedArea.top); s.syncAsSint16LE(_restrictedArea.right); @@ -908,8 +913,10 @@ void GfxCursor32::saveLoadWithSerializer(Common::Serializer &s) { if (s.isLoading()) { hide(); setView(_cursorInfo.resourceId, _cursorInfo.loopNo, _cursorInfo.celNo); - if (!_hideCount) { + if (!hideCount) { show(); + } else { + _hideCount = hideCount; } } } diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h index 51dbbedd87..6616081a20 100644 --- a/engines/sci/engine/savegame.h +++ b/engines/sci/engine/savegame.h @@ -37,7 +37,8 @@ struct EngineState; * * Version - new/changed feature * ============================= - * 37 - Segment entry data changed to pointers, SCI32 cursor + * 38 - SCI32 cursor + * 37 - Segment entry data changed to pointers * 36 - SCI32 bitmap segment * 35 - SCI32 remap * 34 - SCI32 palettes, and store play time in ticks @@ -62,7 +63,7 @@ struct EngineState; */ enum { - CURRENT_SAVEGAME_VERSION = 37, + CURRENT_SAVEGAME_VERSION = 38, MINIMUM_SAVEGAME_VERSION = 14 }; -- cgit v1.2.3