aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-02-17 21:17:58 -0500
committerPaul Gilbert2017-02-17 21:17:58 -0500
commitc8c96e953073a0505fd4c7d1cf4754b443ce7c38 (patch)
tree2b34940d1aeb24f92765543b3098d94a74be2e89 /engines
parentfee0b81b39280440997e54ac7b28325420cd46c4 (diff)
downloadscummvm-rg350-c8c96e953073a0505fd4c7d1cf4754b443ce7c38.tar.gz
scummvm-rg350-c8c96e953073a0505fd4c7d1cf4754b443ce7c38.tar.bz2
scummvm-rg350-c8c96e953073a0505fd4c7d1cf4754b443ce7c38.zip
TITANIC: Fix playing phonograph when cylinder holder is open
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/game/restaurant_phonograph.cpp16
-rw-r--r--engines/titanic/game/restaurant_phonograph.h2
2 files changed, 10 insertions, 8 deletions
diff --git a/engines/titanic/game/restaurant_phonograph.cpp b/engines/titanic/game/restaurant_phonograph.cpp
index 693cf3d76e..3b35514a52 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 8f72eaf58f..67248447ab 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;