From 562e502d7888e9b3a0a64725c9420c9e6484b5a9 Mon Sep 17 00:00:00 2001 From: dhewg Date: Sat, 19 Mar 2011 14:53:43 +0100 Subject: CRUISE: Cleanup syncSoundSettings() And init volume levels on startup --- engines/cruise/sound.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'engines/cruise/sound.cpp') 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) -- cgit v1.2.3