[Scummvm-cvs-logs] scummvm master -> 12a894a803bc183e0cae52144d0b01c08a189d78

urukgit urukgit at users.noreply.github.com
Wed Aug 13 21:20:32 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
12a894a803 CGE2: Add checkMute().


Commit: 12a894a803bc183e0cae52144d0b01c08a189d78
    https://github.com/scummvm/scummvm/commit/12a894a803bc183e0cae52144d0b01c08a189d78
Author: uruk (koppirnyo at gmail.com)
Date: 2014-08-13T21:16:20+02:00

Commit Message:
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.

Changed paths:
    engines/cge2/cge2.cpp
    engines/cge2/cge2.h
    engines/cge2/cge2_main.cpp
    engines/cge2/toolbar.cpp



diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp
index 59d9fa9..0a3d65a 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 4750d4a..8e94683 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 bb12c52..c52a354 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 2b7604a..dbbed34 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






More information about the Scummvm-git-logs mailing list