diff options
author | Paul Gilbert | 2015-04-21 22:51:03 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-04-21 22:51:03 -0500 |
commit | 0984405a0dbe718522117507d7c75dc619c586a8 (patch) | |
tree | 4755b06e6838a93847d09d48bd1d425ba1010674 /engines/sherlock/inventory.cpp | |
parent | 31860163709b12a38856fc017a217eb5e32610a7 (diff) | |
download | scummvm-rg350-0984405a0dbe718522117507d7c75dc619c586a8.tar.gz scummvm-rg350-0984405a0dbe718522117507d7c75dc619c586a8.tar.bz2 scummvm-rg350-0984405a0dbe718522117507d7c75dc619c586a8.zip |
SHERLOCK: Implement savegame synchronization
Diffstat (limited to 'engines/sherlock/inventory.cpp')
-rw-r--r-- | engines/sherlock/inventory.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/sherlock/inventory.cpp b/engines/sherlock/inventory.cpp index 9eedac7c6a..3ba6f9d2bd 100644 --- a/engines/sherlock/inventory.cpp +++ b/engines/sherlock/inventory.cpp @@ -486,4 +486,24 @@ int Inventory::deleteItemFromInventory(const Common::String &name) { return 1; } +/** + * Synchronize the data for a savegame + */ +void Inventory::synchronize(Common::Serializer &s) { + s.syncAsSint16LE(_holdings); + + uint count = size(); + s.syncAsUint16LE(count); + if (s.isLoading()) { + resize(count); + + // Reset inventory back to start + _invIndex = 0; + } + + for (uint idx = 0; idx < size(); ++idx) { + // TODO + } +} + } // End of namespace Sherlock |