aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-02-20 13:11:23 -0500
committerPaul Gilbert2017-02-20 13:11:23 -0500
commiteffd93aaf4ee9fbac0140cb0027c734fd704b0b4 (patch)
tree178bafc2bf3618d82b765b1b9f431907e1853a6f
parentb851eff01761dbd4cb2cf5bc6c8ce806e25328e7 (diff)
downloadscummvm-rg350-effd93aaf4ee9fbac0140cb0027c734fd704b0b4.tar.gz
scummvm-rg350-effd93aaf4ee9fbac0140cb0027c734fd704b0b4.tar.bz2
scummvm-rg350-effd93aaf4ee9fbac0140cb0027c734fd704b0b4.zip
TITANIC: Renamings for Titania head and brain slots
-rw-r--r--engines/titanic/game/brain_slot.cpp10
-rw-r--r--engines/titanic/game/brain_slot.h2
-rw-r--r--engines/titanic/game/head_slot.cpp103
-rw-r--r--engines/titanic/game/head_slot.h16
4 files changed, 65 insertions, 66 deletions
diff --git a/engines/titanic/game/brain_slot.cpp b/engines/titanic/game/brain_slot.cpp
index 585df09591..0ab4a633c1 100644
--- a/engines/titanic/game/brain_slot.cpp
+++ b/engines/titanic/game/brain_slot.cpp
@@ -33,14 +33,14 @@ BEGIN_MESSAGE_MAP(CBrainSlot, CGameObject)
ON_MESSAGE(MouseDragStartMsg)
END_MESSAGE_MAP()
-bool CBrainSlot::_added;
+int CBrainSlot::_numAdded;
bool CBrainSlot::_woken;
void CBrainSlot::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_occupied, indent);
file->writeQuotedLine(_target, indent);
- file->writeNumberLine(_added, indent);
+ file->writeNumberLine(_numAdded, indent);
file->writeNumberLine(_woken, indent);
CGameObject::save(file, indent);
@@ -50,7 +50,7 @@ void CBrainSlot::load(SimpleFile *file) {
file->readNumber();
_occupied = file->readNumber();
_target = file->readString();
- _added = file->readNumber();
+ _numAdded = file->readNumber();
_woken = file->readNumber();
CGameObject::load(file);
@@ -63,7 +63,7 @@ bool CBrainSlot::SetFrameMsg(CSetFrameMsg *msg) {
}
bool CBrainSlot::AddHeadPieceMsg(CAddHeadPieceMsg *msg) {
- _added = true;
+ _numAdded++;
_cursorId = CURSOR_HAND;
CAddHeadPieceMsg addMsg("NULL");
@@ -141,7 +141,7 @@ bool CBrainSlot::MouseDragStartMsg(CMouseDragStartMsg *msg) {
passMsg.execute(_target);
msg->_dragItem = getRoot()->findByName(_target);
- _added = false;
+ _numAdded--;
return true;
}
diff --git a/engines/titanic/game/brain_slot.h b/engines/titanic/game/brain_slot.h
index a821cfd1cb..a85036303e 100644
--- a/engines/titanic/game/brain_slot.h
+++ b/engines/titanic/game/brain_slot.h
@@ -35,7 +35,7 @@ class CBrainSlot : public CGameObject {
bool ActMsg(CActMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
public:
- static bool _added;
+ static int _numAdded;
static bool _woken;
public:
bool _occupied;
diff --git a/engines/titanic/game/head_slot.cpp b/engines/titanic/game/head_slot.cpp
index 5c9f55280d..a289add370 100644
--- a/engines/titanic/game/head_slot.cpp
+++ b/engines/titanic/game/head_slot.cpp
@@ -37,77 +37,77 @@ BEGIN_MESSAGE_MAP(CHeadSlot, CGameObject)
ON_MESSAGE(MouseDragStartMsg)
END_MESSAGE_MAP()
-int CHeadSlot::_v1;
+bool CHeadSlot::_titaniaWoken;
CHeadSlot::CHeadSlot() : CGameObject(), _string1("NotWorking"), _string2("NULL"),
- _fieldBC(0), _fieldD8(0), _fieldDC(27), _fieldE0(56),
- _fieldE4(82), _fieldE8(112), _fieldEC(false) {
+ _occupied(false), _timerDuration(0), _frameNum1(27), _frameNum2(56),
+ _frameNum3(82), _frameNum4(112), _workingFlag(false) {
}
void CHeadSlot::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_fieldBC, indent);
+ file->writeNumberLine(_occupied, indent);
file->writeQuotedLine(_string1, indent);
file->writeQuotedLine(_string2, indent);
- file->writeNumberLine(_fieldD8, indent);
- file->writeNumberLine(_fieldDC, indent);
- file->writeNumberLine(_fieldE0, indent);
- file->writeNumberLine(_fieldE4, indent);
- file->writeNumberLine(_fieldE8, indent);
- file->writeNumberLine(_v1, indent);
- file->writeNumberLine(_fieldEC, indent);
+ file->writeNumberLine(_timerDuration, indent);
+ file->writeNumberLine(_frameNum1, indent);
+ file->writeNumberLine(_frameNum2, indent);
+ file->writeNumberLine(_frameNum3, indent);
+ file->writeNumberLine(_frameNum4, indent);
+ file->writeNumberLine(_titaniaWoken, indent);
+ file->writeNumberLine(_workingFlag, indent);
CGameObject::save(file, indent);
}
void CHeadSlot::load(SimpleFile *file) {
file->readNumber();
- _fieldBC = file->readNumber();
+ _occupied = file->readNumber();
_string1 = file->readString();
_string2 = file->readString();
- _fieldD8 = file->readNumber();
- _fieldDC = file->readNumber();
- _fieldE0 = file->readNumber();
- _fieldE4 = file->readNumber();
- _fieldE8 = file->readNumber();
- _v1 = file->readNumber();
- _fieldEC = file->readNumber();
+ _timerDuration = file->readNumber();
+ _frameNum1 = file->readNumber();
+ _frameNum2 = file->readNumber();
+ _frameNum3 = file->readNumber();
+ _frameNum4 = file->readNumber();
+ _titaniaWoken = file->readNumber();
+ _workingFlag = file->readNumber();
CGameObject::load(file);
}
bool CHeadSlot::AddHeadPieceMsg(CAddHeadPieceMsg *msg) {
setVisible(true);
- _fieldBC = 1;
+ _occupied = true;
_string2 = msg->_value;
- playMovie(_fieldDC, _fieldE8, 0);
+ playMovie(_frameNum1, _frameNum4, 0);
_cursorId = CURSOR_HAND;
msg->execute("TitaniaControl");
return true;
}
bool CHeadSlot::SenseWorkingMsg(CSenseWorkingMsg *msg) {
- if (_fieldEC)
- playMovie(_fieldE4, _fieldE8, 0);
+ if (_workingFlag)
+ playMovie(_frameNum3, _frameNum4, 0);
_string1 = msg->_value;
- _fieldEC = false;
+ _workingFlag = false;
return true;
}
bool CHeadSlot::EnterViewMsg(CEnterViewMsg *msg) {
setVisible(true);
- if (_v1)
+ if (_titaniaWoken)
_cursorId = CURSOR_ARROW;
- if (_v1 == 1 || _string1 == "Working") {
- playMovie(_fieldE0, _fieldE4, MOVIE_WAIT_FOR_FINISH);
- _fieldEC = true;
- } else if (_fieldBC) {
- playMovie(_fieldE0, _fieldE8, MOVIE_WAIT_FOR_FINISH);
- _fieldEC = false;
+ if (_titaniaWoken || _string1 == "Working") {
+ playMovie(_frameNum2, _frameNum3, MOVIE_WAIT_FOR_FINISH);
+ _workingFlag = true;
+ } else if (_occupied) {
+ playMovie(_frameNum2, _frameNum4, MOVIE_WAIT_FOR_FINISH);
+ _workingFlag = false;
} else {
- playMovie(0, _fieldDC, MOVIE_WAIT_FOR_FINISH);
+ playMovie(0, _frameNum1, MOVIE_WAIT_FOR_FINISH);
}
addTimer(5000 + getRandomNumber(3000));
@@ -118,16 +118,15 @@ bool CHeadSlot::LeaveViewMsg(CLeaveViewMsg *msg) {
if (getName() == "YepItsASlot") {
stopMovie();
- if (_fieldBC) {
- loadFrame(_fieldE0);
- playMovie(_fieldE0, _fieldE8, MOVIE_WAIT_FOR_FINISH);
- _fieldEC = false;
+ if (_occupied) {
+ loadFrame(_frameNum2);
+ playMovie(_frameNum2, _frameNum4, MOVIE_WAIT_FOR_FINISH);
} else {
- loadFrame(_fieldDC);
- playMovie(_fieldDC, _fieldE0, MOVIE_WAIT_FOR_FINISH);
+ loadFrame(_frameNum1);
+ playMovie(_frameNum1, _frameNum2, MOVIE_WAIT_FOR_FINISH);
}
- _fieldEC = false;
+ _workingFlag = false;
}
return true;
@@ -138,19 +137,19 @@ bool CHeadSlot::LoadSuccessMsg(CLoadSuccessMsg *msg) {
}
bool CHeadSlot::TimerMsg(CTimerMsg *msg) {
- if (compareViewNameTo("Titania.Node 15.S") && CBrainSlot::_added == 5
- && _fieldBC == 1) {
- if (_string1 == "Working" && !_fieldEC) {
- playMovie(_fieldE0, _fieldE4, 0);
- _fieldEC = true;
+ if (compareViewNameTo("Titania.Node 15.S") && CBrainSlot::_numAdded == 5
+ && _occupied) {
+ if (_string1 == "Working" && !_workingFlag) {
+ playMovie(_frameNum2, _frameNum3, 0);
+ _workingFlag = true;
} else if (_string1 == "Random") {
- playMovie(_fieldE0, _fieldE8, 0);
+ playMovie(_frameNum2, _frameNum4, 0);
}
}
if (compareViewNameTo("Titania.Node 15.S")) {
- _fieldD8 = 7000 + getRandomNumber(5000);
- addTimer(_fieldD8);
+ _timerDuration = 7000 + getRandomNumber(5000);
+ addTimer(_timerDuration);
}
return true;
@@ -158,24 +157,24 @@ bool CHeadSlot::TimerMsg(CTimerMsg *msg) {
bool CHeadSlot::ActMsg(CActMsg *msg) {
if (msg->_action == "Woken")
- _v1 = 1;
+ _titaniaWoken = true;
return true;
}
bool CHeadSlot::MouseDragStartMsg(CMouseDragStartMsg *msg) {
- if (_fieldBC && !_v1 && checkPoint(msg->_mousePos, false, true)) {
+ if (_occupied && !_titaniaWoken && checkPoint(msg->_mousePos, false, true)) {
CPassOnDragStartMsg passMsg;
passMsg._mousePos = msg->_mousePos;
passMsg.execute(_string2);
msg->_dragItem = getRoot()->findByName(_string2);
_cursorId = CURSOR_ARROW;
- _fieldBC = 0;
- _fieldEC = false;
+ _occupied = false;
+ _workingFlag = false;
_string2 = "NULL";
stopMovie();
loadFrame(0);
- playMovie(0, _fieldDC, 0);
+ playMovie(0, _frameNum1, 0);
return true;
}
diff --git a/engines/titanic/game/head_slot.h b/engines/titanic/game/head_slot.h
index 2767db3b61..46e6818c72 100644
--- a/engines/titanic/game/head_slot.h
+++ b/engines/titanic/game/head_slot.h
@@ -38,17 +38,17 @@ class CHeadSlot : public CGameObject {
bool ActMsg(CActMsg *msg);
bool MouseDragStartMsg(CMouseDragStartMsg *msg);
public:
- static int _v1;
+ static bool _titaniaWoken;
public:
- int _fieldBC;
+ bool _occupied;
CString _string1;
CString _string2;
- int _fieldD8;
- int _fieldDC;
- int _fieldE0;
- int _fieldE4;
- int _fieldE8;
- bool _fieldEC;
+ int _timerDuration;
+ int _frameNum1;
+ int _frameNum2;
+ int _frameNum3;
+ int _frameNum4;
+ bool _workingFlag;
public:
CLASSDEF;
CHeadSlot();