QUEEN: Init volume levels on startup

And cleanup syncSoundSettings()
Also, respect global mute settings
This commit is contained in:
dhewg
2011-03-19 16:04:55 +01:00
parent 5b6479c55a
commit b5af156839
2 changed files with 13 additions and 7 deletions
+13 -4
View File
@@ -240,14 +240,20 @@ void QueenEngine::checkOptionSettings() {
}
void QueenEngine::syncSoundSettings() {
Engine::syncSoundSettings();
readOptionSettings();
}
void QueenEngine::readOptionSettings() {
bool mute = false;
if (ConfMan.hasKey("mute"))
mute = ConfMan.getBool("mute");
_sound->setVolume(ConfMan.getInt("music_volume"));
_sound->musicToggle(!ConfMan.getBool("music_mute"));
_sound->sfxToggle(!ConfMan.getBool("sfx_mute"));
_sound->speechToggle(!ConfMan.getBool("speech_mute"));
_sound->musicToggle(!(mute || ConfMan.getBool("music_mute")));
_sound->sfxToggle(!(mute || ConfMan.getBool("sfx_mute")));
_sound->speechToggle(!(mute || !ConfMan.getBool("speech_mute")));
_talkSpeed = (ConfMan.getInt("talkspeed") * (MAX_TEXT_SPEED - MIN_TEXT_SPEED) + 255 / 2) / 255 + MIN_TEXT_SPEED;
_subtitles = ConfMan.getBool("subtitles");
checkOptionSettings();
@@ -470,11 +476,14 @@ Common::Error QueenEngine::run() {
}
_sound = Sound::makeSoundInstance(_mixer, this, _resource->getCompression());
_walk = new Walk(this);
//_talkspeedScale = (MAX_TEXT_SPEED - MIN_TEXT_SPEED) / 255.0;
registerDefaultSettings();
readOptionSettings();
// Setup mixer
syncSoundSettings();
_logic->start();
if (ConfMan.hasKey("save_slot") && canLoadOrSave()) {
-3
View File
@@ -193,9 +193,6 @@ Sound *Sound::makeSoundInstance(Audio::Mixer *mixer, QueenEngine *vm, uint8 comp
void Sound::setVolume(int vol) {
_musicVolume = vol;
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, _musicVolume);
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
}
void Sound::saveState(byte *&ptr) {