aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/carry
diff options
context:
space:
mode:
authorPaul Gilbert2016-06-26 12:39:44 -0400
committerPaul Gilbert2016-07-15 19:25:09 -0400
commit6f063c4703e5705edbba7ad39ef9c0656b74bc75 (patch)
tree64cb04d4e3f3a327f6a080ffef8e7af6c0f12152 /engines/titanic/carry
parent0146a3c6b6bdb16eef6f46e116b0d9fe9883858f (diff)
downloadscummvm-rg350-6f063c4703e5705edbba7ad39ef9c0656b74bc75.tar.gz
scummvm-rg350-6f063c4703e5705edbba7ad39ef9c0656b74bc75.tar.bz2
scummvm-rg350-6f063c4703e5705edbba7ad39ef9c0656b74bc75.zip
TITANIC: Fleshing out CGameObject and CPetControl methods
Diffstat (limited to 'engines/titanic/carry')
-rw-r--r--engines/titanic/carry/arm.cpp10
-rw-r--r--engines/titanic/carry/brain.cpp4
-rw-r--r--engines/titanic/carry/bridge_piece.cpp4
-rw-r--r--engines/titanic/carry/carry.cpp22
-rw-r--r--engines/titanic/carry/carry.h10
-rw-r--r--engines/titanic/carry/carry_parrot.cpp4
-rw-r--r--engines/titanic/carry/chicken.cpp12
-rw-r--r--engines/titanic/carry/napkin.cpp4
8 files changed, 23 insertions, 47 deletions
diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
index d662b43f76..ee58aea445 100644
--- a/engines/titanic/carry/arm.cpp
+++ b/engines/titanic/carry/arm.cpp
@@ -119,7 +119,7 @@ bool CArm::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (hookedMsg._result) {
_string7 = "GondolierLeftLever";
} else {
- addToInventory();
+ petAddToInventory();
}
} else if (msg->_other->getName() == "GondolierRightLever") {
CIsHookedOnMsg hookedMsg(_hookedRect, 0, getName());
@@ -129,7 +129,7 @@ bool CArm::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (hookedMsg._result) {
_string7 = "GondolierRightLever";
} else {
- addToInventory();
+ petAddToInventory();
}
}
@@ -166,13 +166,13 @@ bool CArm::MaitreDHappyMsg(CMaitreDHappyMsg *msg) {
CGameObject *child = static_cast<CGameObject *>(getFirstChild());
if (child) {
child->setVisible(true);
- addToInventory();
+ petAddToInventory();
}
_visibleFrame = _field170;
loadFrame(_visibleFrame);
_string6 = "None";
- invChange();
+ petInvChange();
}
}
@@ -189,7 +189,7 @@ bool CArm::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
_visibleFrame = _field170;
loadFrame(_visibleFrame);
child->setVisible(true);
- child->addToInventory();
+ child->petAddToInventory();
}
_string6 = "None";
diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp
index acc29b3f0e..a60e652bda 100644
--- a/engines/titanic/carry/brain.cpp
+++ b/engines/titanic/carry/brain.cpp
@@ -59,13 +59,13 @@ bool CBrain::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (slot) {
if (slot->getName() == "CentralCore") {
setVisible(false);
- moveToHiddenRoom();
+ petMoveToHiddenRoom();
CAddHeadPieceMsg headpieceMsg(getName());
headpieceMsg.execute("CentralCoreSlot");
}
else if (!slot->_value1 && slot->getName() == "CentralCoreSlot") {
setVisible(false);
- moveToHiddenRoom();
+ petMoveToHiddenRoom();
CAddHeadPieceMsg headpieceMsg(getName());
headpieceMsg.execute(msg->_other);
playSound("z#116.wav", 100, 0, 0);
diff --git a/engines/titanic/carry/bridge_piece.cpp b/engines/titanic/carry/bridge_piece.cpp
index 4fafac26b5..1fe5e048ed 100644
--- a/engines/titanic/carry/bridge_piece.cpp
+++ b/engines/titanic/carry/bridge_piece.cpp
@@ -56,14 +56,14 @@ bool CBridgePiece::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (!shipSetting) {
return CCarry::UseWithOtherMsg(msg);
} else if (shipSetting->_string4 == "NULL") {
- addToInventory();
+ petAddToInventory();
return true;
} else {
setVisible(false);
playSound("z#54.wav", 100, 0, 0);
setPosition(shipSetting->_pos1);
shipSetting->_string4 = getName();
- moveToHiddenRoom();
+ petMoveToHiddenRoom();
CAddHeadPieceMsg headpieceMsg(shipSetting->getName() == _string6 ?
"Enable" : "Disable");
diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index cb87b94c90..ca022a6c8f 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -123,7 +123,7 @@ bool CCarry::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) {
if (msg->_dropTarget) {
if (msg->_dropTarget->isPet()) {
- addToInventory();
+ petAddToInventory();
return true;
}
@@ -147,7 +147,7 @@ bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) {
CString viewName = getViewFullName();
if (viewName.empty() || msg->_mousePos.y >= 360) {
sleep(250);
- addToInventory();
+ petAddToInventory();
} else {
setPosition(_origPos);
loadFrame(_itemFrame);
@@ -165,7 +165,7 @@ bool CCarry::UseWithCharMsg(CUseWithCharMsg *msg) {
} else {
CShowTextMsg textMsg(_string4);
textMsg.execute("PET");
- addToInventory();
+ petAddToInventory();
}
return true;
@@ -182,7 +182,7 @@ bool CCarry::UseWithOtherMsg(CUseWithOtherMsg *msg) {
_fullViewName = getViewFullName();
if (_fullViewName.empty() || _bounds.top >= 360) {
sleep(250);
- addToInventory();
+ petAddToInventory();
} else {
setPosition(_origPos);
}
@@ -238,18 +238,4 @@ bool CCarry::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
return true;
}
-void CCarry::addToInventory() {
- CPetControl *pet = getPetControl();
- if (pet) {
- makeDirty();
- pet->addToInventory(this);
- }
-}
-
-void CCarry::invChange() {
- CPetControl *pet = getPetControl();
- if (pet)
- pet->invChange(this);
-}
-
} // End of namespace Titanic
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index ba782fda7e..f4476721cc 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -61,11 +61,6 @@ protected:
int _enterFrame;
bool _enterFrameSet;
int _visibleFrame;
-protected:
- /**
- *
- */
- void invChange();
public:
CLASSDEF
CCarry();
@@ -79,11 +74,6 @@ public:
* Load the data for the class from file
*/
virtual void load(SimpleFile *file);
-
- /**
- * Add the item to the inventory
- */
- void addToInventory();
};
} // End of namespace Titanic
diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index e274679b82..b0916bb4c4 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -105,7 +105,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
stopMovie();
if (msg->_mousePos.y >= 360) {
- addToInventory();
+ petAddToInventory();
return true;
}
@@ -215,7 +215,7 @@ bool CCarryParrot::ActMsg(CActMsg *msg) {
CCarry *feathers = static_cast<CCarry *>(getRoot()->findByName("Feathers"));
if (feathers) {
feathers->setVisible(true);
- feathers->addToInventory();
+ feathers->petAddToInventory();
}
_field140 = true;
diff --git a/engines/titanic/carry/chicken.cpp b/engines/titanic/carry/chicken.cpp
index 8483a3fb29..60627bdb7e 100644
--- a/engines/titanic/carry/chicken.cpp
+++ b/engines/titanic/carry/chicken.cpp
@@ -72,13 +72,13 @@ bool CChicken::UseWithOtherMsg(CUseWithOtherMsg *msg) {
if (_field12C || _string6 == "None") {
CActMsg actMsg("Clean");
actMsg.execute(this);
- addToInventory();
+ petAddToInventory();
} else {
CShowTextMsg textMsg("The chicken is already clean.");
textMsg.execute("PET");
}
- addToInventory();
+ petAddToInventory();
} else {
CSauceDispensor *dispensor = static_cast<CSauceDispensor *>(msg->_other);
if (!dispensor || _string6 == "None") {
@@ -101,7 +101,7 @@ bool CChicken::UseWithCharMsg(CUseWithCharMsg *msg) {
acceptMsg._item = this;
acceptMsg.execute(succubus);
} else {
- addToInventory();
+ petAddToInventory();
}
return true;
@@ -110,7 +110,7 @@ bool CChicken::UseWithCharMsg(CUseWithCharMsg *msg) {
bool CChicken::ActMsg(CActMsg *msg) {
if (msg->_action == "GoToPET") {
setVisible(true);
- addToInventory();
+ petAddToInventory();
} else if (msg->_action == "Tomato") {
_string6 = "Tomato";
loadFrame(4);
@@ -142,7 +142,7 @@ bool CChicken::ActMsg(CActMsg *msg) {
_v1 = 120;
} else if (msg->_action == "Eaten") {
setVisible(false);
- moveToHiddenRoom();
+ petMoveToHiddenRoom();
_field13C = 1;
}
@@ -171,7 +171,7 @@ bool CChicken::TimerMsg(CTimerMsg *msg) {
}
if (flag) {
- invChange();
+ petInvChange();
stopTimer(_timerId);
}
diff --git a/engines/titanic/carry/napkin.cpp b/engines/titanic/carry/napkin.cpp
index a8ceaad5ba..cba2b4a560 100644
--- a/engines/titanic/carry/napkin.cpp
+++ b/engines/titanic/carry/napkin.cpp
@@ -49,11 +49,11 @@ bool CNapkin::UseWithOtherMsg(CUseWithOtherMsg *msg) {
CActMsg actMsg("Clean");
actMsg.execute("Chicken");
} else {
- petDisplayMsg("The Chicken is already quite clean enough, thank you.");
+ petDisplayMessage("The Chicken is already quite clean enough, thank you.");
}
}
- addToInventory();
+ petAddToInventory();
return CCarry::UseWithOtherMsg(msg);
}