From 266f1c7dee502db432b047c1bef29595ba0ce332 Mon Sep 17 00:00:00 2001 From: uruk Date: Fri, 25 Jul 2014 23:15:36 +0200 Subject: Revert "CGE2: Refactor optionTouch()." This reverts commit 85909a52e42fb1151322bd7b5601d042ff844fad. --- engines/cge2/toolbar.cpp | 50 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) (limited to 'engines') diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp index 6c4a3e7bac..3556ec72ca 100644 --- a/engines/cge2/toolbar.cpp +++ b/engines/cge2/toolbar.cpp @@ -54,8 +54,21 @@ 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) @@ -74,8 +87,19 @@ 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; @@ -92,18 +116,6 @@ 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() { @@ -214,16 +226,6 @@ 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; - } } } -- cgit v1.2.3