aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-01-14 16:02:18 -0500
committerPaul Gilbert2017-01-14 16:02:18 -0500
commit585fcc2daeaae532936b64e71cefbb6ba25b2ff9 (patch)
treed208fe1465cb1e93de9717ae5d438bc8d7d472ed
parent135ac922aa8e886a6be244f5d52e483e5d7c0599 (diff)
downloadscummvm-rg350-585fcc2daeaae532936b64e71cefbb6ba25b2ff9.tar.gz
scummvm-rg350-585fcc2daeaae532936b64e71cefbb6ba25b2ff9.tar.bz2
scummvm-rg350-585fcc2daeaae532936b64e71cefbb6ba25b2ff9.zip
TITANIC: Renamings for Arboretum Gate
-rw-r--r--engines/titanic/game/arboretum_gate.cpp63
-rw-r--r--engines/titanic/game/arboretum_gate.h8
-rw-r--r--engines/titanic/moves/exit_arboretum.cpp14
-rw-r--r--engines/titanic/moves/exit_arboretum.h4
4 files changed, 44 insertions, 45 deletions
diff --git a/engines/titanic/game/arboretum_gate.cpp b/engines/titanic/game/arboretum_gate.cpp
index cf8357f401..66ae975ada 100644
--- a/engines/titanic/game/arboretum_gate.cpp
+++ b/engines/titanic/game/arboretum_gate.cpp
@@ -36,15 +36,15 @@ BEGIN_MESSAGE_MAP(CArboretumGate, CBackground)
ON_MESSAGE(TurnOn)
END_MESSAGE_MAP()
-int CArboretumGate::_v1;
+bool CArboretumGate::_gotSpeechCentre;
+bool CArboretumGate::_isClosed;
int CArboretumGate::_initialFrame;
-int CArboretumGate::_v3;
CArboretumGate::CArboretumGate() : CBackground() {
_viewName1 = "NULL";
_viewName2 = "NULL";
- _seasonNum = 0;
- _fieldF0 = 0;
+ _seasonNum = SEASON_SUMMER;
+ _unused1 = 0;
_startFrameSpringOff = 244;
_endFrameSpringOff = 304;
_startFrameSummerOff = 122;
@@ -82,11 +82,11 @@ CArboretumGate::CArboretumGate() : CBackground() {
void CArboretumGate::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_seasonNum, indent);
- file->writeNumberLine(_v1, indent);
+ file->writeNumberLine(_gotSpeechCentre, indent);
file->writeNumberLine(_initialFrame, indent);
- file->writeNumberLine(_v3, indent);
+ file->writeNumberLine(_isClosed, indent);
file->writeQuotedLine(_viewName1, indent);
- file->writeNumberLine(_fieldF0, indent);
+ file->writeNumberLine(_unused1, indent);
file->writeNumberLine(_startFrameSpringOff, indent);
file->writeNumberLine(_endFrameSpringOff, indent);
file->writeNumberLine(_startFrameSummerOff, indent);
@@ -145,12 +145,12 @@ void CArboretumGate::save(SimpleFile *file, int indent) {
void CArboretumGate::load(SimpleFile *file) {
file->readNumber();
- _seasonNum = file->readNumber();
- _v1 = file->readNumber();
+ _seasonNum = (Season)file->readNumber();
+ _gotSpeechCentre = file->readNumber();
_initialFrame = file->readNumber();
- _v3 = file->readNumber();
+ _isClosed = file->readNumber();
_viewName1 = file->readString();
- _fieldF0 = file->readNumber();
+ _unused1 = file->readNumber();
_startFrameSpringOff = file->readNumber();
_endFrameSpringOff = file->readNumber();
_startFrameSummerOff = file->readNumber();
@@ -208,17 +208,17 @@ void CArboretumGate::load(SimpleFile *file) {
}
bool CArboretumGate::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
- _seasonNum = (_seasonNum + 1) % 4;
+ _seasonNum = (Season)((_seasonNum + 1) % 4);
return true;
}
bool CArboretumGate::ActMsg(CActMsg *msg) {
if (msg->_action == "PlayerGetsSpeechCentre") {
- _v1 = 1;
+ _gotSpeechCentre = true;
CVisibleMsg visibleMsg(true);
visibleMsg.execute("SpCtrOverlay");
} else if (msg->_action == "ExitLFrozen") {
- if (_v3) {
+ if (_isClosed) {
_viewName2 = "FrozenArboretum.Node 2.W";
CTurnOn onMsg;
onMsg.execute(this);
@@ -226,7 +226,7 @@ bool CArboretumGate::ActMsg(CActMsg *msg) {
changeView("FrozenArboretum.Node 2.W");
}
} else if (msg->_action == "ExitRFrozen") {
- if (_v3) {
+ if (_isClosed) {
_viewName2 = "FrozenArboretum.Node 2.E";
CTurnOn onMsg;
onMsg.execute(this);
@@ -234,7 +234,7 @@ bool CArboretumGate::ActMsg(CActMsg *msg) {
changeView("FrozenArboretum.Node 2.E");
}
} else if (msg->_action == "ExitLNormal") {
- if (_v3) {
+ if (_isClosed) {
_viewName2 = "Arboretum.Node 2.W";
CTurnOn onMsg;
onMsg.execute(this);
@@ -242,12 +242,11 @@ bool CArboretumGate::ActMsg(CActMsg *msg) {
changeView("Arboretum.Node 2.W");
}
} else if (msg->_action == "ExitRNormal") {
- if (_v3) {
+ if (_isClosed) {
_viewName2 = "Arboretum.Node 2.E";
CTurnOn onMsg;
onMsg.execute(this);
- }
- else {
+ } else {
changeView("Arboretum.Node 2.E");
}
}
@@ -256,7 +255,7 @@ bool CArboretumGate::ActMsg(CActMsg *msg) {
}
bool CArboretumGate::MovieEndMsg(CMovieEndMsg *msg) {
- setVisible(!_v3);
+ setVisible(!_isClosed);
if (_viewName1 != "NULL") {
changeView(_viewName1);
@@ -273,14 +272,14 @@ bool CArboretumGate::LeaveViewMsg(CLeaveViewMsg *msg) {
}
bool CArboretumGate::TurnOff(CTurnOff *msg) {
- if (!_v3) {
+ if (!_isClosed) {
switch (_seasonNum) {
case SEASON_SUMMER:
playMovie(_startFrameSummerOff, _endFrameSummerOff, MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
break;
case SEASON_AUTUMN:
- if (_v1) {
+ if (_gotSpeechCentre) {
playMovie(_startFrameAutumnOff2, _endFrameAutumnOff2, MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
} else {
playMovie(_startFrameAutumnOff1, _endFrameAutumnOff1, MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
@@ -288,7 +287,7 @@ bool CArboretumGate::TurnOff(CTurnOff *msg) {
break;
case SEASON_WINTER:
- if (_v1) {
+ if (_gotSpeechCentre) {
playMovie(_startFrameWinterOff2, _endFrameWinterOff2, MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
} else {
playMovie(_startFrameWinterOff1, _endFrameWinterOff1, MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
@@ -303,7 +302,7 @@ bool CArboretumGate::TurnOff(CTurnOff *msg) {
break;
}
- _v3 = 1;
+ _isClosed = true;
CArboretumGateMsg gateMsg;
gateMsg.execute("Arboretum", nullptr, MSGFLAG_SCAN);
}
@@ -312,7 +311,7 @@ bool CArboretumGate::TurnOff(CTurnOff *msg) {
}
bool CArboretumGate::TurnOn(CTurnOn *msg) {
- if (_v3) {
+ if (_isClosed) {
CArboretumGateMsg gateMsg(0);
gateMsg.execute("Arboretum");
setVisible(true);
@@ -323,7 +322,7 @@ bool CArboretumGate::TurnOn(CTurnOn *msg) {
break;
case SEASON_AUTUMN:
- if (_v1) {
+ if (_gotSpeechCentre) {
playMovie(_startFrameAutumnOn2, _endFrameAutumnOn2, MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
} else {
playMovie(_startFrameAutumnOn1, _endFrameAutumnOn1, MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
@@ -331,7 +330,7 @@ bool CArboretumGate::TurnOn(CTurnOn *msg) {
break;
case SEASON_WINTER:
- if (_v1) {
+ if (_gotSpeechCentre) {
playMovie(_startFrameWinterOn2, _endFrameWinterOn2, MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
} else {
playMovie(_startFrameWinterOn1, _endFrameWinterOn1, MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
@@ -346,14 +345,14 @@ bool CArboretumGate::TurnOn(CTurnOn *msg) {
break;
}
- _v3 = 0;
+ _isClosed = false;
}
return true;
}
bool CArboretumGate::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
- if (!_v3) {
+ if (!_isClosed) {
CTurnOff offMsg;
offMsg.execute(this);
}
@@ -362,18 +361,18 @@ bool CArboretumGate::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
}
bool CArboretumGate::EnterViewMsg(CEnterViewMsg *msg) {
- if (!_v3) {
+ if (!_isClosed) {
switch (_seasonNum) {
case SEASON_SUMMER:
_initialFrame = _startFrameSummerOff;
break;
case SEASON_AUTUMN:
- _initialFrame = _v1 ? _startFrameAutumnOff2 : _startFrameAutumnOff1;
+ _initialFrame = _gotSpeechCentre ? _startFrameAutumnOff2 : _startFrameAutumnOff1;
break;
case SEASON_WINTER:
- _initialFrame = _v1 ? _startFrameWinterOff1 : _startFrameWinterOff2;
+ _initialFrame = _gotSpeechCentre ? _startFrameWinterOff1 : _startFrameWinterOff2;
break;
case SEASON_SPRING:
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index efb4e81ae9..6f0ba9c224 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -40,13 +40,13 @@ class CArboretumGate : public CBackground {
bool EnterViewMsg(CEnterViewMsg *msg);
bool TurnOn(CTurnOn *msg);
private:
- static int _v1;
+ static bool _gotSpeechCentre;
+ static bool _isClosed;
static int _initialFrame;
- static int _v3;
private:
- int _seasonNum;
+ Season _seasonNum;
CString _viewName1;
- int _fieldF0;
+ int _unused1;
int _startFrameSpringOff;
int _endFrameSpringOff;
int _startFrameSummerOff;
diff --git a/engines/titanic/moves/exit_arboretum.cpp b/engines/titanic/moves/exit_arboretum.cpp
index 3c1591c393..74a4e290ca 100644
--- a/engines/titanic/moves/exit_arboretum.cpp
+++ b/engines/titanic/moves/exit_arboretum.cpp
@@ -33,13 +33,13 @@ BEGIN_MESSAGE_MAP(CExitArboretum, CMovePlayerTo)
END_MESSAGE_MAP()
CExitArboretum::CExitArboretum() : CMovePlayerTo(),
- _seasonNum(0), _fieldCC(0), _enabled(true) {
+ _seasonNum(SEASON_SUMMER), _exitDirection(0), _enabled(true) {
}
void CExitArboretum::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_seasonNum, indent);
- file->writeNumberLine(_fieldCC, indent);
+ file->writeNumberLine(_exitDirection, indent);
file->writeNumberLine(_enabled, indent);
CMovePlayerTo::save(file, indent);
@@ -47,8 +47,8 @@ void CExitArboretum::save(SimpleFile *file, int indent) {
void CExitArboretum::load(SimpleFile *file) {
file->readNumber();
- _seasonNum = file->readNumber();
- _fieldCC = file->readNumber();
+ _seasonNum = (Season)file->readNumber();
+ _exitDirection = file->readNumber();
_enabled = file->readNumber();
CMovePlayerTo::load(file);
@@ -58,7 +58,7 @@ bool CExitArboretum::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_enabled) {
CActMsg actMsg;
if (_seasonNum == SEASON_WINTER) {
- switch (_fieldCC) {
+ switch (_exitDirection) {
case 0:
actMsg._action = "ExitLFrozen";
break;
@@ -69,7 +69,7 @@ bool CExitArboretum::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
break;
}
} else {
- switch (_fieldCC) {
+ switch (_exitDirection) {
case 0:
actMsg._action = "ExitLNormal";
break;
@@ -88,7 +88,7 @@ bool CExitArboretum::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
}
bool CExitArboretum::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
- _seasonNum = (_seasonNum + 1) % 4;
+ _seasonNum = (Season)(((int)_seasonNum + 1) % 4);
return true;
}
diff --git a/engines/titanic/moves/exit_arboretum.h b/engines/titanic/moves/exit_arboretum.h
index b65eb92b17..ebb5629e2f 100644
--- a/engines/titanic/moves/exit_arboretum.h
+++ b/engines/titanic/moves/exit_arboretum.h
@@ -34,8 +34,8 @@ class CExitArboretum : public CMovePlayerTo {
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *msg);
protected:
- int _seasonNum;
- int _fieldCC;
+ Season _seasonNum;
+ int _exitDirection;
bool _enabled;
public:
CLASSDEF;