aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2013-08-23 00:01:58 +0300
committerEugene Sandulenko2013-09-06 14:51:17 +0300
commit739c24cdd10a329a729a185ca25bed6acc05dfef (patch)
tree0589953fc4c561794d244c8cb06379ad97900489 /engines
parentebaf5f6b4d36e9009014ffdd9286b153f611def1 (diff)
downloadscummvm-rg350-739c24cdd10a329a729a185ca25bed6acc05dfef.tar.gz
scummvm-rg350-739c24cdd10a329a729a185ca25bed6acc05dfef.tar.bz2
scummvm-rg350-739c24cdd10a329a729a185ca25bed6acc05dfef.zip
FULLPIPE: Implement CInventory2::addItem()
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/inventory.cpp5
-rw-r--r--engines/fullpipe/inventory.h5
2 files changed, 7 insertions, 3 deletions
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index c7e1fbcf70..36ee7129ab 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -96,8 +96,9 @@ bool CInventory2::loadPartial(MfcArchive &file) { // CInventory2_SerializePartia
return true;
}
-void CInventory2::addItem(int itemId, int value) {
- warning("STUB: CInventory2::addItem(%d, %d)", itemId, value);
+void CInventory2::addItem(int itemId, int count) {
+ if (getInventoryPoolItemIndexById(itemId) >= 0)
+ _inventoryItems.push_back(new InventoryItem(itemId, count));
}
void CInventory2::rebuildItemRects() {
diff --git a/engines/fullpipe/inventory.h b/engines/fullpipe/inventory.h
index f451b6a5da..0d16909f6a 100644
--- a/engines/fullpipe/inventory.h
+++ b/engines/fullpipe/inventory.h
@@ -59,6 +59,9 @@ class CInventory : public CObject {
struct InventoryItem {
int16 itemId;
int16 count;
+
+ InventoryItem() { itemId = count = 0; }
+ InventoryItem(int id, int cnt) : itemId(id), count(cnt) {}
};
typedef Common::Array<InventoryItem *> InventoryItems;
@@ -95,7 +98,7 @@ class CInventory2 : public CInventory {
public:
CInventory2();
bool loadPartial(MfcArchive &file);
- void addItem(int itemId, int value);
+ void addItem(int itemId, int count);
void rebuildItemRects();
Scene *getScene() { return _scene; }