aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-01-18 20:54:05 -0500
committerPaul Gilbert2017-01-18 20:54:05 -0500
commit12ebe10d0178ecbdec1cc58e165926cb58cb13ff (patch)
tree5c339ba572f89eb0814070d4e8f33f607f0ff5ee
parenta4997f62cc51575b914e15a90923058cb5c58bac (diff)
downloadscummvm-rg350-12ebe10d0178ecbdec1cc58e165926cb58cb13ff.tar.gz
scummvm-rg350-12ebe10d0178ecbdec1cc58e165926cb58cb13ff.tar.bz2
scummvm-rg350-12ebe10d0178ecbdec1cc58e165926cb58cb13ff.zip
TITANIC: Renaming of CParrot statics, miscellaneous fixes
-rw-r--r--engines/titanic/carry/carry_parrot.cpp2
-rw-r--r--engines/titanic/carry/central_core.cpp6
-rw-r--r--engines/titanic/game/cage.cpp4
-rw-r--r--engines/titanic/game/parrot/parrot_perch_holder.cpp2
-rw-r--r--engines/titanic/npcs/parrot.cpp42
-rw-r--r--engines/titanic/npcs/parrot.h8
6 files changed, 33 insertions, 31 deletions
diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index c97adc080c..3a2f2c9368 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -107,7 +107,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
petAddToInventory();
} else if (compareViewNameTo("ParrotLobby.Node 1.N")) {
if (msg->_mousePos.x >= 75 && msg->_mousePos.x <= 565 &&
- !CParrot::_v2 && !CCage::_open) {
+ !CParrot::_takeOff && !CCage::_open) {
setVisible(false);
_canTake = false;
CTreeItem *perchedParrot = findUnder(getRoot(), "PerchedParrot");
diff --git a/engines/titanic/carry/central_core.cpp b/engines/titanic/carry/central_core.cpp
index afc3b85bf0..457428ccfc 100644
--- a/engines/titanic/carry/central_core.cpp
+++ b/engines/titanic/carry/central_core.cpp
@@ -57,9 +57,9 @@ bool CCentralCore::UseWithOtherMsg(CUseWithOtherMsg *msg) {
bool CCentralCore::DropZoneLostObjectMsg(CDropZoneLostObjectMsg *msg) {
CString name = msg->_object->getName();
if (name == "PerchCoreHolder") {
- CParrot::_v2 = 1;
+ CParrot::_takeOff = true;
if (isEquals("CentralCore"))
- CParrot::_v5 = 0;
+ CParrot::_coreReplaced = false;
CActMsg actMsg("LosePerch");
actMsg.execute("ParrotLobbyController");
@@ -75,7 +75,7 @@ bool CCentralCore::DropZoneGotObjectMsg(CDropZoneGotObjectMsg *msg) {
CString name = msg->_object->getName();
if (name == "PerchCoreHolder") {
if (isEquals("CentralCore")) {
- CParrot::_v5 = 1;
+ CParrot::_coreReplaced = true;
CActMsg actMsg("CoreReplaced");
actMsg.execute("ParrotCage");
}
diff --git a/engines/titanic/game/cage.cpp b/engines/titanic/game/cage.cpp
index 11f5837e4c..f51e935231 100644
--- a/engines/titanic/game/cage.cpp
+++ b/engines/titanic/game/cage.cpp
@@ -53,7 +53,7 @@ void CCage::load(SimpleFile *file) {
}
bool CCage::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
- if (CParrot::_state != PARROT_IN_CAGE && !CParrot::_v5) {
+ if (CParrot::_state != PARROT_IN_CAGE && !CParrot::_coreReplaced) {
CActMsg actMsg(_open ? "Open" : "Shut");
actMsg.execute(this);
}
@@ -103,7 +103,7 @@ bool CCage::PreEnterViewMsg(CPreEnterViewMsg *msg) {
}
bool CCage::MouseMoveMsg(CMouseMoveMsg *msg) {
- _cursorId = CParrot::_state != PARROT_IN_CAGE && !CParrot::_v5 ? CURSOR_ACTIVATE : CURSOR_ARROW;
+ _cursorId = CParrot::_state != PARROT_IN_CAGE && !CParrot::_coreReplaced ? CURSOR_ACTIVATE : CURSOR_ARROW;
return true;
}
diff --git a/engines/titanic/game/parrot/parrot_perch_holder.cpp b/engines/titanic/game/parrot/parrot_perch_holder.cpp
index 557f70437a..fb7564ea17 100644
--- a/engines/titanic/game/parrot/parrot_perch_holder.cpp
+++ b/engines/titanic/game/parrot/parrot_perch_holder.cpp
@@ -45,7 +45,7 @@ void CParrotPerchHolder::load(SimpleFile *file) {
}
bool CParrotPerchHolder::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
- if (!CParrot::_v1) {
+ if (!CParrot::_eatingChicken) {
if (CCage::_open) {
petDisplayMessage(CANNOT_TAKE_CAGE_LOCKED);
} else if (CParrot::_state == PARROT_IN_CAGE) {
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index d4ed629486..e17906e0de 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -45,11 +45,11 @@ BEGIN_MESSAGE_MAP(CParrot, CTrueTalkNPC)
ON_MESSAGE(LeaveRoomMsg)
END_MESSAGE_MAP()
-int CParrot::_v1;
-int CParrot::_v2;
-int CParrot::_v3;
+bool CParrot::_eatingChicken;
+bool CParrot::_takeOff;
+bool CParrot::_unused;
ParrotState CParrot::_state;
-int CParrot::_v5;
+bool CParrot::_coreReplaced;
CParrot::CParrot() : CTrueTalkNPC() {
_field108 = 0;
@@ -119,9 +119,9 @@ void CParrot::save(SimpleFile *file, int indent) {
file->writeQuotedLine(_assetName, indent);
file->writeNumberLine(_field108, indent);
- file->writeNumberLine(_v1, indent);
- file->writeNumberLine(_v2, indent);
- file->writeNumberLine(_v3, indent);
+ file->writeNumberLine(_eatingChicken, indent);
+ file->writeNumberLine(_takeOff, indent);
+ file->writeNumberLine(_unused, indent);
file->writeQuotedLine(_string2, indent);
file->writeNumberLine(_field118, indent);
@@ -132,7 +132,7 @@ void CParrot::save(SimpleFile *file, int indent) {
file->writeNumberLine(_field12C, indent);
file->writeNumberLine(_field130, indent);
file->writeNumberLine(_state, indent);
- file->writeNumberLine(_v5, indent);
+ file->writeNumberLine(_coreReplaced, indent);
CTrueTalkNPC::save(file, indent);
}
@@ -143,9 +143,9 @@ void CParrot::load(SimpleFile *file) {
_assetName = file->readString();
_field108 = file->readNumber();
- _v1 = file->readNumber();
- _v2 = file->readNumber();
- _v3 = file->readNumber();
+ _eatingChicken = file->readNumber();
+ _takeOff = file->readNumber();
+ _unused = file->readNumber();
_string2 = file->readString();
_field118 = file->readNumber();
@@ -156,7 +156,7 @@ void CParrot::load(SimpleFile *file) {
_field12C = file->readNumber();
_field130 = file->readNumber();
_state = (ParrotState)file->readNumber();
- _v5 = file->readNumber();
+ _coreReplaced = file->readNumber();
CTrueTalkNPC::load(file);
}
@@ -168,8 +168,8 @@ bool CParrot::ActMsg(CActMsg *msg) {
} else if (msg->_action == "Chicken") {
// Nothing to do
} else if (msg->_action == "CarryParrotLeftView") {
- if (!_v2) {
- _v1 = 0;
+ if (!_takeOff) {
+ _eatingChicken = false;
CStatusChangeMsg statusMsg;
statusMsg._newStatus = 1;
statusMsg.execute("PerchCoreHolder");
@@ -182,8 +182,8 @@ bool CParrot::ActMsg(CActMsg *msg) {
}
} else if (msg->_action == "EnteringFromTOW" &&
(_state == PARROT_IN_CAGE || _state == PARROT_ESCAPED)) {
- if (_v2) {
- _v2 = 2;
+ if (_takeOff) {
+ _state = PARROT_ESCAPED;
} else {
setVisible(true);
CTreeItem *cageBar = getRoot()->findByName("CageBar");
@@ -293,7 +293,7 @@ bool CParrot::MovieEndMsg(CMovieEndMsg *msg) {
} else if (clipExistsByEnd("Lean Over To Chicken", msg->_endFrame)) {
playClip("Eat Chicken");
playClip("Eat Chicken 2", MOVIE_NOTIFY_OBJECT);
- _v1 = 1;
+ _eatingChicken = true;
CStatusChangeMsg statusMsg;
statusMsg._newStatus = 0;
@@ -316,11 +316,13 @@ bool CParrot::MovieEndMsg(CMovieEndMsg *msg) {
}
if (clipExistsByEnd("Eat Chicken 2", msg->_endFrame)) {
+ _eatingChicken = false;
+
CStatusChangeMsg statusMsg;
statusMsg._newStatus = 1;
statusMsg.execute("PerchCoreHolder");
- if (_v2) {
+ if (_takeOff) {
loadMovie("z168.avi", false);
playClip("Take Off", MOVIE_NOTIFY_OBJECT);
setPosition(Point(20, 10));
@@ -502,7 +504,7 @@ bool CParrot::NPCPlayIdleAnimationMsg(CNPCPlayIdleAnimationMsg *msg) {
&& _visible && _state == PARROT_IN_CAGE && !compareViewNameTo("ParrotLobby.Node 1.N")) {
CGameObject *dragItem = getDraggingObject();
if (!dragItem || dragItem->getName() == "Chicken") {
- if (!_v5 ||getRandomNumber(3) != 0) {
+ if (!_coreReplaced ||getRandomNumber(3) != 0) {
if (getRandomNumber(1)) {
startTalking(this, 280267, findView());
} else {
@@ -737,7 +739,7 @@ bool CParrot::PanningAwayFromParrotMsg(CPanningAwayFromParrotMsg *msg) {
CActMsg actMsg("PanAwayFromParrot");
actMsg.execute(msg->_target);
_panTarget = nullptr;
- } else if (_v2) {
+ } else if (_takeOff) {
_panTarget = msg->_target;
loadMovie("z168.avi", false);
stopMovie();
diff --git a/engines/titanic/npcs/parrot.h b/engines/titanic/npcs/parrot.h
index ce0397fb71..37b2719264 100644
--- a/engines/titanic/npcs/parrot.h
+++ b/engines/titanic/npcs/parrot.h
@@ -52,11 +52,11 @@ class CParrot : public CTrueTalkNPC {
bool PanningAwayFromParrotMsg(CPanningAwayFromParrotMsg *msg);
bool LeaveRoomMsg(CLeaveRoomMsg *msg);
public:
- static int _v1;
- static int _v2;
- static int _v3;
+ static bool _eatingChicken;
+ static bool _takeOff;
+ static bool _unused;
static ParrotState _state;
- static int _v5;
+ static bool _coreReplaced;
private:
int _field108;
CString _string2;