[Scummvm-cvs-logs] SF.net SVN: scummvm:[50418] scummvm/trunk/engines/sci/sound/midiparser_sci. cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Mon Jun 28 12:48:10 CEST 2010


Revision: 50418
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50418&view=rev
Author:   m_kiewitz
Date:     2010-06-28 10:48:09 +0000 (Mon, 28 Jun 2010)

Log Message:
-----------
SCI: set volume all the time, fixes volume being 0 after fading in sci0

Modified Paths:
--------------
    scummvm/trunk/engines/sci/sound/midiparser_sci.cpp

Modified: scummvm/trunk/engines/sci/sound/midiparser_sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/midiparser_sci.cpp	2010-06-28 10:36:10 UTC (rev 50417)
+++ scummvm/trunk/engines/sci/sound/midiparser_sci.cpp	2010-06-28 10:48:09 UTC (rev 50418)
@@ -673,30 +673,28 @@
 	}
 
 	assert(volume <= MUSIC_VOLUME_MAX);
-	if (_volume != volume) {
-		_volume = volume;
+	_volume = volume;
 
-		switch (_soundVersion) {
-		case SCI_VERSION_0_EARLY:
-		case SCI_VERSION_0_LATE: {
-			// SCI0 adlib driver doesn't support channel volumes, so we need to go this way
-			// TODO: this should take the actual master volume into account
-			int16 globalVolume = _volume * 15 / 127;
-			((MidiPlayer *)_driver)->setVolume(globalVolume);
-			break;
-		}
+	switch (_soundVersion) {
+	case SCI_VERSION_0_EARLY:
+	case SCI_VERSION_0_LATE: {
+		// SCI0 adlib driver doesn't support channel volumes, so we need to go this way
+		// TODO: this should take the actual master volume into account
+		int16 globalVolume = _volume * 15 / 127;
+		((MidiPlayer *)_driver)->setVolume(globalVolume);
+		break;
+	}
 
-		case SCI_VERSION_1_EARLY:
-		case SCI_VERSION_1_LATE:
-			// Send previous channel volumes again to actually update the volume
-			for (int i = 0; i < 15; i++)
-				if (_channelRemap[i] != -1)
-					sendToDriver(0xB0 + i, 7, _channelVolume[i]);
-			break;
+	case SCI_VERSION_1_EARLY:
+	case SCI_VERSION_1_LATE:
+		// Send previous channel volumes again to actually update the volume
+		for (int i = 0; i < 15; i++)
+			if (_channelRemap[i] != -1)
+				sendToDriver(0xB0 + i, 7, _channelVolume[i]);
+		break;
 
-		default:
-			error("MidiParser_SCI::setVolume: Unsupported soundVersion");
-		}
+	default:
+		error("MidiParser_SCI::setVolume: Unsupported soundVersion");
 	}
 }
 


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