aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/titanic/game/music_room_stop_phonograph_button.cpp2
-rw-r--r--engines/titanic/game/phonograph.cpp22
-rw-r--r--engines/titanic/game/phonograph.h4
-rw-r--r--engines/titanic/game/restaurant_phonograph.cpp18
-rw-r--r--engines/titanic/game/restaurant_phonograph.h2
-rw-r--r--engines/titanic/messages/messages.h2
6 files changed, 25 insertions, 25 deletions
diff --git a/engines/titanic/game/music_room_stop_phonograph_button.cpp b/engines/titanic/game/music_room_stop_phonograph_button.cpp
index dee2c0883e..0a72406b0f 100644
--- a/engines/titanic/game/music_room_stop_phonograph_button.cpp
+++ b/engines/titanic/game/music_room_stop_phonograph_button.cpp
@@ -49,7 +49,7 @@ bool CMusicRoomStopPhonographButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg
CPhonographStopMsg stopMsg;
stopMsg.execute(getParent(), nullptr, MSGFLAG_SCAN);
- if (stopMsg._value2) {
+ if (stopMsg._cylinderPresent) {
_ticks = getTicksCount();
} else {
CEjectCylinderMsg ejectMsg;
diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp
index 26163a74df..f43bb3a60b 100644
--- a/engines/titanic/game/phonograph.cpp
+++ b/engines/titanic/game/phonograph.cpp
@@ -34,16 +34,16 @@ BEGIN_MESSAGE_MAP(CPhonograph, CMusicPlayer)
END_MESSAGE_MAP()
CPhonograph::CPhonograph() : CMusicPlayer(),
- _isPlaying(false), _isRecording(false), _fieldE8(0), _fieldEC(0),
+ _isPlaying(false), _isRecording(false), _isDisabled(false), _fieldEC(0),
_fieldF0(0), _fieldF4(0) {
}
void CPhonograph::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeQuotedLine(_string2, indent);
+ file->writeQuotedLine(_unused, indent);
file->writeNumberLine(_isPlaying, indent);
file->writeNumberLine(_isRecording, indent);
- file->writeNumberLine(_fieldE8, indent);
+ file->writeNumberLine(_isDisabled, indent);
file->writeNumberLine(_fieldEC, indent);
file->writeNumberLine(_fieldF0, indent);
file->writeNumberLine(_fieldF4, indent);
@@ -53,10 +53,10 @@ void CPhonograph::save(SimpleFile *file, int indent) {
void CPhonograph::load(SimpleFile *file) {
file->readNumber();
- _string2 = file->readString();
+ _unused = file->readString();
_isPlaying = file->readNumber();
_isRecording = file->readNumber();
- _fieldE8 = file->readNumber();
+ _isDisabled = file->readNumber();
_fieldEC = file->readNumber();
_fieldF0 = file->readNumber();
_fieldF4 = file->readNumber();
@@ -108,23 +108,23 @@ bool CPhonograph::PhonographStopMsg(CPhonographStopMsg *msg) {
CStopMusicMsg stopMsg;
stopMsg.execute(this);
} else {
- stopGlobalSound(msg->_value1, -1);
+ stopGlobalSound(msg->_leavingRoom, -1);
}
- msg->_value2 = 1;
+ msg->_cylinderPresent = true;
}
- if (!msg->_value3)
+ if (!msg->_dontStop)
_isPlaying = false;
} else if (_isRecording) {
_isRecording = false;
- msg->_value2 = 1;
+ msg->_cylinderPresent = true;
}
return true;
}
bool CPhonograph::PhonographRecordMsg(CPhonographRecordMsg *msg) {
- if (!_isPlaying && !_isRecording && !_fieldE8) {
+ if (!_isPlaying && !_isRecording && !_isDisabled) {
CQueryCylinderHolderMsg holderMsg;
holderMsg.execute(this);
@@ -153,7 +153,7 @@ bool CPhonograph::EnterRoomMsg(CEnterRoomMsg *msg) {
bool CPhonograph::LeaveRoomMsg(CLeaveRoomMsg *msg) {
if (_isPlaying) {
CPhonographStopMsg stopMsg;
- stopMsg._value1 = 1;
+ stopMsg._leavingRoom = true;
stopMsg.execute(this);
}
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
index 3c4fb86f32..4cce6ecefd 100644
--- a/engines/titanic/game/phonograph.h
+++ b/engines/titanic/game/phonograph.h
@@ -37,10 +37,10 @@ class CPhonograph : public CMusicPlayer {
bool LeaveRoomMsg(CLeaveRoomMsg *msg);
bool MusicHasStartedMsg(CMusicHasStartedMsg *msg);
protected:
- CString _string2;
+ CString _unused;
bool _isPlaying;
bool _isRecording;
- int _fieldE8;
+ bool _isDisabled;
int _fieldEC;
int _fieldF0;
int _fieldF4;
diff --git a/engines/titanic/game/restaurant_phonograph.cpp b/engines/titanic/game/restaurant_phonograph.cpp
index 22f86dc8ab..a2c8892201 100644
--- a/engines/titanic/game/restaurant_phonograph.cpp
+++ b/engines/titanic/game/restaurant_phonograph.cpp
@@ -41,8 +41,8 @@ CRestaurantPhonograph::CRestaurantPhonograph() : CPhonograph(),
void CRestaurantPhonograph::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_fieldF8, indent);
- file->writeQuotedLine(_string2, indent);
- file->writeQuotedLine(_string3, indent);
+ file->writeQuotedLine(_ejectSoundName, indent);
+ file->writeQuotedLine(_stopSoundName, indent);
file->writeNumberLine(_field114, indent);
@@ -52,8 +52,8 @@ void CRestaurantPhonograph::save(SimpleFile *file, int indent) {
void CRestaurantPhonograph::load(SimpleFile *file) {
file->readNumber();
_fieldF8 = file->readNumber();
- _string2 = file->readString();
- _string3 = file->readString();
+ _ejectSoundName = file->readString();
+ _stopSoundName = file->readString();
_field114 = file->readNumber();
CPhonograph::load(file);
@@ -71,7 +71,7 @@ bool CRestaurantPhonograph::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
CEjectCylinderMsg ejectMsg;
ejectMsg.execute(this);
- _fieldE8 = true;
+ _isDisabled = true;
if (_field114) {
loadFrame(_fieldEC);
playSound(_ejectSoundName);
@@ -84,7 +84,7 @@ bool CRestaurantPhonograph::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
bool CRestaurantPhonograph::PhonographPlayMsg(CPhonographPlayMsg *msg) {
if (_isPlaying) {
- if (findView() == getView() && (!_fieldE8 || !_field114)) {
+ if (findView() == getView() && (!_isDisabled || !_field114)) {
loadFrame(_fieldEC);
playSound(_ejectSoundName);
}
@@ -107,7 +107,7 @@ bool CRestaurantPhonograph::PhonographStopMsg(CPhonographStopMsg *msg) {
if (_isPlaying) {
loadFrame(_fieldF0);
if (flag)
- playSound(_string3);
+ playSound(_stopSoundName);
} else {
loadFrame(_fieldEC);
}
@@ -116,10 +116,10 @@ bool CRestaurantPhonograph::PhonographStopMsg(CPhonographStopMsg *msg) {
}
bool CRestaurantPhonograph::PhonographReadyToPlayMsg(CPhonographReadyToPlayMsg *msg) {
- if (_fieldE8) {
+ if (_isDisabled) {
CPhonographPlayMsg playMsg;
playMsg.execute(this);
- _fieldE8 = false;
+ _isDisabled = false;
}
return true;
diff --git a/engines/titanic/game/restaurant_phonograph.h b/engines/titanic/game/restaurant_phonograph.h
index 9661df0dfb..8f72eaf58f 100644
--- a/engines/titanic/game/restaurant_phonograph.h
+++ b/engines/titanic/game/restaurant_phonograph.h
@@ -39,7 +39,7 @@ class CRestaurantPhonograph : public CPhonograph {
private:
int _fieldF8;
CString _ejectSoundName;
- CString _string3;
+ CString _stopSoundName;
int _field114;
public:
CLASSDEF;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 82f6931352..f70acdcfb2 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -305,7 +305,7 @@ MESSAGE2(CParrotTriesChickenMsg, int, value1, 0, int, value2, 0);
MESSAGE1(CPhonographPlayMsg, int, value, 0);
MESSAGE0(CPhonographReadyToPlayMsg);
MESSAGE1(CPhonographRecordMsg, bool, canRecord, false);
-MESSAGE3(CPhonographStopMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE3(CPhonographStopMsg, bool, leavingRoom, false, bool, cylinderPresent, false, bool, dontStop, false);
MESSAGE2(CPlayRangeMsg, int, value1, 0, int, value2, 0);
MESSAGE2(CPlayerTriesRestaurantTableMsg, int, tableId, 0, bool, result, false);
MESSAGE1(CPreSaveMsg, int, value, 0);