diff options
author | Paul Gilbert | 2017-02-16 21:09:17 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-02-16 21:09:17 -0500 |
commit | 216e57aff49b43446699f236f47f67df2c95d0f1 (patch) | |
tree | 1659a0bf6fc70d55ee9b93f001421e373adc4166 /engines/titanic | |
parent | 899585d478efbc79efaa61f804e75701776fb064 (diff) | |
download | scummvm-rg350-216e57aff49b43446699f236f47f67df2c95d0f1.tar.gz scummvm-rg350-216e57aff49b43446699f236f47f67df2c95d0f1.tar.bz2 scummvm-rg350-216e57aff49b43446699f236f47f67df2c95d0f1.zip |
TITANIC: Renamings for CGameObject & CGameState methods
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/carry/brain.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/carry/carry_parrot.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/carry/head_piece.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/carry/mouth.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/core/game_object.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 16 | ||||
-rw-r--r-- | engines/titanic/game_state.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/game_state.h | 16 | ||||
-rw-r--r-- | engines/titanic/npcs/parrot.cpp | 2 |
9 files changed, 43 insertions, 21 deletions
diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp index b00f026718..7b2e8d0e45 100644 --- a/engines/titanic/carry/brain.cpp +++ b/engines/titanic/carry/brain.cpp @@ -122,7 +122,7 @@ bool CBrain::PassOnDragStartMsg(CPassOnDragStartMsg *msg) { bool CBrain::PETGainedObjectMsg(CPETGainedObjectMsg *msg) { if (!_field138) { if (getName() == "Perch") { - stateInc38(); + incParrotResponse(); _field138 = 1; } } diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp index 3a2f2c9368..4bb3a96bfb 100644 --- a/engines/titanic/carry/carry_parrot.cpp +++ b/engines/titanic/carry/carry_parrot.cpp @@ -113,7 +113,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) { CTreeItem *perchedParrot = findUnder(getRoot(), "PerchedParrot"); detach(); addUnder(perchedParrot); - sound8(true); + stopSoundChannel(true); CPutParrotBackMsg backMsg(msg->_mousePos.x); backMsg.execute(perchedParrot); @@ -122,7 +122,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) { _canTake = false; CParrot::_state = PARROT_ESCAPED; playSound("z#475.wav"); - sound8(true); + stopSoundChannel(true); moveUnder(findRoom()); CActMsg actMsg("Shut"); @@ -137,7 +137,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) { setVisible(false); _canTake = false; playSound("z#475.wav"); - sound8(true); + stopSoundChannel(true); moveUnder(findRoom()); } } diff --git a/engines/titanic/carry/head_piece.cpp b/engines/titanic/carry/head_piece.cpp index 1ce1d5ba1e..fa025158a5 100644 --- a/engines/titanic/carry/head_piece.cpp +++ b/engines/titanic/carry/head_piece.cpp @@ -60,7 +60,7 @@ bool CHeadPiece::SenseWorkingMsg(CSenseWorkingMsg *msg) { bool CHeadPiece::PETGainedObjectMsg(CPETGainedObjectMsg *msg) { _visibleFrame = 1; if (!_field13C) { - stateInc38(); + incParrotResponse(); _field13C = true; } diff --git a/engines/titanic/carry/mouth.cpp b/engines/titanic/carry/mouth.cpp index e48929a391..d750fc969e 100644 --- a/engines/titanic/carry/mouth.cpp +++ b/engines/titanic/carry/mouth.cpp @@ -70,7 +70,7 @@ bool CMouth::PETGainedObjectMsg(CPETGainedObjectMsg *msg) { loadFrame(2); setVisible(true); if (!_field13C) { - stateInc38(); + incParrotResponse(); _field13C = true; } diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index bf72860486..cd45094f2a 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -543,8 +543,8 @@ void CGameObject::setGlobalSoundVolume(int mode, uint seconds, int handleIndex) } } -void CGameObject::sound8(bool flag) const { - getGameManager()->_sound.stopChannel(flag ? 3 : 0); +void CGameObject::stopSoundChannel(bool channel3) { + getGameManager()->_sound.stopChannel(channel3 ? 3 : 0); } void CGameObject::setVisible(bool val) { @@ -1054,12 +1054,12 @@ bool CGameObject::stateGetParrotMet() const { return getGameManager()->_gameState.getParrotMet(); } -void CGameObject::stateInc38() { - getGameManager()->_gameState.inc38(); +void CGameObject::incParrotResponse() { + getGameManager()->_gameState.incParrotResponse(); } -int CGameObject::stateGet38() const { - return getGameManager()->_gameState._field38; +int CGameObject::getParrotResponse() const { + return getGameManager()->_gameState._parrotResponseIndex; } void CGameObject::quitGame() { diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index a56095c60f..88baf0aec2 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -277,7 +277,10 @@ protected: */ void setGlobalSoundVolume(int mode, uint seconds, int handleIndex); - void sound8(bool flag) const; + /** + * Stops sound channel 3 or 0 + */ + void stopSoundChannel(bool channel3); /** * Adds a timer @@ -1009,8 +1012,15 @@ public: */ bool stateGetParrotMet() const; - void stateInc38(); - int stateGet38() const; + /** + * Moves the parrot to the next idle response + */ + void incParrotResponse(); + + /** + * Gets the index to use for parrot idle responses + */ + int getParrotResponse() const; /** * Gets the game state node changed counter diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp index 964d6e604a..c1100c6259 100644 --- a/engines/titanic/game_state.cpp +++ b/engines/titanic/game_state.cpp @@ -47,7 +47,7 @@ CGameState::CGameState(CGameManager *gameManager) : _gameManager(gameManager), _gameLocation(this), _passengerClass(NO_CLASS), _priorClass(NO_CLASS), _mode(GSMODE_NONE), _seasonNum(SEASON_SUMMER), _petActive(false), _field1C(false), _quitGame(false), _parrotMet(false), - _nodeChangeCtr(0), _nodeEnterTicks(0), _field38(0) { + _nodeChangeCtr(0), _nodeEnterTicks(0), _parrotResponseIndex(0) { } void CGameState::save(SimpleFile *file) const { @@ -56,7 +56,7 @@ void CGameState::save(SimpleFile *file) const { file->writeNumber(_priorClass); file->writeNumber(_seasonNum); file->writeNumber(_parrotMet); - file->writeNumber(_field38); + file->writeNumber(_parrotResponseIndex); _gameLocation.save(file); file->writeNumber(_field1C); } @@ -67,7 +67,7 @@ void CGameState::load(SimpleFile *file) { _priorClass = (PassengerClass)file->readNumber(); _seasonNum = (Season)file->readNumber(); _parrotMet = file->readNumber(); - _field38 = file->readNumber(); + _parrotResponseIndex = file->readNumber(); _gameLocation.load(file); _field1C = file->readNumber(); diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h index 5d0f67c02c..7bcc0a265f 100644 --- a/engines/titanic/game_state.h +++ b/engines/titanic/game_state.h @@ -75,7 +75,7 @@ public: uint _nodeChangeCtr; uint32 _nodeEnterTicks; Point _mousePos; - int _field38; + int _parrotResponseIndex; public: CGameState(CGameManager *gameManager); @@ -151,9 +151,21 @@ public: */ bool getParrotMet() const { return _parrotMet; } + /** + * Gets the counter for the number of times different nodes have + * been entered + */ int getNodeChangedCtr() const { return _nodeChangeCtr; } + + /** + * Gets the node enter ticks amount + */ uint32 getNodeEnterTicks() const { return _nodeEnterTicks; } - void inc38() { ++_field38; } + + /** + * Increments the index to use for parrot idle responses + */ + void incParrotResponse() { ++_parrotResponseIndex; } }; } // End of namespace Titanic diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp index b570bea6ae..223f6b4cf2 100644 --- a/engines/titanic/npcs/parrot.cpp +++ b/engines/titanic/npcs/parrot.cpp @@ -475,7 +475,7 @@ bool CParrot::NPCPlayIdleAnimationMsg(CNPCPlayIdleAnimationMsg *msg) { } } else { int id = -1; - switch (stateGet38()) { + switch (getParrotResponse()) { case 0: id = 280107; break; |