diff options
author | uruk | 2014-07-25 23:08:02 +0200 |
---|---|---|
committer | uruk | 2014-07-25 23:08:02 +0200 |
commit | 85909a52e42fb1151322bd7b5601d042ff844fad (patch) | |
tree | 147ea32e0b298bc8da4d9713a27d0e90921b6b88 /engines/cge2 | |
parent | 870349078ec02f8d8921dd6bb32efd17cff68a24 (diff) | |
download | scummvm-rg350-85909a52e42fb1151322bd7b5601d042ff844fad.tar.gz scummvm-rg350-85909a52e42fb1151322bd7b5601d042ff844fad.tar.bz2 scummvm-rg350-85909a52e42fb1151322bd7b5601d042ff844fad.zip |
CGE2: Refactor optionTouch().
Diffstat (limited to 'engines/cge2')
-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; + } } } |