From e36166bda291f6f0af8af3328efce5aa4b83cd9a Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Thu, 26 Jun 2008 23:22:28 +0000 Subject: Added syncSoundSettings() to Engine, sound settings can now be modified from the global main menu for most engines svn-id: r32815 --- engines/engine.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'engines/engine.cpp') diff --git a/engines/engine.cpp b/engines/engine.cpp index 29135d9323..3a13c275ba 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -77,7 +77,8 @@ Engine::Engine(OSystem *syst) Engine::~Engine() { _mixer->stopAll(); - + + delete _mainMenuDialog; g_engine = NULL; } @@ -220,6 +221,7 @@ void Engine::mainMenuDialog() { if (!_mainMenuDialog) _mainMenuDialog = new MainMenuDialog(this); runDialog(*_mainMenuDialog); + syncSoundSettings(); } int Engine::runDialog(Dialog &dialog) { @@ -233,3 +235,14 @@ int Engine::runDialog(Dialog &dialog) { return 0; } +void Engine::syncSoundSettings() { + + // Sync the engine with the config manager + int soundVolumeMusic = ConfMan.getInt("music_volume"); + int soundVolumeSFX = ConfMan.getInt("sfx_volume"); + int soundVolumeSpeech = ConfMan.getInt("speech_volume"); + + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic); + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSFX); + _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech); +} -- cgit v1.2.3