diff options
author | Paul Gilbert | 2016-11-12 19:49:09 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-11-12 19:49:09 -0500 |
commit | a02adba8423c295b32b465a22f90229253c50cdf (patch) | |
tree | ecbcdfcb28ae1a1aa8227f7392aaef4c6fbb66c3 /engines | |
parent | 82211302c04f8320953d568b912052e3c6d3f11c (diff) | |
download | scummvm-rg350-a02adba8423c295b32b465a22f90229253c50cdf.tar.gz scummvm-rg350-a02adba8423c295b32b465a22f90229253c50cdf.tar.bz2 scummvm-rg350-a02adba8423c295b32b465a22f90229253c50cdf.zip |
TITANIC: Renamings of transitioning counter methods
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/core/game_object.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 11 | ||||
-rw-r--r-- | engines/titanic/core/view_item.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/game/bridge_view.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/game/captains_wheel.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/game/fan_control.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/game/nav_helmet.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/game_manager.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/game_manager.h | 17 | ||||
-rw-r--r-- | engines/titanic/game_state.cpp | 3 | ||||
-rw-r--r-- | engines/titanic/npcs/bilge_succubus.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/npcs/deskbot.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/npcs/succubus.cpp | 8 |
13 files changed, 45 insertions, 28 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 76a2f2d5c0..3b9b9f1b46 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -1066,12 +1066,12 @@ void CGameObject::quitGame() { getGameManager()->_gameState._quitGame = true; } -void CGameObject::inc54() { - getGameManager()->inc54(); +void CGameObject::incTransitions() { + getGameManager()->incTransitions(); } -void CGameObject::dec54() { - getGameManager()->dec54(); +void CGameObject::decTransitions() { + getGameManager()->decTransitions(); } void CGameObject::setMovieFrameRate(double rate) { diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index ae35e2ba5b..237450ee2f 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -132,8 +132,15 @@ protected: */ void loadImage(const CString &name, bool pendingFlag = true); - void inc54(); - void dec54(); + /** + * Increments the number of active transitions + */ + void incTransitions(); + + /** + * Decrements the number of active transitions + */ + void decTransitions(); /** * Locks/hides the mouse diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp index aa1ff7108e..c25461f5cc 100644 --- a/engines/titanic/core/view_item.cpp +++ b/engines/titanic/core/view_item.cpp @@ -181,7 +181,7 @@ bool CViewItem::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (msg->_buttons & MB_LEFT) { if (!handleMouseMsg(msg, true)) { CGameManager *gm = getGameManager(); - if (gm->test54()) { + if (gm->isntTransitioning()) { findNode()->findRoom(); CLinkItem *linkItem = dynamic_cast<CLinkItem *>( diff --git a/engines/titanic/game/bridge_view.cpp b/engines/titanic/game/bridge_view.cpp index 466480a64c..5b2b8809d9 100644 --- a/engines/titanic/game/bridge_view.cpp +++ b/engines/titanic/game/bridge_view.cpp @@ -90,7 +90,7 @@ bool CBridgeView::MovieEndMsg(CMovieEndMsg *msg) { case 0: case 1: setVisible(false); - dec54(); + decTransitions(); break; case 2: { diff --git a/engines/titanic/game/captains_wheel.cpp b/engines/titanic/game/captains_wheel.cpp index 79908b561d..72d3cf70d9 100644 --- a/engines/titanic/game/captains_wheel.cpp +++ b/engines/titanic/game/captains_wheel.cpp @@ -99,7 +99,7 @@ bool CCaptainsWheel::ActMsg(CActMsg *msg) { } } else if (msg->_action == "Go") { if (!_fieldE0) { - inc54(); + incTransitions(); _fieldE0 = false; _fieldE4 = 1; @@ -109,7 +109,7 @@ bool CCaptainsWheel::ActMsg(CActMsg *msg) { } } else if (msg->_action == "Cruise") { if (_fieldE0) { - inc54(); + incTransitions(); _fieldE0 = false; _fieldE4 = 2; diff --git a/engines/titanic/game/fan_control.cpp b/engines/titanic/game/fan_control.cpp index 288fdb639f..b3c3b2e816 100644 --- a/engines/titanic/game/fan_control.cpp +++ b/engines/titanic/game/fan_control.cpp @@ -65,7 +65,7 @@ bool CFanControl::ActMsg(CActMsg *msg) { _enabled = false; else if (msg->_action == "StarlingsDead") { _fieldC4 = 0; - dec54(); + decTransitions(); _fieldCC = 0; } @@ -116,7 +116,7 @@ bool CFanControl::StatusChangeMsg(CStatusChangeMsg *msg) { break; case 2: if (_fieldC4) { - inc54(); + incTransitions(); _fieldCC = 1; playMovie(12, 18, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); } else { diff --git a/engines/titanic/game/nav_helmet.cpp b/engines/titanic/game/nav_helmet.cpp index 3e2a38486d..874683ad1b 100644 --- a/engines/titanic/game/nav_helmet.cpp +++ b/engines/titanic/game/nav_helmet.cpp @@ -91,9 +91,9 @@ bool CNavHelmet::PETHelmetOnOffMsg(CPETHelmetOnOffMsg *msg) { pet->setArea(PET_REMOTE); } - dec54(); + decTransitions(); } else { - inc54(); + incTransitions(); _flag = true; setVisible(true); playMovie(0, 60, MOVIE_NOTIFY_OBJECT); diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp index 015296fb14..9e107c92b9 100644 --- a/engines/titanic/game_manager.cpp +++ b/engines/titanic/game_manager.cpp @@ -35,7 +35,7 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView, Audio::Mi _inputHandler(this), _inputTranslator(&_inputHandler), _gameState(this), _sound(this, mixer), _musicRoom(this), _treeItem(nullptr), _soundMaker(nullptr), _movieRoom(nullptr), - _dragItem(nullptr), _field54(0), _lastDiskTicksCount(0), _tickCount2(0) { + _dragItem(nullptr), _transitionCtr(0), _lastDiskTicksCount(0), _tickCount2(0) { CTimeEventInfo::_nextId = 0; _movie = nullptr; diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h index 1671517e07..47c2cc8445 100644 --- a/engines/titanic/game_manager.h +++ b/engines/titanic/game_manager.h @@ -48,7 +48,7 @@ private: CBackgroundSoundMaker *_soundMaker; CMovie *_movie; CRoomItem *_movieRoom; - int _field54; + int _transitionCtr; CVideoSurface *_movieSurface; uint _lastDiskTicksCount; uint _tickCount2; @@ -166,11 +166,20 @@ public: */ void viewChange(); - bool test54() const { return !_field54; } + /** + * Returns true if no transition is currently in progress + */ + bool isntTransitioning() const { return !_transitionCtr; } - void inc54() { ++_field54; } + /** + * Increments the number of active transitions + */ + void incTransitions() { ++_transitionCtr; } - void dec54() { --_field54; } + /** + * Decremenst the number of active transitions + */ + void decTransitions() { --_transitionCtr; } /** * Extends the bounds of the currently affected game display area diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp index 5b6d34ad76..f3b1115a1b 100644 --- a/engines/titanic/game_state.cpp +++ b/engines/titanic/game_state.cpp @@ -112,7 +112,7 @@ void CGameState::enterView() { _gameManager->playClip(_movieList._movieClip, oldRoom, newRoom); _gameManager->_sound.preEnterView(newView, newRoom != oldRoom); - _gameManager->dec54(); + _gameManager->decTransitions(); oldView->enterView(newView); _movieList._view = nullptr; @@ -135,6 +135,7 @@ void CGameState::changeView(CViewItem *newView, CMovieClip *clip) { if (_mode == GSMODE_CUTSCENE) { _movieList._view = newView; _movieList._movieClip = clip; + _gameManager->incTransitions(); } else { oldView->preEnterView(newView); _gameManager->_gameView->setView(newView); diff --git a/engines/titanic/npcs/bilge_succubus.cpp b/engines/titanic/npcs/bilge_succubus.cpp index 006f532a31..d0a5dc17ae 100644 --- a/engines/titanic/npcs/bilge_succubus.cpp +++ b/engines/titanic/npcs/bilge_succubus.cpp @@ -142,7 +142,7 @@ bool CBilgeSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) { playMovie(_startFrame12, _endFrame12, MOVIE_GAMESTATE); playMovie(_bilgeStartFrame2, _bilgeEndFrame2, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); playMovie(_bilgeStartFrame1, _bilgeEndFrame1, MOVIE_NOTIFY_OBJECT | MOVIE_GAMESTATE); - inc54(); + incTransitions(); } } else { startTalking(this, 230012); @@ -270,7 +270,7 @@ bool CBilgeSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { startTalking(this, 150); CBodyInBilgeRoomMsg bodyMsg; bodyMsg.execute("Service Elevator Entity"); - dec54(); + decTransitions(); _field158 = 0; } else { diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp index 3a65b6f5bb..6a9dd69d07 100644 --- a/engines/titanic/npcs/deskbot.cpp +++ b/engines/titanic/npcs/deskbot.cpp @@ -114,7 +114,7 @@ bool CDeskbot::MovieEndMsg(CMovieEndMsg *msg) { if (_npcFlags & NPCFLAG_10000) { if (_classNum) { petSetArea(PET_ROOMS); - dec54(); + decTransitions(); unlockMouse(); playSound("z#47.wav"); _classNum = NO_CLASS; @@ -170,7 +170,7 @@ bool CDeskbot::LeaveViewMsg(CLeaveViewMsg *msg) { bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) { switch (msg->_action) { case 19: - inc54(); + incTransitions(); lockMouse(); petSetArea(PET_CONVERSATION); playClip("ReprogramPETInHand", MOVIE_NOTIFY_OBJECT); diff --git a/engines/titanic/npcs/succubus.cpp b/engines/titanic/npcs/succubus.cpp index bdde682c03..cb73eba490 100644 --- a/engines/titanic/npcs/succubus.cpp +++ b/engines/titanic/npcs/succubus.cpp @@ -411,7 +411,7 @@ bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) { _field158 = 0; _field188 = 0; _field1D8 = 1; - inc54(); + incTransitions(); if (_isFeathers) { _field19C = 0; @@ -496,7 +496,7 @@ bool CSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) { if (_startFrame4 >= 0) { _field158 = 1; _field1D8 = 1; - inc54(); + incTransitions(); playMovie(_startFrame4, _endFrame4, MOVIE_NOTIFY_OBJECT); } } @@ -600,7 +600,7 @@ bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { if (_field1D8) { _field1D8 = 0; - dec54(); + decTransitions(); } CSUBTransition transMsg; @@ -616,7 +616,7 @@ bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { _mailP = 0; if (_field1D8) { _field1D8 = 0; - dec54(); + decTransitions(); } CSUBTransition transMsg; |