FULLPIPE: Implement inventory saving
This commit is contained in:
parent
358f2d4845
commit
210a57c4c0
3 changed files with 10 additions and 4 deletions
|
@ -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());
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue