[Scummvm-cvs-logs] SF.net SVN: scummvm:[51218] scummvm/trunk/engines/sword2/sword2.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Fri Jul 23 21:52:58 CEST 2010


Revision: 51218
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51218&view=rev
Author:   eriktorbjorn
Date:     2010-07-23 19:52:58 +0000 (Fri, 23 Jul 2010)

Log Message:
-----------
SWORD2: Improve sync between local and global "mute" settings

Broken Sword 2's options dialog allows you to mute any of speech, sound
and sound effects, whereas ScummVM's options dialog just has one
"master" mute setting. This is an attempt to keep them better in sync,
though it's not perfect. Still, it may be good enough to fix bug
#3032763 ("SWORD2: Mute setting does not work").

Modified Paths:
--------------
    scummvm/trunk/engines/sword2/sword2.cpp

Modified: scummvm/trunk/engines/sword2/sword2.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sword2.cpp	2010-07-23 19:36:47 UTC (rev 51217)
+++ scummvm/trunk/engines/sword2/sword2.cpp	2010-07-23 19:52:58 UTC (rev 51218)
@@ -326,12 +326,20 @@
 }
 
 void Sword2Engine::syncSoundSettings() {
-	// Sound settings. At the time of writing, not all of these can be set
-	// by the global options dialog, but it seems silly to split them up.
 	_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
 	_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
 	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
 	setSubtitles(ConfMan.getBool("subtitles"));
+
+	// Our own settings dialog can mute the music, speech and sound effects
+	// individually. ScummVM's settings dialog has one master mute setting.
+
+	if (ConfMan.getBool("mute")) {
+		ConfMan.setBool("music_mute", true);
+		ConfMan.setBool("speech_mute", true);
+		ConfMan.setBool("sfx_mute", true);
+	}
+
 	_sound->muteMusic(ConfMan.getBool("music_mute"));
 	_sound->muteSpeech(ConfMan.getBool("speech_mute"));
 	_sound->muteFx(ConfMan.getBool("sfx_mute"));
@@ -356,6 +364,13 @@
 	ConfMan.setBool("object_labels", _mouse->getObjectLabels());
 	ConfMan.setInt("reverse_stereo", _sound->isReverseStereo());
 
+	// If even one sound type is unmuted, we can't say that all sound is
+	// muted.
+
+	if (!_sound->isMusicMute() || !_sound->isSpeechMute() || !_sound->isFxMute()) {
+		ConfMan.setBool("mute", false);
+	}
+
 	ConfMan.flushToDisk();
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list