aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/titanic/carry/phonograph_ear.cpp9
-rw-r--r--engines/titanic/carry/phonograph_ear.h4
-rw-r--r--engines/titanic/game/music_console_button.cpp18
-rw-r--r--engines/titanic/sound/music_player.cpp2
-rw-r--r--engines/titanic/sound/music_room.h20
5 files changed, 34 insertions, 19 deletions
diff --git a/engines/titanic/carry/phonograph_ear.cpp b/engines/titanic/carry/phonograph_ear.cpp
index df0445d164..48ed85d685 100644
--- a/engines/titanic/carry/phonograph_ear.cpp
+++ b/engines/titanic/carry/phonograph_ear.cpp
@@ -32,13 +32,13 @@ END_MESSAGE_MAP()
void CPhonographEar::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_field140, indent);
+ file->writeNumberLine(_replacementEar, indent);
CEar::save(file, indent);
}
void CPhonographEar::load(SimpleFile *file) {
file->readNumber();
- _field140 = file->readNumber();
+ _replacementEar = file->readNumber();
CEar::load(file);
}
@@ -48,8 +48,9 @@ bool CPhonographEar::CorrectMusicPlayedMsg(CCorrectMusicPlayedMsg *msg) {
}
bool CPhonographEar::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
- if (_field140) {
- _field140 = false;
+ if (_replacementEar) {
+ // Start a timer to add a replacement ear to the Phonograph
+ _replacementEar = false;
addTimer(1000);
}
diff --git a/engines/titanic/carry/phonograph_ear.h b/engines/titanic/carry/phonograph_ear.h
index b5db015f90..df0700c5d1 100644
--- a/engines/titanic/carry/phonograph_ear.h
+++ b/engines/titanic/carry/phonograph_ear.h
@@ -33,10 +33,10 @@ class CPhonographEar : public CEar {
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
bool TimerMsg(CTimerMsg *msg);
private:
- bool _field140;
+ bool _replacementEar;
public:
CLASSDEF;
- CPhonographEar() : CEar(), _field140(true) {}
+ CPhonographEar() : CEar(), _replacementEar(true) {}
/**
* Save the data for the class to file
diff --git a/engines/titanic/game/music_console_button.cpp b/engines/titanic/game/music_console_button.cpp
index 639aebd9c9..872202891c 100644
--- a/engines/titanic/game/music_console_button.cpp
+++ b/engines/titanic/game/music_console_button.cpp
@@ -60,6 +60,7 @@ bool CMusicConsoleButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (CMusicRoom::_musicHandler->checkInstrument(SNAKE)
&& CMusicRoom::_musicHandler->checkInstrument(PIANO)
&& CMusicRoom::_musicHandler->checkInstrument(BASS)) {
+ // All three instruments have the correct settings
CCorrectMusicPlayedMsg correctMsg;
correctMsg.execute(findRoom());
}
@@ -70,6 +71,7 @@ bool CMusicConsoleButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
bool CMusicConsoleButton::LeaveViewMsg(CLeaveViewMsg *msg) {
if (_isActive) {
+ // Stop playing the active music
CStopMusicMsg stopMsg(this);
stopMsg.execute(this);
stopMovie();
@@ -83,8 +85,6 @@ bool CMusicConsoleButton::SetMusicControlsMsg(CSetMusicControlsMsg *msg) {
CMusicRoom *musicRoom = getMusicRoom();
CQueryMusicControlSettingMsg queryMsg;
- queryMsg.execute("Bells Mute Control");
- musicRoom->setMuteControl(BELLS, queryMsg._value == 1);
queryMsg.execute("Bells Pitch Control");
musicRoom->setPitchControl(BELLS, queryMsg._value);
queryMsg.execute("Bells Speed Control");
@@ -93,9 +93,9 @@ bool CMusicConsoleButton::SetMusicControlsMsg(CSetMusicControlsMsg *msg) {
musicRoom->setInversionControl(BELLS, queryMsg._value == 1);
queryMsg.execute("Bells Direction Control");
musicRoom->setDirectionControl(BELLS, queryMsg._value == 1);
+ queryMsg.execute("Bells Mute Control");
+ musicRoom->setMuteControl(BELLS, queryMsg._value == 1);
- queryMsg.execute("Snake Mute Control");
- musicRoom->setMuteControl(SNAKE, queryMsg._value == 1);
queryMsg.execute("Snake Pitch Control");
musicRoom->setPitchControl(SNAKE, queryMsg._value);
queryMsg.execute("Snake Speed Control");
@@ -104,9 +104,9 @@ bool CMusicConsoleButton::SetMusicControlsMsg(CSetMusicControlsMsg *msg) {
musicRoom->setInversionControl(SNAKE, queryMsg._value == 1);
queryMsg.execute("Snake Direction Control");
musicRoom->setDirectionControl(SNAKE, queryMsg._value == 1);
+ queryMsg.execute("Snake Mute Control");
+ musicRoom->setMuteControl(SNAKE, queryMsg._value == 1);
- queryMsg.execute("Piano Mute Control");
- musicRoom->setMuteControl(PIANO, queryMsg._value == 1);
queryMsg.execute("Piano Pitch Control");
musicRoom->setPitchControl(PIANO, queryMsg._value);
queryMsg.execute("Piano Speed Control");
@@ -115,9 +115,9 @@ bool CMusicConsoleButton::SetMusicControlsMsg(CSetMusicControlsMsg *msg) {
musicRoom->setInversionControl(PIANO, queryMsg._value == 1);
queryMsg.execute("Piano Direction Control");
musicRoom->setDirectionControl(PIANO, queryMsg._value == 1);
+ queryMsg.execute("Piano Mute Control");
+ musicRoom->setMuteControl(PIANO, queryMsg._value == 1);
- queryMsg.execute("Bass Mute Control");
- musicRoom->setMuteControl(BASS, queryMsg._value == 1);
queryMsg.execute("Bass Pitch Control");
musicRoom->setPitchControl(BASS, queryMsg._value);
queryMsg.execute("Bass Speed Control");
@@ -126,6 +126,8 @@ bool CMusicConsoleButton::SetMusicControlsMsg(CSetMusicControlsMsg *msg) {
musicRoom->setInversionControl(BASS, queryMsg._value == 1);
queryMsg.execute("Bass Direction Control");
musicRoom->setDirectionControl(BASS, queryMsg._value == 1);
+ queryMsg.execute("Bass Mute Control");
+ musicRoom->setMuteControl(BASS, queryMsg._value == 1);
return true;
}
diff --git a/engines/titanic/sound/music_player.cpp b/engines/titanic/sound/music_player.cpp
index 548941871d..a6a791f96e 100644
--- a/engines/titanic/sound/music_player.cpp
+++ b/engines/titanic/sound/music_player.cpp
@@ -110,6 +110,7 @@ bool CMusicPlayer::FrameMsg(CFrameMsg *msg) {
}
bool CMusicPlayer::EnterRoomMsg(CEnterRoomMsg *msg) {
+ // Set up a timer that will create a music handler
addTimer(100);
return true;
}
@@ -171,6 +172,7 @@ bool CMusicPlayer::TimerMsg(CTimerMsg *msg) {
bool CMusicPlayer::LoadSuccessMsg(CLoadSuccessMsg *msg) {
if (_isActive) {
+ // Music is meant to be playing, so restart it
CStopMusicMsg stopMsg;
stopMsg.execute(this);
CStartMusicMsg startMsg;
diff --git a/engines/titanic/sound/music_room.h b/engines/titanic/sound/music_room.h
index da9e363850..f39957bdd1 100644
--- a/engines/titanic/sound/music_room.h
+++ b/engines/titanic/sound/music_room.h
@@ -56,27 +56,37 @@ public:
/**
* Sets the speed control for a given instrument
*/
- void setSpeedControl(MusicInstrument instrument, int val) { _instruments[instrument]._speedControl = val; }
+ void setSpeedControl(MusicInstrument instrument, int val) {
+ _instruments[instrument]._speedControl = val;
+ }
/**
* Sets the pitch control for a given instrument
*/
- void setPitchControl(MusicInstrument instrument, int val) { _instruments[instrument]._pitchControl = val; }
+ void setPitchControl(MusicInstrument instrument, int val) {
+ _instruments[instrument]._pitchControl = val;
+ }
/**
* Sets the direction control for a given instrument
*/
- void setDirectionControl(MusicInstrument instrument, bool val) { _instruments[instrument]._directionControl = val; }
+ void setDirectionControl(MusicInstrument instrument, bool val) {
+ _instruments[instrument]._directionControl = val;
+ }
/**
* Sets the inversion control for a given instrument
*/
- void setInversionControl(MusicInstrument instrument, bool val) { _instruments[instrument]._inversionControl = val; }
+ void setInversionControl(MusicInstrument instrument, bool val) {
+ _instruments[instrument]._inversionControl = val;
+ }
/**
* Sets the mute control for a given instrument
*/
- void setMuteControl(MusicInstrument instrument, bool val) { _instruments[instrument]._muteControl = val; }
+ void setMuteControl(MusicInstrument instrument, bool val) {
+ _instruments[instrument]._muteControl = val;
+ }
/**
* Sets up the music controls