[Scummvm-git-logs] scummvm master -> 216e57aff49b43446699f236f47f67df2c95d0f1

dreammaster dreammaster at scummvm.org
Fri Feb 17 03:09:28 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
216e57aff4 TITANIC: Renamings for CGameObject & CGameState methods


Commit: 216e57aff49b43446699f236f47f67df2c95d0f1
    https://github.com/scummvm/scummvm/commit/216e57aff49b43446699f236f47f67df2c95d0f1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-16T21:09:17-05:00

Commit Message:
TITANIC: Renamings for CGameObject & CGameState methods

Changed paths:
    engines/titanic/carry/brain.cpp
    engines/titanic/carry/carry_parrot.cpp
    engines/titanic/carry/head_piece.cpp
    engines/titanic/carry/mouth.cpp
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/npcs/parrot.cpp


diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp
index b00f026..7b2e8d0 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 3a2f2c9..4bb3a96 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 1ce1d5b..fa02515 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 e48929a..d750fc9 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 bf72860..cd45094 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 a56095c..88baf0a 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 964d6e6..c1100c6 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 5d0f67c..7bcc0a2 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 b570bea..223f6b4 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;





More information about the Scummvm-git-logs mailing list