From 90c6c0580ec4071d22a50e4c0276ac98e69af38a Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Thu, 9 Feb 2017 19:11:58 -0600 Subject: 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. --- engines/sci/engine/savegame.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'engines/sci/engine/savegame.cpp') 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(s, _variables); + if (s.getVersion() >= 42 && getSciVersion() == SCI_VERSION_3) { + syncArray(s, _mustSetViewVisible); + syncWithSerializer(s, _superClassPosSci3); + syncWithSerializer(s, _speciesSelectorSci3); + syncWithSerializer(s, _infoSelectorSci3); + } } -- cgit v1.2.3