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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Jan 27 22:11:43 CET 2010


Revision: 47610
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47610&view=rev
Author:   thebluegr
Date:     2010-01-27 21:11:24 +0000 (Wed, 27 Jan 2010)

Log Message:
-----------
Fixed the demo version of Longbow - speech was not played at all with the new sound code

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

Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/music.cpp	2010-01-27 20:55:35 UTC (rev 47609)
+++ scummvm/trunk/engines/sci/sound/music.cpp	2010-01-27 21:11:24 UTC (rev 47610)
@@ -170,15 +170,15 @@
 	int channelFilterMask = 0;
 	SoundResource::Track *track = pSnd->soundRes->getTrackByType(_pMidiDrv->getPlayId());
 
+	// If MIDI device is selected but there is no digital track in sound resource
+	// try to use adlib's digital sample if possible
+	if (_bMultiMidi && (!track || track->digitalChannelNr == -1)) {
+		SoundResource::Track *digital = pSnd->soundRes->getDigitalTrack();
+		if (digital)
+			track = digital;
+	}
+
 	if (track) {
-		// If MIDI device is selected but there is no digital track in sound resource
-		// try to use adlib's digital sample if possible
-		if (_bMultiMidi && (track->digitalChannelNr == -1)) {
-			SoundResource::Track *digital = pSnd->soundRes->getDigitalTrack();
-			if (digital)
-				track = digital;
-		}
-
 		// Play digital sample
 		if (track->digitalChannelNr != -1) {
 			byte *channelData = track->channels[track->digitalChannelNr].data;

Modified: scummvm/trunk/engines/sci/sound/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/soundcmd.cpp	2010-01-27 20:55:35 UTC (rev 47609)
+++ scummvm/trunk/engines/sci/sound/soundcmd.cpp	2010-01-27 21:11:24 UTC (rev 47610)
@@ -286,6 +286,11 @@
 
 #else
 
+	// Check if a track with the same sound object is already playing
+	MusicEntry *oldSound = _music->getSlot(obj);
+	if (oldSound)
+		cmdDisposeSound(obj, value);
+
 	MusicEntry *newSound = new MusicEntry();
 	newSound->resnum = number;
 	if (number && _resMan->testResource(ResourceId(kResourceTypeSound, number)))
@@ -299,11 +304,6 @@
 	if (_soundVersion >= SCI_VERSION_1_LATE)
 		newSound->volume = CLIP<int>(GET_SEL32V(_segMan, obj, vol), 0, MUSIC_VOLUME_MAX);
 
-	// Check if a track with the same sound object is already playing
-	MusicEntry *oldSound = _music->getSlot(obj);
-	if (oldSound)
-		cmdDisposeSound(obj, value);
-
 	// In SCI1.1 games, sound effects are started from here. If we can find
 	// a relevant audio resource, play it, otherwise switch to synthesized
 	// effects. If the resource exists, play it using map 65535 (sound


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