aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/restaurant_phonograph.cpp
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/titanic/game/restaurant_phonograph.cpp
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/titanic/game/restaurant_phonograph.cpp')
-rw-r--r--engines/titanic/game/restaurant_phonograph.cpp16
1 files changed, 9 insertions, 7 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;
}