DRAGONS: Update engine volumes after returning from options menu #11585

This commit is contained in:
Eric Fry 2020-08-26 23:50:57 +10:00
parent 70a191ae0a
commit 76ca773ff1
4 changed files with 15 additions and 0 deletions

View file

@ -1797,6 +1797,11 @@ void DragonsEngine::clearAllText() {
_fontManager->clearText();
}
void DragonsEngine::syncSoundSettings() {
Engine::syncSoundSettings();
_sound->syncSoundSettings();
}
void (*DragonsEngine::getSceneUpdateFunction())() {
return _sceneUpdateFunction;
}

View file

@ -245,6 +245,7 @@ public:
bool canLoadGameStateCurrently() override;
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave) override;
bool canSaveGameStateCurrently() override;
void syncSoundSettings() override;
void updateActorSequences();
void setFlags(uint32 flags);

View file

@ -538,4 +538,12 @@ void SoundManager::playMusic(int16 song) {
delete seq;
}
void SoundManager::syncSoundSettings() {
_musicVolume = CLIP<int>(ConfMan.getInt("music_volume"), 0, 255);
_sfxVolume = CLIP<int>(ConfMan.getInt("sfx_volume"), 0, 255);
_speechVolume = CLIP<int>(ConfMan.getInt("speech_volume"), 0, 255);
_midiPlayer->setVolume(_musicVolume);
}
} // End of namespace Dragons

View file

@ -59,6 +59,7 @@ public:
void playSpeech(uint32 textIndex);
bool isSpeechPlaying();
void resumeMusic();
void syncSoundSettings();
public:
uint16 _dat_8006bb60_sound_related;