diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/toolbar.cpp | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp index 3556ec72ca..6c4a3e7bac 100644 --- a/engines/cge2/toolbar.cpp +++ b/engines/cge2/toolbar.cpp @@ -54,21 +54,8 @@ void CGE2Engine::optionTouch(int opt, uint16 mask) { switchColorMode(); break; case 2: - if ((mask & kMouseLeftUp) && notMuted) { + if ((mask & kMouseLeftUp) && notMuted) switchMusic(_music = !_music); - - switch (_music) { - case false: - _oldMusicVolume = ConfMan.getInt("music_volume"); - ConfMan.setInt("music_volume", 0); - _vol[1]->step(0); - break; - case true: - ConfMan.setInt("music_volume", _oldMusicVolume); - _vol[1]->step(_oldMusicVolume / kSoundNumtoStateRate); - break; - } - } break; case 3: if (mask & kMouseLeftUp) @@ -87,19 +74,8 @@ void CGE2Engine::optionTouch(int opt, uint16 mask) { switchCap(); break; case 9: - if ((mask & kMouseLeftUp) && notMuted) { + if ((mask & kMouseLeftUp) && notMuted) switchVox(); - - switch (_sayVox) { - case false: - _oldSpeechVolume = ConfMan.getInt("speech_volume"); - ConfMan.setInt("speech_volume", 0); - break; - case true: - ConfMan.setInt("speech_volume", _oldSpeechVolume); - break; - } - } break; default: break; @@ -116,6 +92,18 @@ void CGE2Engine::switchMusic(bool on) { _commandHandlerTurbo->addCommand(kCmdSeq, kMusicRef, on, nullptr); keyClick(); _commandHandlerTurbo->addCommand(kCmdMidi, -1, on ? (_now << 8) : -1, nullptr); + + switch (_music) { + case false: + _oldMusicVolume = ConfMan.getInt("music_volume"); + ConfMan.setInt("music_volume", 0); + _vol[1]->step(0); + break; + case true: + ConfMan.setInt("music_volume", _oldMusicVolume); + _vol[1]->step(_oldMusicVolume / kSoundNumtoStateRate); + break; + } } void CGE2Engine::checkMusicSwitch() { @@ -226,6 +214,16 @@ void CGE2Engine::switchVox() { _sayCap = true; keyClick(); switchSay(); + + switch (_sayVox) { + case false: + _oldSpeechVolume = ConfMan.getInt("speech_volume"); + ConfMan.setInt("speech_volume", 0); + break; + case true: + ConfMan.setInt("speech_volume", _oldSpeechVolume); + break; + } } } |