diff options
author | Paul Gilbert | 2015-06-07 19:18:14 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-06-07 19:18:14 -0400 |
commit | af2a1a33514ae101d1df52e6a978296ed0bef68b (patch) | |
tree | da8cd807e375ad6b8d20d374ccfc685f3e3805c7 /engines/sherlock/tattoo | |
parent | 19448b2fdb172a6fd85b0ffad727116dea19d5d5 (diff) | |
download | scummvm-rg350-af2a1a33514ae101d1df52e6a978296ed0bef68b.tar.gz scummvm-rg350-af2a1a33514ae101d1df52e6a978296ed0bef68b.tar.bz2 scummvm-rg350-af2a1a33514ae101d1df52e6a978296ed0bef68b.zip |
SHERLOCK: Refactoring, cleanup, and fixes for savegame code
Diffstat (limited to 'engines/sherlock/tattoo')
-rw-r--r-- | engines/sherlock/tattoo/tattoo_people.cpp | 22 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_people.h | 4 |
2 files changed, 26 insertions, 0 deletions
diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp index 4e4f11b983..6952c876c0 100644 --- a/engines/sherlock/tattoo/tattoo_people.cpp +++ b/engines/sherlock/tattoo/tattoo_people.cpp @@ -200,6 +200,28 @@ void TattooPeople::setTalkSequence(int speaker, int sequenceNum) { } } +void TattooPeople::synchronize(Serializer &s) { + s.syncAsByte(_holmesOn); + + for (int idx = 0; idx < MAX_CHARACTERS; ++idx) { + Person &p = _data[idx]; + s.syncAsSint32LE(p._position.x); + s.syncAsSint32LE(p._position.y); + s.syncAsSint16LE(p._sequenceNumber); + s.syncAsSint16LE(p._type); + s.syncString(p._walkVGSName); + s.syncString(p._description); + s.syncString(p._examine); + } + + s.syncAsSint16LE(_holmesQuotient); + + if (s.isLoading()) { + _hSavedPos = _player._position; + _hSavedFacing = _player._sequenceNumber; + } +} + } // End of namespace Tattoo } // End of namespace Sherlock diff --git a/engines/sherlock/tattoo/tattoo_people.h b/engines/sherlock/tattoo/tattoo_people.h index 481ce7804a..c4f0bfd3ed 100644 --- a/engines/sherlock/tattoo/tattoo_people.h +++ b/engines/sherlock/tattoo/tattoo_people.h @@ -87,6 +87,10 @@ public: */ void setListenSequence(int speaker, int sequenceNum); + /** + * Synchronize the data for a savegame + */ + virtual void synchronize(Serializer &s); /** * Change the sequence of the scene background object associated with the specified speaker. |