aboutsummaryrefslogtreecommitdiff
path: root/engines/cge2
diff options
context:
space:
mode:
authoruruk2014-07-25 23:05:23 +0200
committeruruk2014-07-25 23:05:23 +0200
commit870349078ec02f8d8921dd6bb32efd17cff68a24 (patch)
tree07febb9a4e1eab0144413967eb81e8914de887d8 /engines/cge2
parent8a9a088b31dd01facf1f4dd9f1dd1d2cadbfa2d0 (diff)
downloadscummvm-rg350-870349078ec02f8d8921dd6bb32efd17cff68a24.tar.gz
scummvm-rg350-870349078ec02f8d8921dd6bb32efd17cff68a24.tar.bz2
scummvm-rg350-870349078ec02f8d8921dd6bb32efd17cff68a24.zip
CGE2: Refactor optionTouch().
Diffstat (limited to 'engines/cge2')
-rw-r--r--engines/cge2/toolbar.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp
index 93b5c646da..3556ec72ca 100644
--- a/engines/cge2/toolbar.cpp
+++ b/engines/cge2/toolbar.cpp
@@ -47,13 +47,14 @@ namespace CGE2 {
// 0.1 is only for correct rounding at the 10th state.
void CGE2Engine::optionTouch(int opt, uint16 mask) {
+ bool notMuted = !ConfMan.getBool("mute");
switch (opt) {
case 1:
if (mask & kMouseLeftUp)
switchColorMode();
break;
case 2:
- if ((mask & kMouseLeftUp) && !ConfMan.getBool("mute")) {
+ if ((mask & kMouseLeftUp) && notMuted) {
switchMusic(_music = !_music);
switch (_music) {
@@ -74,11 +75,11 @@ void CGE2Engine::optionTouch(int opt, uint16 mask) {
quit();
break;
case 4:
- if ((mask & (kMouseLeftUp | kMouseRightUp)) && !ConfMan.getBool("mute"))
+ if ((mask & (kMouseLeftUp | kMouseRightUp)) && notMuted)
setVolume(opt - 4, (mask & kMouseLeftUp) ? 1 : -1);
break;
case 5:
- if ((mask & (kMouseLeftUp | kMouseRightUp)) && !ConfMan.getBool("mute"))
+ if ((mask & (kMouseLeftUp | kMouseRightUp)) && notMuted)
setVolume(opt - 4, (mask & kMouseLeftUp) ? 1 : -1);
break;
case 8:
@@ -86,7 +87,7 @@ void CGE2Engine::optionTouch(int opt, uint16 mask) {
switchCap();
break;
case 9:
- if ((mask & kMouseLeftUp) && !ConfMan.getBool("mute")) {
+ if ((mask & kMouseLeftUp) && notMuted) {
switchVox();
switch (_sayVox) {