[Scummvm-git-logs] scummvm master -> 8747e59c03ee75c4c04fa09c897cd43fdf9352ea

dreammaster dreammaster at scummvm.org
Tue Feb 14 04:41:11 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:
8747e59c03 TITANIC: Renaming of phonograph fields


Commit: 8747e59c03ee75c4c04fa09c897cd43fdf9352ea
    https://github.com/scummvm/scummvm/commit/8747e59c03ee75c4c04fa09c897cd43fdf9352ea
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-13T22:40:50-05:00

Commit Message:
TITANIC: Renaming of phonograph fields

Changed paths:
    engines/titanic/game/music_room_stop_phonograph_button.cpp
    engines/titanic/game/phonograph.cpp
    engines/titanic/game/phonograph.h
    engines/titanic/game/restaurant_phonograph.cpp
    engines/titanic/game/restaurant_phonograph.h
    engines/titanic/messages/messages.h


diff --git a/engines/titanic/game/music_room_stop_phonograph_button.cpp b/engines/titanic/game/music_room_stop_phonograph_button.cpp
index dee2c08..0a72406 100644
--- a/engines/titanic/game/music_room_stop_phonograph_button.cpp
+++ b/engines/titanic/game/music_room_stop_phonograph_button.cpp
@@ -49,7 +49,7 @@ bool CMusicRoomStopPhonographButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg
 
 		CPhonographStopMsg stopMsg;
 		stopMsg.execute(getParent(), nullptr, MSGFLAG_SCAN);
-		if (stopMsg._value2) {
+		if (stopMsg._cylinderPresent) {
 			_ticks = getTicksCount();
 		} else {
 			CEjectCylinderMsg ejectMsg;
diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp
index 26163a7..f43bb3a 100644
--- a/engines/titanic/game/phonograph.cpp
+++ b/engines/titanic/game/phonograph.cpp
@@ -34,16 +34,16 @@ BEGIN_MESSAGE_MAP(CPhonograph, CMusicPlayer)
 END_MESSAGE_MAP()
 
 CPhonograph::CPhonograph() : CMusicPlayer(),
-		_isPlaying(false), _isRecording(false), _fieldE8(0), _fieldEC(0),
+		_isPlaying(false), _isRecording(false), _isDisabled(false), _fieldEC(0),
 		_fieldF0(0), _fieldF4(0) {
 }
 
 void CPhonograph::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_unused, indent);
 	file->writeNumberLine(_isPlaying, indent);
 	file->writeNumberLine(_isRecording, indent);
-	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_isDisabled, indent);
 	file->writeNumberLine(_fieldEC, indent);
 	file->writeNumberLine(_fieldF0, indent);
 	file->writeNumberLine(_fieldF4, indent);
