diff options
author | Paul Gilbert | 2017-08-16 20:18:55 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-08-16 20:18:55 -0400 |
commit | 6c667a013dd6f2fdd4812694e19e472869b5e832 (patch) | |
tree | b934fd774701fcb58595869457d11297467d9c71 /engines/titanic | |
parent | 73764581374c5aca488b60a668f2810691f89c39 (diff) | |
download | scummvm-rg350-6c667a013dd6f2fdd4812694e19e472869b5e832.tar.gz scummvm-rg350-6c667a013dd6f2fdd4812694e19e472869b5e832.tar.bz2 scummvm-rg350-6c667a013dd6f2fdd4812694e19e472869b5e832.zip |
TITANIC: Renamings for Broken Pellerator fields
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/game/broken_pell_base.cpp | 16 | ||||
-rw-r--r-- | engines/titanic/game/broken_pell_base.h | 10 | ||||
-rw-r--r-- | engines/titanic/game/broken_pellerator.cpp | 30 | ||||
-rw-r--r-- | engines/titanic/game/broken_pellerator_froz.cpp | 64 | ||||
-rw-r--r-- | engines/titanic/game/broken_pellerator_froz.h | 8 |
5 files changed, 65 insertions, 63 deletions
diff --git a/engines/titanic/game/broken_pell_base.cpp b/engines/titanic/game/broken_pell_base.cpp index a3825d503e..973c558253 100644 --- a/engines/titanic/game/broken_pell_base.cpp +++ b/engines/titanic/game/broken_pell_base.cpp @@ -26,22 +26,22 @@ namespace Titanic { EMPTY_MESSAGE_MAP(CBrokenPellBase, CBackground); -bool CBrokenPellBase::_v1; -int CBrokenPellBase::_v2; +bool CBrokenPellBase::_pelleratorOpen; +bool CBrokenPellBase::_gottenHose; void CBrokenPellBase::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_v1, indent); - file->writeNumberLine(_v2, indent); - file->writeNumberLine(_exitAction, indent); + file->writeNumberLine(_pelleratorOpen, indent); + file->writeNumberLine(_gottenHose, indent); + file->writeNumberLine(_closeAction, indent); CBackground::save(file, indent); } void CBrokenPellBase::load(SimpleFile *file) { file->readNumber(); - _v1 = file->readNumber(); - _v2 = file->readNumber(); - _exitAction = file->readNumber(); + _pelleratorOpen = file->readNumber(); + _gottenHose = file->readNumber(); + _closeAction = (CloseAction)file->readNumber(); CBackground::load(file); } diff --git a/engines/titanic/game/broken_pell_base.h b/engines/titanic/game/broken_pell_base.h index c5b27d88bf..2d42f143ef 100644 --- a/engines/titanic/game/broken_pell_base.h +++ b/engines/titanic/game/broken_pell_base.h @@ -27,16 +27,18 @@ namespace Titanic { +enum CloseAction { CLOSE_NONE = 0, CLOSE_LEFT = 1, CLOSE_RIGHT = 2 }; + class CBrokenPellBase : public CBackground { DECLARE_MESSAGE_MAP; protected: - static bool _v1; - static int _v2; + static bool _pelleratorOpen; + static bool _gottenHose; - int _exitAction; + CloseAction _closeAction; public: CLASSDEF; - CBrokenPellBase() : CBackground(), _exitAction(0) {} + CBrokenPellBase() : CBackground(), _closeAction(CLOSE_NONE) {} /** * Save the data for the class to file diff --git a/engines/titanic/game/broken_pellerator.cpp b/engines/titanic/game/broken_pellerator.cpp index d3664acccd..5de728481b 100644 --- a/engines/titanic/game/broken_pellerator.cpp +++ b/engines/titanic/game/broken_pellerator.cpp @@ -53,16 +53,16 @@ void CBrokenPellerator::load(SimpleFile *file) { } bool CBrokenPellerator::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { - if (_v1) { - changeView(_v2 ? _string5 : _string4); + if (_pelleratorOpen) { + changeView(_gottenHose ? _string5 : _string4); } else { - if (_v2) { + if (_gottenHose) { playMovie(28, 43, 0); } else { playMovie(0, 14, MOVIE_NOTIFY_OBJECT); } - _v1 = true; + _pelleratorOpen = true; } return true; @@ -71,7 +71,7 @@ bool CBrokenPellerator::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { bool CBrokenPellerator::LeaveViewMsg(CLeaveViewMsg *msg) { CString name = msg->_newView->getNodeViewName(); if (name == "Node 3.S" || name == "Node 3.N") { - _v1 = false; + _pelleratorOpen = false; loadFrame(0); } @@ -80,32 +80,32 @@ bool CBrokenPellerator::LeaveViewMsg(CLeaveViewMsg *msg) { bool CBrokenPellerator::ActMsg(CActMsg *msg) { if (msg->_action == "PlayerGetsHose") { - _v2 = 1; + _gottenHose = true; loadFrame(43); CStatusChangeMsg statusMsg; statusMsg.execute("PickupHose"); } else { - _exitAction = 0; + _closeAction = CLOSE_NONE; bool closeFlag = msg->_action == "Close"; if (msg->_action == "CloseLeft") { closeFlag = true; - _exitAction = 1; + _closeAction = CLOSE_LEFT; } if (msg->_action == "CloseRight") { closeFlag = true; - _exitAction = 2; + _closeAction = CLOSE_RIGHT; } if (closeFlag) { - if (_v1) { - _v1 = false; - if (_v2) + if (_pelleratorOpen) { + _pelleratorOpen = false; + if (_gottenHose) playMovie(43, 57, MOVIE_NOTIFY_OBJECT); else playMovie(14, 28, MOVIE_NOTIFY_OBJECT); } else { - switch (_exitAction) { + switch (_closeAction) { case 1: changeView(_exitLeftView); break; @@ -116,7 +116,7 @@ bool CBrokenPellerator::ActMsg(CActMsg *msg) { break; } - _exitAction = 0; + _closeAction = CLOSE_NONE; } } } @@ -139,7 +139,7 @@ bool CBrokenPellerator::MovieEndMsg(CMovieEndMsg *msg) { statusMsg.execute("PickUpHose"); } - switch (_exitAction) { + switch (_closeAction) { case 1: changeView(_exitLeftView); break; diff --git a/engines/titanic/game/broken_pellerator_froz.cpp b/engines/titanic/game/broken_pellerator_froz.cpp index 7025b37a0c..50aaa25f45 100644 --- a/engines/titanic/game/broken_pellerator_froz.cpp +++ b/engines/titanic/game/broken_pellerator_froz.cpp @@ -34,30 +34,30 @@ END_MESSAGE_MAP() void CBrokenPelleratorFroz::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(_string2, indent); - file->writeQuotedLine(_string3, indent); - file->writeQuotedLine(_string4, indent); - file->writeQuotedLine(_string5, indent); + file->writeQuotedLine(_exitLeft, indent); + file->writeQuotedLine(_exitRight, indent); + file->writeQuotedLine(_closeUpWithoutHose, indent); + file->writeQuotedLine(_closeUpWithHose, indent); CBrokenPellBase::save(file, indent); } void CBrokenPelleratorFroz::load(SimpleFile *file) { file->readNumber(); - _string2 = file->readString(); - _string3 = file->readString(); - _string4 = file->readString(); - _string5 = file->readString(); + _exitLeft = file->readString(); + _exitRight = file->readString(); + _closeUpWithoutHose = file->readString(); + _closeUpWithHose = file->readString(); CBrokenPellBase::load(file); } bool CBrokenPelleratorFroz::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { - if (_v1) { - changeView(_v2 ? _string5 : _string4); + if (_pelleratorOpen) { + changeView(_gottenHose ? _closeUpWithHose : _closeUpWithoutHose); } else { - _v1 = true; - if (_v2) { + _pelleratorOpen = true; + if (_gottenHose) { playMovie(0, 13, 0); } else { playMovie(43, 55, MOVIE_NOTIFY_OBJECT); @@ -71,7 +71,7 @@ bool CBrokenPelleratorFroz::LeaveViewMsg(CLeaveViewMsg *msg) { CString name = msg->_newView->getNodeViewName(); if (name == "Node 3.S" || name == "Node 3.E") { - _v1 = false; + _pelleratorOpen = false; loadFrame(0); } @@ -80,42 +80,42 @@ bool CBrokenPelleratorFroz::LeaveViewMsg(CLeaveViewMsg *msg) { bool CBrokenPelleratorFroz::ActMsg(CActMsg *msg) { if (msg->_action == "PlayerGetsHose") { - _v2 = 1; + _gottenHose = true; CStatusChangeMsg statusMsg; statusMsg._newStatus = 0; statusMsg.execute("FPickUpHose"); } else { - _exitAction = 0; + _closeAction = CLOSE_NONE; bool closeFlag = msg->_action == "Close"; if (msg->_action == "CloseLeft") { closeFlag = true; - _exitAction = 1; + _closeAction = CLOSE_LEFT; } if (msg->_action == "CloseRight") { closeFlag = true; - _exitAction = 2; + _closeAction = CLOSE_RIGHT; } if (closeFlag) { - if (_v1) { - _v1 = false; - if (_v2) + if (_pelleratorOpen) { + _pelleratorOpen = false; + if (_gottenHose) playMovie(29, 42, MOVIE_NOTIFY_OBJECT); else playMovie(72, 84, MOVIE_NOTIFY_OBJECT); } else { - switch (_exitAction) { - case 1: - changeView(_string2); + switch (_closeAction) { + case CLOSE_LEFT: + changeView(_exitLeft); break; - case 2: - changeView(_string3); + case CLOSE_RIGHT: + changeView(_exitRight); break; default: break; } - _exitAction = 0; + _closeAction = CLOSE_NONE; } } } @@ -136,12 +136,12 @@ bool CBrokenPelleratorFroz::MovieEndMsg(CMovieEndMsg *msg) { statusMsg.execute("FPickUpHose"); } - if (_exitAction == 1) { - changeView(_string2); - _exitAction = 0; - } else if (_exitAction == 2) { - changeView(_string3); - _exitAction = 0; + if (_closeAction == CLOSE_LEFT) { + changeView(_exitLeft); + _closeAction = CLOSE_NONE; + } else if (_closeAction == CLOSE_RIGHT) { + changeView(_exitRight); + _closeAction = CLOSE_NONE; } return true; diff --git a/engines/titanic/game/broken_pellerator_froz.h b/engines/titanic/game/broken_pellerator_froz.h index ccdae6ffa8..c198d02213 100644 --- a/engines/titanic/game/broken_pellerator_froz.h +++ b/engines/titanic/game/broken_pellerator_froz.h @@ -34,10 +34,10 @@ class CBrokenPelleratorFroz : public CBrokenPellBase { bool ActMsg(CActMsg *msg); bool MovieEndMsg(CMovieEndMsg *msg); private: - CString _string2; - CString _string3; - CString _string4; - CString _string5; + CString _exitLeft; + CString _exitRight; + CString _closeUpWithoutHose; + CString _closeUpWithHose; public: CLASSDEF; |