[Scummvm-git-logs] scummvm master -> c8c96e953073a0505fd4c7d1cf4754b443ce7c38

dreammaster dreammaster at scummvm.org
Sat Feb 18 03:18:04 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:
c8c96e9530 TITANIC: Fix playing phonograph when cylinder holder is open


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

Commit Message:
TITANIC: Fix playing phonograph when cylinder holder is open

Changed paths:
    engines/titanic/game/restaurant_phonograph.cpp
    engines/titanic/game/restaurant_phonograph.h


diff --git a/engines/titanic/game/restaurant_phonograph.cpp b/engines/titanic/game/restaurant_phonograph.cpp
index 693cf3d..3b35514 100644
--- a/engines/titanic/game/restaurant_phonograph.cpp
+++ b/engines/titanic/game/restaurant_phonograph.cpp
@@ -36,11 +36,11 @@ BEGIN_MESSAGE_MAP(CRestaurantPhonograph, CPhonograph)
 END_MESSAGE_MAP()
 
 CRestaurantPhonograph::CRestaurantPhonograph() : CPhonograph(),
-	_fieldF8(1), _field114(0) {}
+		_isLocked(true), _field114(0) {}
 
 void CRestaurantPhonograph::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_isLocked, indent);
 	file->writeQuotedLine(_ejectSoundName, indent);
 	file->writeQuotedLine(_stopSoundName, indent);
 
@@ -51,7 +51,7 @@ void CRestaurantPhonograph::save(SimpleFile *file, int indent) {
 
 void CRestaurantPhonograph::load(SimpleFile *file) {
 	file->readNumber();
-	_fieldF8 = file->readNumber();
+	_isLocked = file->readNumber();
 	_ejectSoundName = file->readString();
 	_stopSoundName = file->readString();
 	_field114 = file->readNumber();
@@ -60,16 +60,18 @@ void CRestaurantPhonograph::load(SimpleFile *file) {
 }
 
 bool CRestaurantPhonograph::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
-	if (!_fieldF8 && !_isPlaying) {
+	if (!_isLocked && !_isPlaying) {
 		CQueryCylinderHolderMsg holderMsg;
 		holderMsg.execute(this);
 
 		if (!holderMsg._isOpen) {
+			// Start playing immediately
 			CPhonographPlayMsg playMsg;
 			playMsg.execute(this);
 		} else if (holderMsg._isPresent) {
+			// Need to close the cylinder holder before playing
 			CEjectCylinderMsg ejectMsg;
-			ejectMsg.execute(this);
+			ejectMsg.execute(this, nullptr, MSGFLAG_SCAN);
 
 			_isDisabled = true;
 			if (_field114) {
@@ -137,12 +139,12 @@ bool CRestaurantPhonograph::EjectCylinderMsg(CEjectCylinderMsg *msg) {
 }
 
 bool CRestaurantPhonograph::QueryPhonographState(CQueryPhonographState *msg) {
-	msg->_value = _fieldF8;
+	msg->_value = _isLocked;
 	return true;
 }
 
 bool CRestaurantPhonograph::LockPhonographMsg(CLockPhonographMsg *msg) {
-	_fieldF8 = msg->_value;
+	_isLocked = msg->_value;
 	return true;
 }
 
diff --git a/engines/titanic/game/restaurant_phonograph.h b/engines/titanic/game/restaurant_phonograph.h
index 8f72eaf..6724844 100644
--- a/engines/titanic/game/restaurant_phonograph.h
+++ b/engines/titanic/game/restaurant_phonograph.h
@@ -37,7 +37,7 @@ class CRestaurantPhonograph : public CPhonograph {
 	bool QueryPhonographState(CQueryPhonographState *msg);
 	bool LockPhonographMsg(CLockPhonographMsg *msg);
 private:
-	int _fieldF8;
+	bool _isLocked;
 	CString _ejectSoundName;
 	CString _stopSoundName;
 	int _field114;





More information about the Scummvm-git-logs mailing list