aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control/pet_inventory.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-17 21:08:42 -0400
committerPaul Gilbert2016-07-10 16:11:21 -0400
commit46a30255b0e5a7f5dad4fd032388d31a69208b62 (patch)
tree1e668339aecb1246c9ec20515b81866d81ab75d2 /engines/titanic/pet_control/pet_inventory.cpp
parenta11e677494d7cb3c6b8ed2c56095873d46a00ab8 (diff)
downloadscummvm-rg350-46a30255b0e5a7f5dad4fd032388d31a69208b62.tar.gz
scummvm-rg350-46a30255b0e5a7f5dad4fd032388d31a69208b62.tar.bz2
scummvm-rg350-46a30255b0e5a7f5dad4fd032388d31a69208b62.zip
TITANIC: Seperate PET classes setup and reset methods
Diffstat (limited to 'engines/titanic/pet_control/pet_inventory.cpp')
-rw-r--r--engines/titanic/pet_control/pet_inventory.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index e765db60ea..ff333ed79c 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -35,11 +35,11 @@ CPetInventory::CPetInventory() : CPetSection(),
}
bool CPetInventory::setup(CPetControl *petControl) {
- return setPetControl(petControl) && setup();
+ return setPetControl(petControl) && reset();
}
-bool CPetInventory::setup() {
- _items.setup();
+bool CPetInventory::reset() {
+ _items.reset();
_sub12.setup();
// TODO
@@ -80,7 +80,7 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
return false;
_petControl = petControl;
- _items.proc8();
+ _items.setup(7, this);
_items.set20(28);
Rect tempRect(0, 0, 52, 52);
@@ -103,20 +103,18 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
return true;
}
-void CPetInventory::addItem(CCarry *item) {
+void CPetInventory::change(CCarry *item) {
if (item) {
- CPetCarry glyphItem(item, 2);
-
+ CInventoryGlyphAction action(item, ACTION_CHANGE);
+ _items.change(&action);
}
- warning("TODO: CPetInventory::addItem");
}
void CPetInventory::itemRemoved(CCarry *item) {
- warning("TODO: CPetInventory::itemRemoved");
-}
-
-void CPetInventory::fn3(CCarry *item) {
- warning("TODO: CPetInventory::fn3");
+ if (item) {
+ CInventoryGlyphAction action(item, ACTION_REMOVED);
+ _items.change(&action);
+ }
}
void CPetInventory::itemsChanged() {