diff options
author | uruk | 2014-07-28 16:12:33 +0200 |
---|---|---|
committer | uruk | 2014-07-28 16:17:13 +0200 |
commit | cc7a70d967cc91d7829476f43550c28d0454f976 (patch) | |
tree | d490025eee66963e44ce02d35ca4d5902a6b249d | |
parent | ab2f720f379935a738c7c9a04d0cfc647c241467 (diff) | |
download | scummvm-rg350-cc7a70d967cc91d7829476f43550c28d0454f976.tar.gz scummvm-rg350-cc7a70d967cc91d7829476f43550c28d0454f976.tar.bz2 scummvm-rg350-cc7a70d967cc91d7829476f43550c28d0454f976.zip |
CGE2: Use if-else instead of switch-case with boolean values.
-rw-r--r-- | engines/cge2/toolbar.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp index b6bcfd7806..e595074435 100644 --- a/engines/cge2/toolbar.cpp +++ b/engines/cge2/toolbar.cpp @@ -99,16 +99,13 @@ void CGE2Engine::switchMusic(bool on) { } void CGE2Engine::updateMusicVolume() { - switch (_music) { - case false: + if (_music) { + ConfMan.setInt("music_volume", _oldMusicVolume); + _vol[1]->step(_oldMusicVolume / kSoundNumtoStateRate); + } else { _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; } } @@ -224,14 +221,11 @@ void CGE2Engine::switchVox() { } void CGE2Engine::updateSpeechVolume() { - switch (_sayVox) { - case false: + if (_sayVox) { + ConfMan.setInt("speech_volume", _oldSpeechVolume); + } else { _oldSpeechVolume = ConfMan.getInt("speech_volume"); ConfMan.setInt("speech_volume", 0); - break; - case true: - ConfMan.setInt("speech_volume", _oldSpeechVolume); - break; } } |