mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 00:15:30 +00:00
CGE2: Fix initVolumeSwitch().
This commit is contained in:
parent
2eddd72fbf
commit
28a450982a
@ -224,7 +224,7 @@ public:
|
||||
void switchVox();
|
||||
void switchSay();
|
||||
void initToolbar();
|
||||
void initVolumeSwitch(Sprite *volSwitch);
|
||||
void initVolumeSwitch(Sprite *volSwitch, int val);
|
||||
|
||||
void checkSounds();
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user