[Scummvm-cvs-logs] CVS: scummvm insane.cpp,1.35,1.36

James Brown ender at users.sourceforge.net
Wed Jun 26 03:21:03 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv7479

Modified Files:
	insane.cpp 
Log Message:
Hacks to make SMUSH mixer a bit more tollerable.



Index: insane.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/insane.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- insane.cpp	2 Jun 2002 20:30:21 -0000	1.35
+++ insane.cpp	26 Jun 2002 10:20:56 -0000	1.36
@@ -28,6 +28,7 @@
 #include "scumm.h"
 
 #define SWAP2(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000))
+#define MAX_STREAMER 10
 
 void invalidblock(uint32 tag)
 {
@@ -144,15 +145,13 @@
 	trk = READ_LE_UINT32(_cur + pos); /* FIXME: is this correct ? */
 	pos += 4;
 
-	/* FIXME: number 8 should be replaced with a sensible literal */
-
-	for (idx = 0; idx < 8; idx++) {
+	for (idx = 0; idx < MAX_STREAMER; idx++) {
 		if (_imusTrk[idx] == trk)
 			break;
 	}
 
-	if (idx == 8) {
-		for (idx = 0; idx < 8; idx++) {
+	if (idx == MAX_STREAMER) {
+		for (idx = 0; idx < MAX_STREAMER; idx++) {			
 			if (_imusTrk[idx] == 0 &&
 			    g_scumm->_mixer->_channels[idx] == NULL) {
 				_imusTrk[idx] = trk;
@@ -163,8 +162,8 @@
 		}
 	}
 
-	if (idx == 8) {
-		warning("iMUS table full ");
+	if (idx == MAX_STREAMER) {
+		warning("iMUS table full");
 		return;
 	}
 
@@ -797,15 +796,13 @@
 	trk = READ_LE_UINT16(_cur + pos); /* FIXME: is this correct ? */
 	pos += 2;
 
-	/* FIXME: number 8 should be replaced with a sensible literal */
-
-	for (idx = 0; idx < 8; idx++) {
+	for (idx = 0; idx < MAX_STREAMER; idx++) {
 		if (_psadTrk[idx] == trk)
 			break;
 	}
 
-	if (idx == 8) {
-		for (idx = 0; idx < 8; idx++) {
+	if (idx == MAX_STREAMER) {
+		for (idx = 0; idx < MAX_STREAMER; idx++) {
 			if (_psadTrk[idx] == 0 &&
 			    g_scumm->_mixer->_channels[idx] == NULL) {
 				_psadTrk[idx] = trk;
@@ -816,7 +813,7 @@
 		}
 	}
 
-	if (idx == 8) {
+	if (idx == MAX_STREAMER) {
 		warning("PSAD table full\n");
 		return;
 	}





More information about the Scummvm-git-logs mailing list