From 0984405a0dbe718522117507d7c75dc619c586a8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 21 Apr 2015 22:51:03 -0500 Subject: SHERLOCK: Implement savegame synchronization --- engines/sherlock/inventory.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'engines/sherlock/inventory.cpp') 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 -- cgit v1.2.3