aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
authordhewg2011-03-19 14:53:43 +0100
committerdhewg2011-03-19 16:04:50 +0100
commit562e502d7888e9b3a0a64725c9420c9e6484b5a9 (patch)
tree3ac5444d0b8db06addb36b31d054b55e2da742b1 /engines/cruise
parente5056cab91843ec0de9b2c9d1b6d91ed49189da9 (diff)
downloadscummvm-rg350-562e502d7888e9b3a0a64725c9420c9e6484b5a9.tar.gz
scummvm-rg350-562e502d7888e9b3a0a64725c9420c9e6484b5a9.tar.bz2
scummvm-rg350-562e502d7888e9b3a0a64725c9420c9e6484b5a9.zip
CRUISE: Cleanup syncSoundSettings()
And init volume levels on startup
Diffstat (limited to 'engines/cruise')
-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)