mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
QUEEN: Init volume levels on startup
And cleanup syncSoundSettings() Also, respect global mute settings
This commit is contained in:
+13
-4
@@ -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()) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user