aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/fullpipe/gameloader.cpp2
-rw-r--r--engines/fullpipe/inventory.cpp10
-rw-r--r--engines/fullpipe/inventory.h2
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);