aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-04-21 09:47:03 +0300
committerEugene Sandulenko2014-04-21 09:47:03 +0300
commitc73a10606ef342978cd9e7f72d2b2b562524c7cc (patch)
tree486342e37e485eb5ed2edd19cbf5f019162b8908
parent3091d0ae7f9ea1a8fc1d1be9bc773c853787fa26 (diff)
downloadscummvm-rg350-c73a10606ef342978cd9e7f72d2b2b562524c7cc.tar.gz
scummvm-rg350-c73a10606ef342978cd9e7f72d2b2b562524c7cc.tar.bz2
scummvm-rg350-c73a10606ef342978cd9e7f72d2b2b562524c7cc.zip
FULLPIPE: Implement Inventory2::clear()
-rw-r--r--engines/fullpipe/interaction.cpp9
-rw-r--r--engines/fullpipe/inventory.cpp9
-rw-r--r--engines/fullpipe/inventory.h2
3 files changed, 19 insertions, 1 deletions
diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp
index f24f21584d..84e9688e30 100644
--- a/engines/fullpipe/interaction.cpp
+++ b/engines/fullpipe/interaction.cpp
@@ -429,7 +429,14 @@ Interaction::Interaction() {
}
Interaction::~Interaction() {
- warning("STUB: Interaction::~Interaction()");
+ if (_messageQueue) {
+ while (_messageQueue->getExCommandByIndex(0))
+ _messageQueue->deleteExCommandByIndex(0, 1);
+ }
+
+ delete _messageQueue;
+
+ free(_actionName);
}
bool Interaction::load(MfcArchive &file) {
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index cfe8adf86f..e79f9c54df 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -447,6 +447,15 @@ int Inventory2::getHoveredItem(Common::Point *point) {
return 0;
}
+void Inventory2::clear() {
+ unselectItem(0);
+
+ for (uint i = 0; i < _inventoryItems.size(); i++)
+ getInventoryPoolItemFieldCById(_inventoryItems[i]->itemId);
+
+ _inventoryItems.clear();
+}
+
void FullpipeEngine::getAllInventory() {
Inventory2 *inv = getGameLoaderInventory();
diff --git a/engines/fullpipe/inventory.h b/engines/fullpipe/inventory.h
index 833cccc355..46b55c5669 100644
--- a/engines/fullpipe/inventory.h
+++ b/engines/fullpipe/inventory.h
@@ -129,6 +129,8 @@ class Inventory2 : public Inventory {
bool unselectItem(bool flag);
void draw();
+
+ void clear();
};
} // End of namespace Fullpipe