aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2014-08-13 21:16:20 +0200
committeruruk2014-08-13 21:16:20 +0200
commit12a894a803bc183e0cae52144d0b01c08a189d78 (patch)
tree9282ee516535c8b864d0da8bd5feb97fc7d00e1d /engines
parentd7a9ea9e2a3e29dd99872fff567bbab7f304568c (diff)
downloadscummvm-rg350-12a894a803bc183e0cae52144d0b01c08a189d78.tar.gz
scummvm-rg350-12a894a803bc183e0cae52144d0b01c08a189d78.tar.bz2
scummvm-rg350-12a894a803bc183e0cae52144d0b01c08a189d78.zip
CGE2: Add checkMute().
This keeps the "Mute All" option of ScummVM and the music on/off and speech on/off buttons of Sfinx's toolbar in sync.
Diffstat (limited to 'engines')
-rw-r--r--engines/cge2/cge2.cpp4
-rw-r--r--engines/cge2/cge2.h2
-rw-r--r--engines/cge2/cge2_main.cpp1
-rw-r--r--engines/cge2/toolbar.cpp10
4 files changed, 15 insertions, 2 deletions
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp
index 59d9fa9cbe..0a3d65a31d 100644
--- a/engines/cge2/cge2.cpp
+++ b/engines/cge2/cge2.cpp
@@ -99,9 +99,9 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription)
_sayCap = ConfMan.getBool("subtitles");
_sayVox = !ConfMan.getBool("speech_mute");
- if (ConfMan.getBool("mute")) {
+ if (_muteAll = ConfMan.getBool("mute")) {
_oldMusicVolume = _oldSfxVolume = 0;
- _music = false;
+ _music = _sayVox = false;
} else {
_oldMusicVolume = ConfMan.getInt("music_volume");
_oldSfxVolume = ConfMan.getInt("sfx_volume");
diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h
index 4750d4a996..8e94683824 100644
--- a/engines/cge2/cge2.h
+++ b/engines/cge2/cge2.h
@@ -225,6 +225,7 @@ public:
void switchSay();
void initToolbar();
void initVolumeSwitch(Sprite *volSwitch, int val);
+ void checkMute();
void checkSounds();
@@ -306,6 +307,7 @@ public:
int _oldMusicVolume;
int _oldSfxVolume;
bool _music;
+ bool _muteAll;
ResourceManager *_resman;
Vga *_vga;
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp
index bb12c52746..c52a354f9e 100644
--- a/engines/cge2/cge2_main.cpp
+++ b/engines/cge2/cge2_main.cpp
@@ -540,6 +540,7 @@ void CGE2Engine::mainLoop() {
}
void CGE2Engine::checkSounds() {
+ checkMute();
_sound->checkSoundHandles();
checkVolumeSwitches();
_midiPlayer->syncVolume();
diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp
index 2b7604a447..dbbed3480e 100644
--- a/engines/cge2/toolbar.cpp
+++ b/engines/cge2/toolbar.cpp
@@ -212,4 +212,14 @@ void CGE2Engine::initVolumeSwitch(Sprite *volSwitch, int val) {
volSwitch->step(state);
}
+void CGE2Engine::checkMute() {
+ bool mute = ConfMan.getBool("mute");
+ bool mutedChanged = mute != _muteAll;
+ if (mutedChanged) {
+ switchMusic();
+ switchVox();
+ _muteAll = mute;
+ }
+}
+
} // End of namespace CGE2