Skip to content

Commit

Permalink
FULLPIPE: Implement inventory saving
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Sep 17, 2016
1 parent 358f2d4 commit 210a57c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion engines/fullpipe/gameloader.cpp
Expand Up @@ -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());

Expand Down
10 changes: 8 additions & 2 deletions engines/fullpipe/inventory.cpp
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion engines/fullpipe/inventory.h
Expand Up @@ -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);
Expand Down

0 comments on commit 210a57c

Please sign in to comment.