diff options
author | Christopher Page | 2008-07-17 17:49:38 +0000 |
---|---|---|
committer | Christopher Page | 2008-07-17 17:49:38 +0000 |
commit | 41d896dc2fce7624c36788916f2fc8b3fd906fce (patch) | |
tree | 2ab5fe31159401c5a7dd690fe43f49bdc8530195 /engines/sword1/sword1.cpp | |
parent | 7f480ac571f978802a3ecd5cf6169d0271d1f561 (diff) | |
download | scummvm-rg350-41d896dc2fce7624c36788916f2fc8b3fd906fce.tar.gz scummvm-rg350-41d896dc2fce7624c36788916f2fc8b3fd906fce.tar.bz2 scummvm-rg350-41d896dc2fce7624c36788916f2fc8b3fd906fce.zip |
SWORD1 Sound settings work with the GMM
svn-id: r33090
Diffstat (limited to 'engines/sword1/sword1.cpp')
-rw-r--r-- | engines/sword1/sword1.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index 4d0eb1dc98..e9dbe541d2 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -357,6 +357,32 @@ void SwordEngine::reinitialize(void) { _systemVars.wantFade = true; } +void SwordEngine::syncSoundSettings() { + int soundVolumeSFX = ConfMan.getInt("sfx_volume"); + int soundVolumeSpeech = ConfMan.getInt("speech_volume"); + + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSFX); + _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech); + + uint musicVol = ConfMan.getInt("music_volume"); + uint musicBal = 50; + if (ConfMan.hasKey("music_balance")) { + musicBal = CLIP(ConfMan.getInt("music_balance"), 0, 100); + } + + uint musicVolL = 2 * musicVol * musicBal / 100; + uint musicVolR = 2 * musicVol - musicVolL; + + if (musicVolR > 255) { + musicVolR = 255; + } + if (musicVolL > 255) { + musicVolL = 255; + } + + _music->setVolume(musicVolL, musicVolR); +} + void SwordEngine::flagsToBool(bool *dest, uint8 flags) { uint8 bitPos = 0; while (flags) { |