diff options
author | Colin Snover | 2017-04-17 11:25:31 -0500 |
---|---|---|
committer | Colin Snover | 2017-04-23 13:07:25 -0500 |
commit | 6f95b1a440c8579a5010c39ca84e2c5fcdfac682 (patch) | |
tree | c70a3c4d97a74fed5dde01548698d38bb873eae0 | |
parent | a2d7851e4ddb7c3858b5ee89b95daccf3dfa5531 (diff) | |
download | scummvm-rg350-6f95b1a440c8579a5010c39ca84e2c5fcdfac682.tar.gz scummvm-rg350-6f95b1a440c8579a5010c39ca84e2c5fcdfac682.tar.bz2 scummvm-rg350-6f95b1a440c8579a5010c39ca84e2c5fcdfac682.zip |
SCI32: Fix missing mustSetViewVisible data in cloned objects
This information comes directly from script data and is not
modified at runtime, so it does not need to be persisted in save
games, but does need to be set when reconstructing clones.
-rw-r--r-- | engines/sci/engine/object.h | 5 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 14 | ||||
-rw-r--r-- | engines/sci/engine/savegame.h | 3 |
3 files changed, 16 insertions, 6 deletions
diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h index 3b81497261..75ab128de5 100644 --- a/engines/sci/engine/object.h +++ b/engines/sci/engine/object.h @@ -264,6 +264,11 @@ public: _baseObj = obj ? obj->_baseObj : SciSpan<const byte>(); _baseMethod = obj ? obj->_baseMethod : Common::Array<uint32>(); _baseVars = obj ? obj->_baseVars : Common::Array<uint16>(); +#ifdef ENABLE_SCI32 + if (getSciVersion() == SCI_VERSION_3) { + _mustSetViewVisible = obj ? obj->_mustSetViewVisible : Common::Array<bool>(); + } +#endif } bool relocateSci0Sci21(SegmentId segment, int location, size_t scriptSize); diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 433878429e..427e32deb3 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -104,10 +104,6 @@ void syncWithSerializer(Common::Serializer &s, Node &obj) { syncWithSerializer(s, obj.value); } -void syncWithSerializer(Common::Serializer &s, bool &obj) { - s.syncAsByte(obj); -} - #pragma mark - // By default, sync using syncWithSerializer, which in turn can easily be overloaded. @@ -427,12 +423,20 @@ void Object::saveLoadWithSerializer(Common::Serializer &s) { s.syncAsSint32LE(_methodCount); // that's actually a uint16 syncArray<reg_t>(s, _variables); + +#ifdef ENABLE_SCI32 if (s.getVersion() >= 42 && getSciVersion() == SCI_VERSION_3) { - syncArray<bool>(s, _mustSetViewVisible); + // Obsolete mustSetViewVisible array + if (s.getVersion() == 42 && s.isLoading()) { + uint32 len; + s.syncAsUint32LE(len); + s.skip(len); + } syncWithSerializer(s, _superClassPosSci3); syncWithSerializer(s, _speciesSelectorSci3); syncWithSerializer(s, _infoSelectorSci3); } +#endif } diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h index 6284897bd0..151585ac77 100644 --- a/engines/sci/engine/savegame.h +++ b/engines/sci/engine/savegame.h @@ -37,6 +37,7 @@ struct EngineState; * * Version - new/changed feature * ============================= + * 43 - stop saving SCI3 mustSetViewVisible array * 42 - SCI3 robots and VM objects * 41 - palette support for newer SCI2.1 games; stable SCI2/2.1 save games * 40 - always store palvary variables @@ -67,7 +68,7 @@ struct EngineState; */ enum { - CURRENT_SAVEGAME_VERSION = 42, + CURRENT_SAVEGAME_VERSION = 43, MINIMUM_SAVEGAME_VERSION = 14 #ifdef ENABLE_SCI32 , |