diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/game/restaurant_phonograph.cpp | 16 | ||||
-rw-r--r-- | engines/titanic/game/restaurant_phonograph.h | 2 |
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; |