diff options
author | Colin Snover | 2017-02-09 19:11:58 -0600 |
---|---|---|
committer | Colin Snover | 2017-04-23 13:07:25 -0500 |
commit | 90c6c0580ec4071d22a50e4c0276ac98e69af38a (patch) | |
tree | 461a6f7a81929cc424839333aee70850a80b6d0f /engines/sci/engine/savegame.cpp | |
parent | 82994609177c30b69f2be155670253b63469d876 (diff) | |
download | scummvm-rg350-90c6c0580ec4071d22a50e4c0276ac98e69af38a.tar.gz scummvm-rg350-90c6c0580ec4071d22a50e4c0276ac98e69af38a.tar.bz2 scummvm-rg350-90c6c0580ec4071d22a50e4c0276ac98e69af38a.zip |
SCI: Convert Object to use Common::Array for SCI3
In SCI3, index-to-selector tables no longer exist in compiled
object data (instead, the SCI3 VM uses selectors directly and
object data contains a bit map of valid selectors). In ScummVM,
the table is generated by Object::initSelectorsSci3 for
compatibility with the design of the ScummVM SCI VM. For
consistency, _baseVars is converted to use a standard container,
which works for all SCI versions.
The table for SCI3 property offsets is also changed to use a
standard container instead of manually managing the memory with
malloc/free.
Diffstat (limited to 'engines/sci/engine/savegame.cpp')
-rw-r--r-- | engines/sci/engine/savegame.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index 4c16770fc5..a82499adc4 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -103,6 +103,10 @@ 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. @@ -415,6 +419,12 @@ void Object::saveLoadWithSerializer(Common::Serializer &s) { s.syncAsSint32LE(_methodCount); // that's actually a uint16 syncArray<reg_t>(s, _variables); + if (s.getVersion() >= 42 && getSciVersion() == SCI_VERSION_3) { + syncArray<bool>(s, _mustSetViewVisible); + syncWithSerializer(s, _superClassPosSci3); + syncWithSerializer(s, _speciesSelectorSci3); + syncWithSerializer(s, _infoSelectorSci3); + } } |