diff options
author | Nicola Mettifogo | 2007-09-23 20:17:50 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-09-23 20:17:50 +0000 |
commit | 05abbf49a2990fb16070682ab177aa88e823a382 (patch) | |
tree | ebe9980cf25252e4725ed68a533289133c697d5e /engines/parallaction/saveload.cpp | |
parent | 7da28f6129cf8b0fb06bbbc0f9d5e848c1695e9c (diff) | |
download | scummvm-rg350-05abbf49a2990fb16070682ab177aa88e823a382.tar.gz scummvm-rg350-05abbf49a2990fb16070682ab177aa88e823a382.tar.bz2 scummvm-rg350-05abbf49a2990fb16070682ab177aa88e823a382.zip |
Moved most of inventory-related code inside classes Inventory and InventoryRenderer. Shift is not completed, as new code doesn't handle selections yet (falling back to existent code).
svn-id: r29060
Diffstat (limited to 'engines/parallaction/saveload.cpp')
-rw-r--r-- | engines/parallaction/saveload.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index eb7d5c502a..778466a9cd 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -136,12 +136,19 @@ void Parallaction_ns::doLoadGame(uint16 slot) { } _locationNames[_si][0] = '\0'; + cleanInventory(false); + ItemName name; + uint32 value; + for (_si = 0; _si < 30; _si++) { f->readLine(s, 15); - _inventory[_si]._id = atoi(s); + value = atoi(s); f->readLine(s, 15); - _inventory[_si]._index = atoi(s); + name = atoi(s); + + printf("loadGame: inv[%i].id = %i, inv[%i].index = %i\n", _si, value, _si, name); + addInventoryItem(name, value); } delete f; @@ -203,8 +210,10 @@ void Parallaction_ns::doSaveGame(uint16 slot, const char* name) { f->writeString(s); } + const InventoryItem *item; for (uint16 _si = 0; _si < 30; _si++) { - sprintf(s, "%u\n%d\n", _inventory[_si]._id, _inventory[_si]._index); + item = getInventoryItem(_si); + sprintf(s, "%u\n%d\n", item->_id, item->_index); f->writeString(s); } @@ -373,7 +382,7 @@ void Parallaction_ns::loadGame() { GUI::TimedMessageDialog dialog("Loading game...", 1500); dialog.runModal(); - changeCursor(kCursorArrow); + setArrowCursor(); return; } |