diff options
author | uruk | 2014-08-13 20:25:38 +0200 |
---|---|---|
committer | uruk | 2014-08-13 20:25:38 +0200 |
commit | 28a450982ae4e144f991e243c216ec5bc65576ad (patch) | |
tree | 7eaf2271b1d77882356c6762b317ae9ab0267bd0 /engines | |
parent | 2eddd72fbf0a482319e4790dc9eb8cd220ae05ec (diff) | |
download | scummvm-rg350-28a450982ae4e144f991e243c216ec5bc65576ad.tar.gz scummvm-rg350-28a450982ae4e144f991e243c216ec5bc65576ad.tar.bz2 scummvm-rg350-28a450982ae4e144f991e243c216ec5bc65576ad.zip |
CGE2: Fix initVolumeSwitch().
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/cge2.h | 2 | ||||
-rw-r--r-- | engines/cge2/toolbar.cpp | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h index 4fc19a822d..cf03d098eb 100644 --- a/engines/cge2/cge2.h +++ b/engines/cge2/cge2.h @@ -224,7 +224,7 @@ public: void switchVox(); void switchSay(); void initToolbar(); - void initVolumeSwitch(Sprite *volSwitch); + void initVolumeSwitch(Sprite *volSwitch, int val); void checkSounds(); diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp index 3972df9c67..501a25cb9a 100644 --- a/engines/cge2/toolbar.cpp +++ b/engines/cge2/toolbar.cpp @@ -198,17 +198,20 @@ void CGE2Engine::initToolbar() { _vol[0] = _vga->_showQ->locate(kDvolRef); _vol[1] = _vga->_showQ->locate(kMvolRef); - if (_vol[0]) - initVolumeSwitch(_vol[0]); + if (_vol[0]) { + int val = ConfMan.getInt("sfx_volume"); + initVolumeSwitch(_vol[0], val); + } - if (_vol[1]) - initVolumeSwitch(_vol[1]); + if (_vol[1]) { + int val = ConfMan.getInt("music_volume"); + initVolumeSwitch(_vol[1], val); + } } -void CGE2Engine::initVolumeSwitch(Sprite *volSwitch) { +void CGE2Engine::initVolumeSwitch(Sprite *volSwitch, int val) { int state = 0; - if (!ConfMan.getBool("mute")) - state = ConfMan.getInt("sfx_volume") / kSoundNumtoStateRate; + state = val / kSoundNumtoStateRate; volSwitch->step(state); } |