@@ -53,10 +53,10 @@ void CPhonograph::save(SimpleFile *file, int indent) {
 
 void CPhonograph::load(SimpleFile *file) {
 	file->readNumber();
-	_string2 = file->readString();
+	_unused = file->readString();
 	_isPlaying = file->readNumber();
 	_isRecording = file->readNumber();
-	_fieldE8 = file->readNumber();
+	_isDisabled = file->readNumber();
 	_fieldEC = file->readNumber();
 	_fieldF0 = file->readNumber();
 	_fieldF4 = file->readNumber();
@@ -108,23 +108,23 @@ bool CPhonograph::PhonographStopMsg(CPhonographStopMsg *msg) {
 				CStopMusicMsg stopMsg;
 				stopMsg.execute(this);
 			} else {
-				stopGlobalSound(msg->_value1, -1);
+				stopGlobalSound(msg->_leavingRoom, -1);
 			}
-			msg->_value2 = 1;
+			msg->_cylinderPresent = true;
 		}
 
-		if (!msg->_value3)
+		if (!msg->_dontStop)
 			_isPlaying = false;
 	} else if (_isRecording) {
 		_isRecording = false;
-		msg->_value2 = 1;
+		msg->_cylinderPresent = true;
 	}
 
 	return true;
 }
 
 bool CPhonograph::PhonographRecordMsg(CPhonographRecordMsg *msg) {
-	if (!_isPlaying && !_isRecording && !_fieldE8) {
+	if (!_isPlaying && !_isRecording && !_isDisabled) {
 		CQueryCylinderHolderMsg holderMsg;
 		holderMsg.execute(this);
 
@@ -153,7 +153,7 @@ bool CPhonograph::EnterRoomMsg(CEnterRoomMsg *msg) {
 bool CPhonograph::LeaveRoomMsg(CLeaveRoomMsg *msg) {
 	if (_isPlaying) {
 		CPhonographStopMsg stopMsg;
-		stopMsg._value1 = 1;
+		stopMsg._leavingRoom = true;
 		stopMsg.execute(this);
 	}
 
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
index 3c4fb86..4cce6ec 100644
--- a/engines/titanic/game/phonograph.h
+++ b/engines/titanic/game/phonograph.h
@@ -37,10 +37,10 @@ class CPhonograph : public CMusicPlayer {
 	bool LeaveRoomMsg(CLeaveRoomMsg *msg);
 	bool MusicHasStartedMsg(CMusicHasStartedMsg *msg);
 protected:
-	CString _string2;
+	CString _unused;
 	bool _isPlaying;
 	bool _isRecording;
-	int _fieldE8;
+	bool _isDisabled;
 	int _fieldEC;
 	int _fieldF0;
 	int _fieldF4;
diff --git a/engines/titanic/game/restaurant_phonograph.cpp b/engines/titanic/game/restaurant_phonograph.cpp
index 22f86dc..a2c8892 100644
--- a/engines/titanic/game/restaurant_phonograph.cpp
+++ b/engines/titanic/game/restaurant_phonograph.cpp
@@ -41,8 +41,8 @@ CRestaurantPhonograph::CRestaurantPhonograph() : CPhonograph(),
 void CRestaurantPhonograph::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldF8, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_ejectSoundName, indent);
+	file->writeQuotedLine(_stopSoundName, indent);
 
 	file->writeNumberLine(_field114, indent);
 
@@ -52,8 +52,8 @@ void CRestaurantPhonograph::save(SimpleFile *file, int indent) {
 void CRestaurantPhonograph::load(SimpleFile *file) {
 	file->readNumber();
 	_fieldF8 = file->readNumber();
-	_string2 = file->readString();
-	_string3 = file->readString();
+	_ejectSoundName = file->readString();
+	_stopSoundName = file->readString();
 	_field114 = file->readNumber();
 
 	CPhonograph::load(file);
@@ -71,7 +71,7 @@ bool CRestaurantPhonograph::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 			CEjectCylinderMsg ejectMsg;
 			ejectMsg.execute(this);
 
-			_fieldE8 = true;
+			_isDisabled = true;
 			if (_field114) {
 				loadFrame(_fieldEC);
 				playSound(_ejectSoundName);
@@ -84,7 +84,7 @@ bool CRestaurantPhonograph::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 
 bool CRestaurantPhonograph::PhonographPlayMsg(CPhonographPlayMsg *msg) {
 	if (_isPlaying) {
-		if (findView() == getView() && (!_fieldE8 || !_field114)) {
+		if (findView() == getView() && (!_isDisabled || !_field114)) {
 			loadFrame(_fieldEC);
 			playSound(_ejectSoundName);
 		}
@@ -107,7 +107,7 @@ bool CRestaurantPhonograph::PhonographStopMsg(CPhonographStopMsg *msg) {
 	if (_isPlaying) {
 		loadFrame(_fieldF0);
 		if (flag)
-			playSound(_string3);
+			playSound(_stopSoundName);
 	} else {
 		loadFrame(_fieldEC);
 	}
@@ -116,10 +116,10 @@ bool CRestaurantPhonograph::PhonographStopMsg(CPhonographStopMsg *msg) {
 }
 
 bool CRestaurantPhonograph::PhonographReadyToPlayMsg(CPhonographReadyToPlayMsg *msg) {
-	if (_fieldE8) {
+	if (_isDisabled) {
 		CPhonographPlayMsg playMsg;
 		playMsg.execute(this);
-		_fieldE8 = false;
+		_isDisabled = false;
 	}
 
 	return true;
diff --git a/engines/titanic/game/restaurant_phonograph.h b/engines/titanic/game/restaurant_phonograph.h
index 9661df0..8f72eaf 100644
--- a/engines/titanic/game/restaurant_phonograph.h
+++ b/engines/titanic/game/restaurant_phonograph.h
@@ -39,7 +39,7 @@ class CRestaurantPhonograph : public CPhonograph {
 private:
 	int _fieldF8;
 	CString _ejectSoundName;
-	CString _string3;
+	CString _stopSoundName;
 	int _field114;
 public:
 	CLASSDEF;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 82f6931..f70acdc 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -305,7 +305,7 @@ MESSAGE2(CParrotTriesChickenMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CPhonographPlayMsg, int, value, 0);
 MESSAGE0(CPhonographReadyToPlayMsg);
 MESSAGE1(CPhonographRecordMsg, bool, canRecord, false);
-MESSAGE3(CPhonographStopMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE3(CPhonographStopMsg, bool, leavingRoom, false, bool, cylinderPresent, false, bool, dontStop, false);
 MESSAGE2(CPlayRangeMsg, int, value1, 0, int, value2, 0);
 MESSAGE2(CPlayerTriesRestaurantTableMsg, int, tableId, 0, bool, result, false);
 MESSAGE1(CPreSaveMsg, int, value, 0);





More information about the Scummvm-git-logs mailing list