aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/inventory.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2013-08-26 14:22:59 +0300
committerEugene Sandulenko2013-09-06 14:51:20 +0300
commitd8bc218ce81ec7d24015bcb9a118e33aa244f225 (patch)
treeaa7885c6c27c7a6a67f55651744297d2b01337a6 /engines/fullpipe/inventory.cpp
parent624309b0db913ab15ce58992603ab76c9f53598d (diff)
downloadscummvm-rg350-d8bc218ce81ec7d24015bcb9a118e33aa244f225.tar.gz
scummvm-rg350-d8bc218ce81ec7d24015bcb9a118e33aa244f225.tar.bz2
scummvm-rg350-d8bc218ce81ec7d24015bcb9a118e33aa244f225.zip
FULLPIPE: More work on global_messageHandler3()
Diffstat (limited to 'engines/fullpipe/inventory.cpp')
-rw-r--r--engines/fullpipe/inventory.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index 9384cb2463..adfbf664a2 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -25,6 +25,7 @@
#include "fullpipe/utils.h"
#include "fullpipe/inventory.h"
#include "fullpipe/gameloader.h"
+#include "fullpipe/statics.h"
namespace Fullpipe {
@@ -101,6 +102,41 @@ void CInventory2::addItem(int itemId, int count) {
_inventoryItems.push_back(new InventoryItem(itemId, count));
}
+void CInventory2::addItem2(StaticANIObject *obj) {
+ if (getInventoryPoolItemIndexById(obj->_id) >= 0 && getInventoryPoolItemFieldCById(obj->_id) != 2) {
+ addItem(obj->_id, 1);
+ obj->hide();
+ }
+}
+
+void CInventory2::removeItem(int itemId, int count) {
+ warning("STUB: CInventory2::removeItem(%d, %d)", itemId, count);
+}
+
+void CInventory2::removeItem2(Scene *sceneObj, int itemId, int x, int y, int priority) {
+ warning("STUB: void removeItem2(sc, %d, %d, %d, %d)", itemId, x, y, priority);
+}
+
+int CInventory2::getCountItemsWithId(int itemId) {
+ int res = 0;
+
+ for (uint i = 0; i < _inventoryItems.size(); i++) {
+ if (_inventoryItems[i]->itemId == itemId)
+ res += _inventoryItems[i]->count;
+ }
+
+ return res;
+}
+
+int CInventory2::getInventoryPoolItemFieldCById(int itemId) {
+ for (uint i = 0; i < _itemsPool.size(); i++) {
+ if (_itemsPool[i]->id == itemId)
+ return _itemsPool[i]->field_C;
+ }
+
+ return 0;
+}
+
void CInventory2::rebuildItemRects() {
_scene = g_fullpipe->accessScene(_sceneId);