[Scummvm-git-logs] scummvm master -> 89d595a46c44df0bc3c449affc47867d14903224

dreammaster dreammaster at scummvm.org
Sat Dec 10 17:52:01 CET 2016


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:
89d595a46c TITANIC: Renaming of parrot met flag methods


Commit: 89d595a46c44df0bc3c449affc47867d14903224
    https://github.com/scummvm/scummvm/commit/89d595a46c44df0bc3c449affc47867d14903224
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-12-10T11:51:51-05:00

Commit Message:
TITANIC: Renaming of parrot met flag methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/parrot/player_meets_parrot.cpp
    engines/titanic/game/pet/pet_sounds.cpp
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/npcs/parrot.cpp


diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 48cc520..19cae3f 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -1046,12 +1046,12 @@ Season CGameObject::stateGetSeason() const {
 	return getGameManager()->_gameState._seasonNum;
 }
 
-void CGameObject::stateSet24() {
-	getGameManager()->_gameState.set24(1);
+void CGameObject::stateSetParrotMet() {
+	getGameManager()->_gameState.setParrotMet(true);
 }
 
-int CGameObject::stateGet24() const {
-	return getGameManager()->_gameState.get24();
+bool CGameObject::stateGetParrotMet() const {
+	return getGameManager()->_gameState.getParrotMet();
 }
 
 void CGameObject::stateInc38() {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 9417fd7..744887a 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -991,8 +991,16 @@ public:
 	 */
 	Season stateGetSeason() const;
 
-	void stateSet24();
-	int stateGet24() const;
+	/**
+	 * Sets the flag for the parrot having been met
+	 */
+	void stateSetParrotMet();
+
+	/**
+	 * Returns whether the parrot has been met
+	 */
+	bool stateGetParrotMet() const;
+
 	void stateInc38();
 	int stateGet38() const;
 
diff --git a/engines/titanic/game/parrot/player_meets_parrot.cpp b/engines/titanic/game/parrot/player_meets_parrot.cpp
index cdb1451..e573ba4 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.cpp
+++ b/engines/titanic/game/parrot/player_meets_parrot.cpp
@@ -39,7 +39,7 @@ void CPlayerMeetsParrot::load(SimpleFile *file) {
 }
 
 bool CPlayerMeetsParrot::EnterRoomMsg(CEnterRoomMsg *msg) {
-	stateSet24();
+	stateSetParrotMet();
 	return true;
 }
 
diff --git a/engines/titanic/game/pet/pet_sounds.cpp b/engines/titanic/game/pet/pet_sounds.cpp
index c7f3cd3..b2c9902 100644
--- a/engines/titanic/game/pet/pet_sounds.cpp
+++ b/engines/titanic/game/pet/pet_sounds.cpp
@@ -44,7 +44,7 @@ void CPETSounds::load(SimpleFile *file) {
 bool CPETSounds::PETPlaySoundMsg(CPETPlaySoundMsg *msg) {
 	if (msg->_soundNum == 1) {
 		playSound("z#65.wav");
-	} else if (msg->_soundNum == 2 && stateGet24()) {
+	} else if (msg->_soundNum == 2 && stateGetParrotMet()) {
 		uint ticks = getTicksCount();
 		if (!_ticks || ticks > (_ticks + 12000)) {
 			playSound("z#36.wav");
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index e75f097..26a4297 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -46,7 +46,7 @@ bool CGameStateMovieList::empty() {
 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), _field24(0),
+		_petActive(false), _field1C(false), _quitGame(false), _parrotMet(false),
 		_nodeChangeCtr(0), _nodeEnterTicks(0), _field38(0) {
 }
 
@@ -55,7 +55,7 @@ void CGameState::save(SimpleFile *file) const {
 	file->writeNumber(_passengerClass);
 	file->writeNumber(_priorClass);
 	file->writeNumber(_seasonNum);
-	file->writeNumber(_field24);
+	file->writeNumber(_parrotMet);
 	file->writeNumber(_field38);
 	_gameLocation.save(file);
 	file->writeNumber(_field1C);
@@ -66,7 +66,7 @@ void CGameState::load(SimpleFile *file) {
 	_passengerClass = (PassengerClass)file->readNumber();
 	_priorClass = (PassengerClass)file->readNumber();
 	_seasonNum = (Season)file->readNumber();
-	_field24 = file->readNumber();
+	_parrotMet = file->readNumber();
 	_field38 = file->readNumber();
 	_gameLocation.load(file);
 
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 9657350..5d0f67c 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -71,7 +71,7 @@ public:
 	bool _petActive;
 	bool _field1C;
 	bool _quitGame;
-	int _field24;
+	bool _parrotMet;
 	uint _nodeChangeCtr;
 	uint32 _nodeEnterTicks;
 	Point _mousePos;
@@ -141,8 +141,16 @@ public:
 		_seasonNum = (Season)(((int)_seasonNum + 1) & 3);
 	}
 
-	void set24(int v) { _field24 = v; }
-	int get24() const { return _field24; }
+	/**
+	 * Sets whether the parrot has been met
+	 */
+	void setParrotMet(bool flag) { _parrotMet = flag; }
+
+	/**
+	 * Gets whether the parrot has been met
+	 */
+	bool getParrotMet() const { return _parrotMet; }
+
 	int getNodeChangedCtr() const { return _nodeChangeCtr; }
 	uint32 getNodeEnterTicks() const { return _nodeEnterTicks; }
 	void inc38() { ++_field38; }
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index c3702e1..37710e5 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -415,7 +415,7 @@ bool CParrot::ParrotSpeakMsg(CParrotSpeakMsg *msg) {
 		"Lift", "ServiceElevator", "Dome", "Home", "MoonEmbLobby", nullptr
 	};
 
-	if (!stateGet24() || _v4 == 3 || compareViewNameTo("Titania.Node 18.N"))
+	if (!stateGetParrotMet() || _v4 == 3 || compareViewNameTo("Titania.Node 18.N"))
 		return true;
 
 	// Check for rooms not to speak in





More information about the Scummvm-git-logs mailing list