[Scummvm-cvs-logs] CVS: scummvm insane.cpp,1.53,1.54 smush.h,1.12,1.13

Pawe? Ko?odziejski aquadran at users.sourceforge.net
Mon Aug 12 00:07:01 CEST 2002


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

Modified Files:
	insane.cpp smush.h 
Log Message:
smush: update sync

Index: insane.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/insane.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- insane.cpp	8 Aug 2002 21:54:49 -0000	1.53
+++ insane.cpp	12 Aug 2002 07:06:07 -0000	1.54
@@ -31,8 +31,6 @@
 #include "scumm.h"
 #include "smush.h"
 
-#define MAX_STREAMER 10
-
 static SmushPlayer * h_sp;
 
 SmushPlayer::SmushPlayer(Scumm * parent) {
@@ -597,14 +595,10 @@
 			debug(3, "trk %d: iMUSE play part, len 0x%x rate %d remain 0x%x",
 						trk, bpos, _imusRate[idx], _imusSubSize[idx]);
 
-			if (new_mixer) {
-				g_mixer->play_stream(NULL, idx, buf, bpos, _imusRate[idx], flags);
-			} else {
-				g_mixer->append(idx, buf, bpos, _imusRate[idx], flags);
-			}
-
-			/* FIXME: append with re-used idx may cause problems
-			   with signed/unsigned issues */
+			_imusBuf[idx] = buf;
+			_imusFinalSize[idx] = bpos;
+			_imusFlags[idx] = flags;
+			_imusNewMixer[idx] = new_mixer;
 
 			break;
 		default:
@@ -1254,13 +1248,9 @@
 
 			debug(3, "trk %d: SDAT part len 0x%x rate %d", trk, sublen, _strkRate[idx]);
 
-			if (new_mixer) {
-				g_mixer->play_stream(NULL, idx, buf, sublen, _strkRate[idx],
-																		 SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
-			} else {
-				g_mixer->append(idx, buf, sublen,
-																_strkRate[idx], SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
-			}
+			_strkBuf[idx] = buf;
+			_strkFinalSize[idx] = sublen;
+			_strkNewMixer[idx] = new_mixer;
 			break;
 		case 'SMRK':
 			_psadTrk[idx] = 0;
@@ -1377,7 +1367,7 @@
 		loadTres();
 		loadFonts();
 	}
-	_scumm->_timer->installProcedure(&smush_handler, 83);
+	_scumm->_timer->installProcedure(&smush_handler, 75);
 }
 
 void SmushPlayer::deinit() {
@@ -1423,6 +1413,7 @@
 
 void SmushPlayer::startVideo(short int arg, byte *videoFile) {
 	int32 frameIndex = 0;
+	int32 idx;
 
 	_in = NULL;
 	_paletteChanged = false;
@@ -1467,6 +1458,35 @@
 		parseTag();
 		frameIndex++;
 
+		do {
+			_scumm->waitForTimer(1);
+		} while (_lock);
+		_lock = true;
+
+		if (_scumm->_gameId == GID_DIG) {
+			for (idx = 0; idx < MAX_STREAMER; idx++) {
+				if (_imusTrk[idx] != 0) {
+					if (_imusNewMixer[idx]) {
+						g_mixer->play_stream(NULL, idx, _imusBuf[idx], _imusFinalSize[idx], _imusRate[idx], _imusFlags[idx]);
+					} else {
+						g_mixer->append(idx, _imusBuf[idx], _imusFinalSize[idx], _imusRate[idx], _imusFlags[idx]);
+					}
+        		}
+			}
+		}
+
+		if (_scumm->_gameId == GID_FT) {
+			for (idx = 0; idx < MAX_STREAMER; idx++) {
+				if (_psadTrk[idx] != 0) {
+					if (_strkNewMixer) {
+						g_mixer->play_stream(NULL, idx, _strkBuf[idx], _strkFinalSize[idx], _strkRate[idx], SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+					} else {
+						g_mixer->append(idx, _strkBuf[idx], _strkFinalSize[idx], _strkRate[idx], SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+					}
+				}
+			}
+		}
+
 		if (_paletteChanged) {
 			_paletteChanged = false;
 			setPalette();
@@ -1477,11 +1497,6 @@
 			_scumm->_system->copy_rect(_scumm->_videoBuffer, 320, 0, 0, 320, 200);
 			_scumm->_system->update_screen();
 		}
-
-		do {
-			_scumm->waitForTimer(10);
-		} while (_lock);
-		_lock = true;
 
 		_scumm->processKbd();
 

Index: smush.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/smush.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- smush.h	8 Aug 2002 21:54:49 -0000	1.12
+++ smush.h	12 Aug 2002 07:06:08 -0000	1.13
@@ -21,6 +21,7 @@
  */
 
 #define SP_MAX_FONTS 5
+#define MAX_STREAMER 10
 
 class SmushPlayer {
 
@@ -72,16 +73,23 @@
 		int32 _mixerNum;
 
 		// PSAD: Full Throttle audio
-		uint32 _saudSize[8], _saudSubSize[8];
-		uint32 _psadTrk[8], _strkRate[8];
-		uint32 _saudSubTag[8];
+		uint32 _saudSize[MAX_STREAMER], _saudSubSize[MAX_STREAMER];
+		uint32 _psadTrk[MAX_STREAMER], _strkRate[MAX_STREAMER];
+		uint32 _saudSubTag[MAX_STREAMER];
+		uint32 _strkFinalSize[MAX_STREAMER];
+		bool _strkNewMixer[MAX_STREAMER];
+		byte * _strkBuf[MAX_STREAMER];
 
 		// IACT: The Dig audio
-		uint32 _imusSize[8], _imusSubSize[8];
-		uint32 _imusTrk[8], _imusRate[8], _imusChan[8];
-		uint32 _imusSubTag[8];
-		byte _imusData[8][3];
-		uint32 _imusPos[8], _imusCodec[8];
+		uint32 _imusSize[MAX_STREAMER], _imusSubSize[MAX_STREAMER];
+		uint32 _imusTrk[MAX_STREAMER], _imusRate[MAX_STREAMER], _imusChan[MAX_STREAMER];
+		uint32 _imusSubTag[MAX_STREAMER];
+		byte _imusData[MAX_STREAMER][3];
+		uint32 _imusPos[MAX_STREAMER], _imusCodec[MAX_STREAMER];
+		uint32 _imusFinalSize[MAX_STREAMER];
+		byte _imusFlags[MAX_STREAMER];
+		byte * _imusBuf[MAX_STREAMER];
+		bool _imusNewMixer[MAX_STREAMER];
 
 		// Codec37
 		PersistentCodecData37 pcd37;





More information about the Scummvm-git-logs mailing list