[Scummvm-cvs-logs] SF.net SVN: scummvm:[52826] scummvm/branches/branch-1-2-0/engines/sword2/ sword2.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Mon Sep 20 22:32:50 CEST 2010


Revision: 52826
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52826&view=rev
Author:   sev
Date:     2010-09-20 20:32:50 +0000 (Mon, 20 Sep 2010)

Log Message:
-----------
SWORD2: backport more safeguards for mute setting

Modified Paths:
--------------
    scummvm/branches/branch-1-2-0/engines/sword2/sword2.cpp

Modified: scummvm/branches/branch-1-2-0/engines/sword2/sword2.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sword2/sword2.cpp	2010-09-20 20:31:56 UTC (rev 52825)
+++ scummvm/branches/branch-1-2-0/engines/sword2/sword2.cpp	2010-09-20 20:32:50 UTC (rev 52826)
@@ -326,9 +326,11 @@
 }
 
 void Sword2Engine::syncSoundSettings() {
-	_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"));
+	bool mute = ConfMan.getBool("mute");
+
+	_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, mute ? 0 : ConfMan.getInt("music_volume"));
+	_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, mute ? 0 : ConfMan.getInt("speech_volume"));
+	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, mute ? 0 : ConfMan.getInt("sfx_volume"));
 	setSubtitles(ConfMan.getBool("subtitles"));
 
 	// Our own settings dialog can mute the music, speech and sound effects
@@ -339,7 +341,7 @@
 		ConfMan.setBool("speech_mute", ConfMan.getBool("mute"));
 		ConfMan.setBool("sfx_mute", ConfMan.getBool("mute"));
 
-		if (!ConfMan.getBool("mute")) // it is false
+		if (!mute) // it is false
 			// So remove it in order to let individual volumes work
 			ConfMan.removeKey("mute", ConfMan.getActiveDomainName());
 	}


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