[Scummvm-cvs-logs] CVS: scummvm/scumm imuse.cpp,2.31,2.32

Jamieson Christian jamieson630 at users.sourceforge.net
Thu May 15 21:03:11 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv9147a/scummvm/scumm

Modified Files:
	imuse.cpp 
Log Message:
Fixed SysEx parse error, misc. cleanup

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 2.31
retrieving revision 2.32
diff -u -d -r2.31 -r2.32
--- imuse.cpp	16 May 2003 02:13:21 -0000	2.31
+++ imuse.cpp	16 May 2003 04:02:33 -0000	2.32
@@ -2089,6 +2089,7 @@
 
 	case 16: // Adlib instrument definition (Part)
 		a = *p++ & 0x0F;
+		++p; // Skip hardware type
 		part = get_part(a);
 		if (part) {
 			if (len == 63) {
@@ -2102,7 +2103,7 @@
 		break;
 
 	case 17: // Adlib instrument definition (Global)
-		p++;
+		p += 2; // Skip hardware type and... whatever came right before it
 		a = *p++;
 		decode_sysex_bytes(p, buf, len - 4);
 		_se->setGlobalAdlibInstrument (a, buf);
@@ -2110,6 +2111,7 @@
 
 	case 33: // Parameter adjust
 		a = *p++ & 0x0F;
+		++p; // Skip hardware type
 		decode_sysex_bytes(p, buf, len - 3);
 		part = get_part(a);
 		if (part)
@@ -3202,9 +3204,6 @@
 	_bank = 0;
 	_pedal = false;
 	_mc = NULL;
-
-	if (_instrument.isValid())
-		sendAll();
 }
 
 void Part::uninit() {
@@ -3235,8 +3234,7 @@
 
 bool Part::clearToTransmit() {
 	if (_mc) return true;
-	_player->_se->reallocateMidiChannels (_player->_midi);
-	if (_mc) sendAll();
+	if (_instrument.isValid()) _player->_se->reallocateMidiChannels (_player->_midi);
 	return false;
 }
 
@@ -3251,9 +3249,8 @@
 	_mc->modulationWheel (_modwheel);
 	_mc->panPosition (_pan_eff + 0x40);
 	_mc->effectLevel (_effect_level);
-	if (_instrument.isValid()) {
+	if (_instrument.isValid())
 		_instrument.send (_mc);
-	}
 	_mc->chorusLevel (_effect_level);
 	_mc->priority (_pri_eff);
 }





More information about the Scummvm-git-logs mailing list