[Scummvm-cvs-logs] CVS: scummvm/scumm imuse.cpp,1.61,1.62 imuse.h,1.14,1.15 sound.cpp,1.33,1.34

Pawe? Ko?odziejski aquadran at users.sourceforge.net
Wed Oct 16 01:00:03 CEST 2002


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

Modified Files:
	imuse.cpp imuse.h sound.cpp 
Log Message:
fixes to imuse

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- imuse.cpp	15 Oct 2002 21:55:01 -0000	1.61
+++ imuse.cpp	16 Oct 2002 07:59:11 -0000	1.62
@@ -4998,7 +4998,7 @@
 	memset(_channel, 0, sizeof(channel) * MAX_DIGITAL_CHANNELS);
 	_scumm = scumm;
 	for (int32 l = 0; l < MAX_DIGITAL_CHANNELS; l++) {
-		_channel[l]._mixerTrack = -1;
+		_channel[l]._initialized = false;
 	}
 	_scumm->_mixer->beginSlots(MAX_DIGITAL_CHANNELS + 1);
 	_scumm->_timer->installProcedure(imus_digital_handler, 200);
@@ -5411,8 +5411,12 @@
 	for (l = 0; l < MAX_DIGITAL_CHANNELS;l ++) {
 		if (_channel[l]._used) {
 			if (_channel[l]._toBeRemoved == true) {
-				_channel[l]._used = false;
-				free(_channel[l]._data);
+				_scumm->_mixer->stop(l);
+				if (_scumm->_mixer->_channels[l] == NULL) {
+					free(_channel[l]._data);
+					_channel[l]._used = false;
+					_channel[l]._initialized = false;
+				}
 				continue;
 			}
 
@@ -5457,10 +5461,9 @@
 			uint32 new_size = _channel[l]._mixerSize;
 			uint32 mixer_size = new_size;
 
-			if (_channel[l]._mixerTrack == -1) {
+			if (_channel[l]._initialized == false) {
 				mixer_size *= 2;
 				new_size *= 2;
-			} else {
 			}
 
 			if (_channel[l]._isJump == false) {
@@ -5481,7 +5484,7 @@
 			}
 
 			byte *buf = (byte*)malloc(mixer_size);
-			
+
 			memcpy(buf, _channel[l]._data + _channel[l]._offset, new_size);
 			if ((new_size != mixer_size) && (_channel[l]._isJump == true)) {
 				memcpy(buf + new_size, _channel[l]._data + _channel[l]._jump[0]._dest, mixer_size - new_size);
@@ -5513,12 +5516,12 @@
 				}
 			}
 
-			if (_channel[l]._mixerTrack == -1) {
-				_channel[l]._mixerTrack = _scumm->_mixer->playStream(NULL, l, buf, mixer_size,
-																				 _channel[l]._freq, _channel[l]._mixerFlags, -1, 800000);
+			if (_channel[l]._initialized == false) {
+				_scumm->_mixer->playStream(NULL, l, buf, mixer_size,
+																				 _channel[l]._freq, _channel[l]._mixerFlags, 3, 2000000);
+				_channel[l]._initialized = true;
 			} else {
-				_scumm->_mixer->append(l, buf, mixer_size,
-															 _channel[l]._freq, _channel[l]._mixerFlags);
+				_scumm->_mixer->append(l, buf, mixer_size, _channel[l]._freq, _channel[l]._mixerFlags);
 			}
 		}
 	}
@@ -5624,10 +5627,10 @@
 					if (tag == MKID_BE('DATA')) break;
 				}
 
-				if ((sound == 123) || (sound == 122)) {
+//				if ((sound == 131) || (sound == 123) || (sound == 122)) {
 					_channel[l]._isJump = false;
 					_channel[l]._numJumps = 0;
-				}
+//				}
 
 				uint32 header_size = ptr - s_ptr;
 				_channel[l]._offsetStop -= header_size;

Index: imuse.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- imuse.h	15 Oct 2002 21:55:02 -0000	1.14
+++ imuse.h	16 Oct 2002 07:59:11 -0000	1.15
@@ -105,7 +105,7 @@
 		uint8 _mixerFlags;
 		bool _used;
 		bool _toBeRemoved;
-		int32 _mixerTrack;
+		bool _initialized;
 	} _channel[MAX_DIGITAL_CHANNELS];
 
 	Scumm * _scumm;

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- sound.cpp	15 Oct 2002 21:55:02 -0000	1.33
+++ sound.cpp	16 Oct 2002 07:59:11 -0000	1.34
@@ -943,7 +943,9 @@
 	if (_musicBundleToBeRemoved == true) {
 		_scumm->_timer->releaseProcedure(&music_handler);
 		_nameBundleMusic = NULL;
-		_scumm->_mixer->stop(_bundleMusicTrack);
+		if (_bundleMusicTrack != -1) {
+			_scumm->_mixer->stop(_bundleMusicTrack);
+		}
 		_bundleMusicTrack = -1;
 		if (_musicBundleBufFinal) {
 			free(_musicBundleBufFinal);
@@ -1034,7 +1036,7 @@
 
 	if (_bundleMusicTrack == -1) {
 		_bundleMusicTrack = _scumm->_mixer->playStream(NULL, _scumm->_mixer->_beginSlots - 1, buffer, final_size, rate,
-															SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO, -1, 800000);
+															SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO, -1, 2000000);
 	} else {
 		_scumm->_mixer->append(_bundleMusicTrack, buffer, final_size, rate,
 														SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO);





More information about the Scummvm-git-logs mailing list