[Scummvm-cvs-logs] SF.net SVN: scummvm: [20721] scummvm/trunk/engines/scumm/he

kirben at users.sourceforge.net kirben at users.sourceforge.net
Thu Feb 16 00:26:04 CET 2006


Revision: 20721
Author:   kirben
Date:     2006-02-16 00:25:12 -0800 (Thu, 16 Feb 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20721&view=rev

Log Message:
-----------
Send sound resource data directly to sound mixer in HE Games.\n Fixes songs in kitchen of Pajama Sam 1

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/resource_he.cpp
    scummvm/trunk/engines/scumm/he/sound_he.cpp
Modified: scummvm/trunk/engines/scumm/he/resource_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/resource_he.cpp	2006-02-16 06:00:46 UTC (rev 20720)
+++ scummvm/trunk/engines/scumm/he/resource_he.cpp	2006-02-16 08:25:12 UTC (rev 20721)
@@ -1806,8 +1806,6 @@
 }
 
 void ScummEngine_v80he::createSound(int snd1id, int snd2id) {
-	debug(0, "createSound: snd1id %d snd2id %d", snd1id, snd2id);
-
 	byte *snd1Ptr, *snd2Ptr;
 	byte *sbng1Ptr, *sbng2Ptr;
 	byte *sdat1Ptr, *sdat2Ptr;
@@ -1891,7 +1889,6 @@
 	sdat1size = READ_BE_UINT32(sdat1Ptr + 4) - 8 - _sndPtrOffs;
 	sdat2size = READ_BE_UINT32(sdat2Ptr + 4) - 8;
 
-	debug(0, "SDAT size1 %d size2 %d", sdat1size, sdat2size);
 	if (sdat2size < sdat1size) {
 		src = sdat2Ptr + 8;
 		dst = sdat1Ptr + 8 + _sndPtrOffs;

Modified: scummvm/trunk/engines/scumm/he/sound_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-02-16 06:00:46 UTC (rev 20720)
+++ scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-02-16 08:25:12 UTC (rev 20721)
@@ -331,7 +331,6 @@
 
 void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) {
 	byte *ptr, *spoolPtr;
-	char *sound;
 	int size = -1;
 	int priority, rate;
 	byte flags = Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE;
@@ -404,6 +403,7 @@
 	if (READ_UINT32(ptr) == MKID('RIFF') || READ_UINT32(ptr) == MKID('WSOU')) {
 		uint16 type;
 		int blockAlign;
+		char *sound;
 
 		if (READ_UINT32(ptr) == MKID('WSOU'))
 			ptr += 8;
@@ -467,11 +467,8 @@
 			_overrideFreq = 0;
 		}
 
-		// Allocate a sound buffer, copy the data into it, and play
-		sound = (char *)malloc(size);
-		memcpy(sound, ptr + heOffset + 8, size);
 		_vm->_mixer->stopHandle(_heSoundChannels[heChannel]);
-		_vm->_mixer->playRaw(&_heSoundChannels[heChannel], sound, size, rate, flags, soundID);
+		_vm->_mixer->playRaw(&_heSoundChannels[heChannel], ptr + heOffset + 8, size, rate, flags, soundID);
 
 		_vm->setHETimer(heChannel + 4);
 		_heChannel[heChannel].sound = soundID;
@@ -491,12 +488,9 @@
 
 		flags = Audio::Mixer::FLAG_AUTOFREE;
 
-		// Allocate a sound buffer, copy the data into it, and play
-		sound = (char *)malloc(size);
-		memcpy(sound, ptr + 8, size);
 		_vm->_mixer->stopID(_currentMusic);
 		_currentMusic = soundID;
-		_vm->_mixer->playRaw(NULL, sound, size, rate, flags, soundID);
+		_vm->_mixer->playRaw(NULL, ptr + 8, size, rate, flags, soundID);
 	}
 	else if (READ_UINT32(ptr) == MKID('MIDI')) {
 		if (_vm->_imuse) {







More information about the Scummvm-git-logs mailing list