diff options
author | Paul Gilbert | 2015-08-15 20:26:36 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-08-15 20:26:36 -0400 |
commit | 621a37bbe30756a7983c1e5463389539898d41a5 (patch) | |
tree | d5f1fa95dd03590865d875a91a64f3a776987bad /engines/sherlock/scalpel | |
parent | 11e327c4e7d41e01378cbdbaf339bbd09881f326 (diff) | |
download | scummvm-rg350-621a37bbe30756a7983c1e5463389539898d41a5.tar.gz scummvm-rg350-621a37bbe30756a7983c1e5463389539898d41a5.tar.bz2 scummvm-rg350-621a37bbe30756a7983c1e5463389539898d41a5.zip |
SHERLOCK: Fix saving/loading when characters are moving
Diffstat (limited to 'engines/sherlock/scalpel')
-rw-r--r-- | engines/sherlock/scalpel/scalpel_people.cpp | 18 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_people.h | 5 |
2 files changed, 19 insertions, 4 deletions
diff --git a/engines/sherlock/scalpel/scalpel_people.cpp b/engines/sherlock/scalpel/scalpel_people.cpp index 53876f8f1c..9ff3127020 100644 --- a/engines/sherlock/scalpel/scalpel_people.cpp +++ b/engines/sherlock/scalpel/scalpel_people.cpp @@ -370,6 +370,18 @@ Common::Point ScalpelPerson::getSourcePoint() const { _position.y / FIXED_INT_MULTIPLIER); } +void ScalpelPerson::synchronize(Serializer &s) { + s.syncAsSint32LE(_position.x); + s.syncAsSint32LE(_position.y); + s.syncAsSint32LE(_delta.x); + s.syncAsSint32LE(_delta.y); + s.syncAsSint16LE(_sequenceNumber); + s.syncAsSint16LE(_walkCount); + + // Walk to list + _walkTo.synchronize(s); +} + /*----------------------------------------------------------------*/ ScalpelPeople::ScalpelPeople(SherlockEngine *vm) : People(vm) { @@ -436,11 +448,9 @@ void ScalpelPeople::setTalking(int speaker) { } void ScalpelPeople::synchronize(Serializer &s) { - s.syncAsByte(_holmesOn); - s.syncAsSint32LE(_data[HOLMES]->_position.x); - s.syncAsSint32LE(_data[HOLMES]->_position.y); - s.syncAsSint16LE(_data[HOLMES]->_sequenceNumber); + (*this)[HOLMES].synchronize(s); s.syncAsSint16LE(_holmesQuotient); + s.syncAsByte(_holmesOn); if (s.isLoading()) { _savedPos = _data[HOLMES]->_position; diff --git a/engines/sherlock/scalpel/scalpel_people.h b/engines/sherlock/scalpel/scalpel_people.h index b53da2e6d8..ad9a6a5296 100644 --- a/engines/sherlock/scalpel/scalpel_people.h +++ b/engines/sherlock/scalpel/scalpel_people.h @@ -47,6 +47,11 @@ public: virtual ~ScalpelPerson() {} /** + * Synchronize the data for a savegame + */ + virtual void synchronize(Serializer &s); + + /** * This adjusts the sprites position, as well as it's animation sequence: */ virtual void adjustSprite(); |