diff options
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); } |