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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Jan 4 19:24:58 CET 2010


Revision: 46981
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46981&view=rev
Author:   thebluegr
Date:     2010-01-04 18:24:58 +0000 (Mon, 04 Jan 2010)

Log Message:
-----------
SCI/new music code: Fixed the code that handles mixed Adlib/MIDI mode, and added better comments on what it actually does

Modified Paths:
--------------
    scummvm/trunk/engines/sci/sfx/music.cpp
    scummvm/trunk/engines/sci/sfx/music.h

Modified: scummvm/trunk/engines/sci/sfx/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.cpp	2010-01-04 18:10:45 UTC (rev 46980)
+++ scummvm/trunk/engines/sci/sfx/music.cpp	2010-01-04 18:24:58 UTC (rev 46981)
@@ -307,20 +307,17 @@
 		track = pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_MT32);
 		break;
 	default:
+		// Should never occur
+		error("soundInitSnd: Unknown MIDI type");
 		break;
 	}
 
-	// attempting to select default MT-32/Roland track
-	if (!track)
-		track = pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_MT32);
 	if (track) {
-		// if MIDI device is selected but there is no digital track in sound resource
+		// If MIDI device is selected but there is no digital track in sound resource
 		// try to use adlib's digital sample if possible
-		if (_midiType <= MD_MT32 && track->digitalChannelNr == -1 && _bMultiMidi) {
-			if (pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_ADLIB)->digitalChannelNr != -1)
-				track = pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_ADLIB);
-		}
-		// play digital sample
+		if (_bMultiMidi && pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_ADLIB)->digitalChannelNr != -1)
+			track = pSnd->soundRes->getTrackByType(SoundResource::TRACKTYPE_ADLIB);
+		// Play digital sample
 		if (track->digitalChannelNr != -1) {
 			byte *channelData = track->channels[track->digitalChannelNr].data;
 			delete pSnd->pStreamAud;

Modified: scummvm/trunk/engines/sci/sfx/music.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.h	2010-01-04 18:10:45 UTC (rev 46980)
+++ scummvm/trunk/engines/sci/sfx/music.h	2010-01-04 18:24:58 UTC (rev 46981)
@@ -203,7 +203,9 @@
 	MidiDriverType _midiType;
 
 	uint32 _dwTempo;
-	bool _bMultiMidi; // use adlib's digital track if midi track don't have one
+	// Mixed Adlib/MIDI mode: when enabled from the ScummVM sound options screen,
+	// and a sound has a digital track, the sound from the Adlib track is played
+	bool _bMultiMidi;
 private:
 	static void miditimerCallback(void *p);
 


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