aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/cruise/cruise.cpp11
-rw-r--r--engines/cruise/sound.cpp16
2 files changed, 19 insertions, 8 deletions
diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp
index c1ea711228..2c5659c4d9 100644
--- a/engines/cruise/cruise.cpp
+++ b/engines/cruise/cruise.cpp
@@ -52,16 +52,13 @@ CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc
DebugMan.addDebugChannel(kCruiseDebugScript, "scripts", "Scripts debug level");
DebugMan.addDebugChannel(kCruiseDebugSound, "sound", "Sound debug level");
- // Setup mixer
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType,
- ConfMan.getInt("sfx_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType,
- ConfMan.getInt("music_volume"));
-
_vm = this;
_debugger = new Debugger();
_sound = new PCSound(_mixer, this);
+ // Setup mixer
+ syncSoundSettings();
+
g_eventRec.registerRandomSource(_rnd, "cruise");
}
@@ -235,6 +232,8 @@ const char *CruiseEngine::getSavegameFile(int saveGameIdx) {
}
void CruiseEngine::syncSoundSettings() {
+ Engine::syncSoundSettings();
+
_sound->syncSounds();
}
diff --git a/engines/cruise/sound.cpp b/engines/cruise/sound.cpp
index 8a4b1d0d2b..2826a34351 100644
--- a/engines/cruise/sound.cpp
+++ b/engines/cruise/sound.cpp
@@ -283,9 +283,21 @@ void PCSoundDriver::resetChannel(int channel) {
}
void PCSoundDriver::syncSounds() {
+ bool mute = false;
+ if (ConfMan.hasKey("mute"))
+ mute = ConfMan.getBool("mute");
+
+ bool music_mute = mute;
+ bool sfx_mute = mute;
+
+ if (!mute) {
+ music_mute = ConfMan.getBool("music_mute");
+ sfx_mute = ConfMan.getBool("sfx_mute");
+ }
+
// Get the new music and sfx volumes
- _musicVolume = ConfMan.getBool("music_mute") ? 0 : MIN(255, ConfMan.getInt("music_volume"));
- _sfxVolume = ConfMan.getBool("sfx_mute") ? 0 : MIN(255, ConfMan.getInt("sfx_volume"));
+ _musicVolume = music_mute ? 0 : MIN(255, ConfMan.getInt("music_volume"));
+ _sfxVolume = sfx_mute ? 0 : MIN(255, ConfMan.getInt("sfx_volume"));
}
AdLibSoundDriver::AdLibSoundDriver(Audio::Mixer *mixer)