aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorEugene Sandulenko2005-04-20 23:42:19 +0000
committerEugene Sandulenko2005-04-20 23:42:19 +0000
commitbd5f93cece55bf5d75fa05d5623bed0da0cb3672 (patch)
tree13b9b65722140ac2f257d39db50a52c9cb664792 /saga
parent7963bb4cb92345948b8f737df8414929f93db527 (diff)
downloadscummvm-rg350-bd5f93cece55bf5d75fa05d5623bed0da0cb3672.tar.gz
scummvm-rg350-bd5f93cece55bf5d75fa05d5623bed0da0cb3672.tar.bz2
scummvm-rg350-bd5f93cece55bf5d75fa05d5623bed0da0cb3672.zip
Implement inventoryItemPosition()
svn-id: r17724
Diffstat (limited to 'saga')
-rw-r--r--saga/interface.cpp8
-rw-r--r--saga/interface.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/saga/interface.cpp b/saga/interface.cpp
index deee66e960..361254b81b 100644
--- a/saga/interface.cpp
+++ b/saga/interface.cpp
@@ -535,6 +535,14 @@ void Interface::removeFromInventory(int sprite) {
}
}
+int Interface::inventoryItemPosition(int sprite) {
+ for (int i = 0; i < _inventoryCount; i++)
+ if (_inventory[i] == sprite)
+ return i;
+
+ return -1;
+}
+
void Interface::drawInventory() {
if (_panelMode != kPanelMain)
return;
diff --git a/saga/interface.h b/saga/interface.h
index acc9c8bf98..84c8322004 100644
--- a/saga/interface.h
+++ b/saga/interface.h
@@ -139,6 +139,7 @@ public:
void addToInventory(int sprite);
void removeFromInventory(int sprite);
+ int inventoryItemPosition(int sprite);
void drawInventory();
private: