[Scummvm-cvs-logs] CVS: scummvm/scumm imuse.cpp,2.3,2.4 instrument.cpp,2.2,2.3 instrument.h,2.1,2.2

Jamieson Christian jamieson630 at users.sourceforge.net
Wed Dec 18 09:17:19 CET 2002


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

Modified Files:
	imuse.cpp instrument.cpp instrument.h 
Log Message:
Miscellaneous cleanup.

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 2.3
retrieving revision 2.4
diff -u -d -r2.3 -r2.4
--- imuse.cpp	18 Dec 2002 14:57:25 -0000	2.3
+++ imuse.cpp	18 Dec 2002 17:14:04 -0000	2.4
@@ -963,10 +963,12 @@
 		}
 	}
 
-	if (best)
+	if (best) {
 		best->uninit();
-	else
+		_driver->update_pris();
+	} else {
 		debug(1, "Denying part request");
+	}
 	return best;
 }
 
@@ -2165,8 +2167,10 @@
 				part->set_vol ((p[5] & 0x0F) << 4 | (p[6] & 0x0F));
 				part->_percussion = _isGM ? ((p[9] & 0x08) > 0) : false;
 				if (part->_percussion) {
-					if (part->_mc)
+					if (part->_mc) {
 						part->off();
+						part->update_pris();
+					}
 				} else {
 					part->changed (IMuseDriver::pcAll);
 				}
@@ -2837,6 +2841,7 @@
 
 	for (part = _parts; part; part = part->_next)
 		part->off();
+	_se->_driver->update_pris();
 }
 
 void Player::play_active_notes()
@@ -3317,8 +3322,10 @@
 	_pitchbend_factor = 2;
 	_pitchbend = 0;
 	_effect_level = 64;
-	_program = player->_se->get_channel_program (_chan);
-	_instrument.program (_program, player->_mt32emulate);
+//	_program = player->_se->get_channel_program (_chan);
+//	_instrument.program (_program, player->_mt32emulate);
+	_program = 255;
+	_instrument.clear();
 	_chorus = 0;
 	_modwheel = 0;
 	_bank = 0;
@@ -3633,26 +3640,23 @@
 		if (!hipart)
 			return;
 
-		if ((hipart->_mc = _md->allocateChannel()) != NULL) {
-			hipart->changed (pcAll);
-			return;
-		}
-
-		lopri = 255;
-		lopart = NULL;
-		for (i = 32, part = _se->parts_ptr(); i; i--, part++) {
-			if (part->_mc && part->_pri_eff <= lopri) {
-				lopri = part->_pri_eff;
-				lopart = part;
+		if ((hipart->_mc = _md->allocateChannel()) == NULL) {
+			lopri = 255;
+			lopart = NULL;
+			for (i = 32, part = _se->parts_ptr(); i; i--, part++) {
+				if (part->_mc && part->_pri_eff <= lopri) {
+					lopri = part->_pri_eff;
+					lopart = part;
+				}
 			}
-		}
 
-		if (lopart == NULL || lopri >= hipri)
-			return;
-		lopart->off();
+			if (lopart == NULL || lopri >= hipri)
+				return;
+			lopart->off();
 
-		if ((hipart->_mc = _md->allocateChannel()) == NULL)
-			return;
+			if ((hipart->_mc = _md->allocateChannel()) == NULL)
+				return;
+		}
 		hipart->changed(pcAll);
 	}
 }
@@ -3696,9 +3700,8 @@
 	MidiChannel *mc;
 
 	// Mark for re-schedule if program changed when in pre-state
-	if (what & pcProgram && !part->_percussion && !part->_mc) {
+	if (what & pcProgram && !part->_mc && part->_on && !part->_percussion)
 		update_pris();
-	}
 
 	if (!(mc = part->_mc))
 		return;

Index: instrument.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/instrument.cpp,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -d -r2.2 -r2.3
--- instrument.cpp	18 Dec 2002 13:53:51 -0000	2.2
+++ instrument.cpp	18 Dec 2002 17:14:05 -0000	2.3
@@ -25,8 +25,6 @@
 #include "scumm/instrument.h"
 #include "sound/mididrv.h"
 
-#define NATIVE_MT32 false
-
 static const byte mt32_to_gm[128] = {
 //    0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F
 	  0,   1,   0,   2,   4,   4,   5,   3,  16,  17,  18,  16,  16,  19,  20,  21, // 0x

Index: instrument.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/instrument.h,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -d -r2.1 -r2.2
--- instrument.h	18 Dec 2002 13:22:39 -0000	2.1
+++ instrument.h	18 Dec 2002 17:14:05 -0000	2.2
@@ -25,6 +25,8 @@
 #include "stdafx.h"
 #include "common/scummsys.h"
 
+#define NATIVE_MT32 false
+
 class Serializer;
 class MidiChannel;
 





More information about the Scummvm-git-logs mailing list