[Scummvm-git-logs] scummvm master -> 46076c0ac5cbc132ddc57c15469d3b9cee56fd56

dreammaster dreammaster at scummvm.org
Fri Feb 17 05:37:35 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:
46076c0ac5 TITANIC: Fix operation of Phonograph play button


Commit: 46076c0ac5cbc132ddc57c15469d3b9cee56fd56
    https://github.com/scummvm/scummvm/commit/46076c0ac5cbc132ddc57c15469d3b9cee56fd56
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-16T23:37:27-05:00

Commit Message:
TITANIC: Fix operation of Phonograph play button

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


diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp
index 2b7bc98..b86fa0b 100644
--- a/engines/titanic/game/phonograph.cpp
+++ b/engines/titanic/game/phonograph.cpp
@@ -34,8 +34,8 @@ BEGIN_MESSAGE_MAP(CPhonograph, CMusicPlayer)
 END_MESSAGE_MAP()
 
 CPhonograph::CPhonograph() : CMusicPlayer(),
-		_isPlaying(false), _isRecording(false), _isDisabled(false), _fieldEC(0),
-		_fieldF0(0), _fieldF4(0) {
+		_isPlaying(false), _isRecording(false), _isDisabled(false),
+		_playUnpressedFrame(false), _playPressedFrame(false), _unused5(0) {
 }
 
 void CPhonograph::save(SimpleFile *file, int indent) {
@@ -44,9 +44,9 @@ void CPhonograph::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_isPlaying, indent);
 	file->writeNumberLine(_isRecording, indent);
 	file->writeNumberLine(_isDisabled, indent);
-	file->writeNumberLine(_fieldEC, indent);
-	file->writeNumberLine(_fieldF0, indent);
-	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_playUnpressedFrame, indent);
+	file->writeNumberLine(_playPressedFrame, indent);
+	file->writeNumberLine(_unused5, indent);
 
 	CMusicPlayer::save(file, indent);
 }
@@ -57,9 +57,9 @@ void CPhonograph::load(SimpleFile *file) {
 	_isPlaying = file->readNumber();
 	_isRecording = file->readNumber();
 	_isDisabled = file->readNumber();
-	_fieldEC = file->readNumber();
-	_fieldF0 = file->readNumber();
-	_fieldF4 = file->readNumber();
+	_playUnpressedFrame = file->readNumber();
+	_playPressedFrame = file->readNumber();
+	_unused5 = file->readNumber();
 
 	CMusicPlayer::load(file);
 }
@@ -98,7 +98,6 @@ bool CPhonograph::PhonographStopMsg(CPhonographStopMsg *msg) {
 	if (!holderMsg._isPresent)
 		return true;
 
-	_isPlaying = false;
 	CQueryCylinderMsg cylinderMsg;
 	cylinderMsg.execute(holderMsg._target);
 
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
index 4cce6ec..6630a18 100644
--- a/engines/titanic/game/phonograph.h
+++ b/engines/titanic/game/phonograph.h
@@ -41,9 +41,9 @@ protected:
 	bool _isPlaying;
 	bool _isRecording;
 	bool _isDisabled;
-	int _fieldEC;
-	int _fieldF0;
-	int _fieldF4;
+	int _playUnpressedFrame;
+	int _playPressedFrame;
+	int _unused5;
 public:
 	CLASSDEF;
 	CPhonograph();
diff --git a/engines/titanic/game/restaurant_phonograph.cpp b/engines/titanic/game/restaurant_phonograph.cpp
index a2c8892..693cf3d 100644
--- a/engines/titanic/game/restaurant_phonograph.cpp
+++ b/engines/titanic/game/restaurant_phonograph.cpp
@@ -73,7 +73,7 @@ bool CRestaurantPhonograph::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 
 			_isDisabled = true;
 			if (_field114) {
-				loadFrame(_fieldEC);
+				loadFrame(_playUnpressedFrame);
 				playSound(_ejectSoundName);
 			}
 		}
@@ -83,9 +83,11 @@ bool CRestaurantPhonograph::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 }
 
 bool CRestaurantPhonograph::PhonographPlayMsg(CPhonographPlayMsg *msg) {
+	CPhonograph::PhonographPlayMsg(msg);
+
 	if (_isPlaying) {
 		if (findView() == getView() && (!_isDisabled || !_field114)) {
-			loadFrame(_fieldEC);
+			loadFrame(_playUnpressedFrame);
 			playSound(_ejectSoundName);
 		}
 
@@ -94,7 +96,7 @@ bool CRestaurantPhonograph::PhonographPlayMsg(CPhonographPlayMsg *msg) {
 		CRestaurantMusicChanged musicMsg(nameMsg._name);
 		musicMsg.execute(findRoom());
 	} else {
-		loadFrame(_fieldF0);
+		loadFrame(_playPressedFrame);
 	}
 
 	return true;
@@ -105,11 +107,11 @@ bool CRestaurantPhonograph::PhonographStopMsg(CPhonographStopMsg *msg) {
 	CPhonograph::PhonographStopMsg(msg);
 
 	if (_isPlaying) {
-		loadFrame(_fieldF0);
+		loadFrame(_playUnpressedFrame);
+	} else {
+		loadFrame(_playPressedFrame);
 		if (flag)
 			playSound(_stopSoundName);
-	} else {
-		loadFrame(_fieldEC);
 	}
 
 	return true;





More information about the Scummvm-git-logs mailing list