[Scummvm-cvs-logs] CVS: scummvm/scumm imuse_player.cpp,2.57,2.58

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Thu Oct 13 08:35:11 CEST 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11935

Modified Files:
	imuse_player.cpp 
Log Message:
It should not be a fatal error if allocate_part() fails. As far as I 
understand, it just means that the currently active parts are too important
(i.e. have too high priority) to throw out for this new one.

This makes bugs #1325060 and #1325487 less severe.


Index: imuse_player.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_player.cpp,v
retrieving revision 2.57
retrieving revision 2.58
diff -u -d -r2.57 -r2.58
--- imuse_player.cpp	1 Oct 2005 03:29:25 -0000	2.57
+++ imuse_player.cpp	13 Oct 2005 15:33:56 -0000	2.58
@@ -775,7 +775,7 @@
 
 	part = _se->allocate_part(_priority, _midi);
 	if (!part) {
-		error("no parts available");
+		debug(1, "No parts available");
 		return NULL;
 	}
 
@@ -869,10 +869,12 @@
 
 	for (i = 0; i < 16; ++i) {
 		part = getPart(i);
-		mask = 1 << i;
-		for (j = 0; j < 128; ++j) {
-			if (_active_notes[j] & mask)
-				part->noteOn(j, 80);
+		if (part) {
+			mask = 1 << i;
+			for (j = 0; j < 128; ++j) {
+				if (_active_notes[j] & mask)
+					part->noteOn(j, 80);
+			}
 		}
 	}
 }





More information about the Scummvm-git-logs mailing list