[Scummvm-cvs-logs] CVS: scummvm/sound midiparser.cpp,1.11,1.12

Jamieson Christian jamieson630 at users.sourceforge.net
Sun Jun 1 11:34:05 CEST 2003


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv27997/scummvm/sound

Modified Files:
	midiparser.cpp 
Log Message:
Fixed hanging notes on Smart Jump when Note Off event cannot be found.
(I'm not sure why the Note Off would not be found,
but at least we're properly dealing with such notes now.)

Index: midiparser.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/midiparser.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- midiparser.cpp	25 May 2003 15:46:47 -0000	1.11
+++ midiparser.cpp	1 Jun 2003 18:24:10 -0000	1.12
@@ -276,7 +276,7 @@
 	// accounted for every active note.
 	uint32 advance_tick = _position._last_event_tick;
 	while (true) {
-		int i;
+		int i, j;
 		for (i = 0; i < 128; ++i)
 			if (_active_notes[i] != 0) break;
 		if (i == 128) break;
@@ -289,6 +289,12 @@
 			}
 		} else if (_next_event.event == 0xFF && _next_event.ext.type == 0x2F) {
 			// printf ("MidiParser::hangAllActiveNotes(): Hit End of Track with active notes left!\n");
+			for (i = 0; i < 128; ++i) {
+				for (j = 0; j < 16; ++j) {
+					if (_active_notes[i] & (1 << j))
+						_driver->send (0x80 | j | i << 8);
+				}
+			}
 			memset (_active_notes, 0, sizeof (_active_notes));
 			break;
 		}





More information about the Scummvm-git-logs mailing list