diff options
author | Eugene Sandulenko | 2016-09-17 01:10:49 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-09-17 20:43:57 +0200 |
commit | 210a57c4c07733edb31733a1c81a53b01fb6eb7a (patch) | |
tree | 8ef8795594c9163cffb693dcc423337eca76b766 | |
parent | 358f2d4845b10117192c440f74b245d0e5536a07 (diff) | |
download | scummvm-rg350-210a57c4c07733edb31733a1c81a53b01fb6eb7a.tar.gz scummvm-rg350-210a57c4c07733edb31733a1c81a53b01fb6eb7a.tar.bz2 scummvm-rg350-210a57c4c07733edb31733a1c81a53b01fb6eb7a.zip |
FULLPIPE: Implement inventory saving
-rw-r--r-- | engines/fullpipe/gameloader.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/inventory.cpp | 10 | ||||
-rw-r--r-- | engines/fullpipe/inventory.h | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index 7a862eec19..83da25dbf3 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -659,7 +659,7 @@ void GameLoader::writeSavegame(Scene *sc, const char *fname) { v->_prevVarObj = prv; } - getGameLoaderInventory()->writePartial(saveFile); + getGameLoaderInventory()->savePartial(saveFile); saveFile->writeUint32LE(_sc2array.size()); diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp index 10a584782b..335635c6e8 100644 --- a/engines/fullpipe/inventory.cpp +++ b/engines/fullpipe/inventory.cpp @@ -106,8 +106,14 @@ bool Inventory2::loadPartial(MfcArchive &file) { // Inventory2_SerializePartiall return true; } -bool Inventory2::writePartial(Common::WriteStream *file) { - warning("STUB: nventory2::writePartial()"); +bool Inventory2::savePartial(Common::WriteStream *saveFile) { + saveFile->writeUint32LE(_inventoryItems.size()); + + for (uint i = 0; i < _inventoryItems.size(); i++) { + saveFile->writeUint16LE(_inventoryItems[i]->itemId); + saveFile->writeUint16LE(_inventoryItems[i]->count); + } + return true; } diff --git a/engines/fullpipe/inventory.h b/engines/fullpipe/inventory.h index 6f6e349eea..e619f7d0e1 100644 --- a/engines/fullpipe/inventory.h +++ b/engines/fullpipe/inventory.h @@ -101,7 +101,7 @@ class Inventory2 : public Inventory { virtual ~Inventory2(); bool loadPartial(MfcArchive &file); - bool writePartial(Common::WriteStream *file); + bool savePartial(Common::WriteStream *file); void addItem(int itemId, int count); void addItem2(StaticANIObject *obj); void removeItem(int itemId, int count); |