[Scummvm-cvs-logs] CVS: scummvm readme.txt,1.45,1.46 sound.cpp,1.74,1.75

James Brown ender at users.sourceforge.net
Sat May 4 18:55:01 CEST 2002


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

Modified Files:
	readme.txt sound.cpp 
Log Message:
Fix Dig bundle 'clicking'



Index: readme.txt
===================================================================
RCS file: /cvsroot/scummvm/scummvm/readme.txt,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- readme.txt	4 May 2002 00:20:38 -0000	1.45
+++ readme.txt	5 May 2002 01:54:06 -0000	1.46
@@ -393,6 +393,7 @@
         Jonathan 'khalek'  - Expert weaver in the Loom
         Nicolas Noble      - Config file support
         Pawel Kolodziejski - Added missing Dig SMUSH codecs
+	Felix Jakschitsc   - His hard work on Zak256
 
         And to all the contributors, users, and beta testers we've missed.
         Thanks!

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- sound.cpp	4 May 2002 09:55:10 -0000	1.74
+++ sound.cpp	5 May 2002 01:54:06 -0000	1.75
@@ -684,7 +684,7 @@
 void Scumm::decompressBundleSound(int index) {
 	int i, z;
 	COMP_table table[50];
-	static unsigned char *CompInput, *CompOutput, *CompFinal;
+	unsigned char *CompInput, *CompOutput, *CompFinal, *Final;
 	int outputSize, finalSize;
 
 	fileSeek(_sfxFile, bundle_table[index].offset, SEEK_SET);
@@ -759,10 +759,25 @@
 		free(CompOutput); CompOutput= NULL;
 	}
 
-	/* FIXME: This is nasty. We are actually sending the whole
-		  decompressed packet to the mixer.. but the packet
-		  actually contains further subblocks! (eg, sync) */
-	_mixer->play_raw(NULL, CompFinal, finalSize, 22050, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+	{	/* Parse decompressed data */
+		byte *ptr = CompFinal;
+		int tag, size;
+		tag = READ_BE_UINT32(ptr); ptr+=4;
+		if (tag != 'iMUS') {
+			warning("Decompression of bundle sound failed");
+			free(CompFinal);
+			return;
+		}
+		size = READ_BE_UINT32(ptr); ptr+=4;
+		tag = READ_BE_UINT32(ptr);  ptr+=4;
+		size = READ_BE_UINT32(ptr); ptr+=size+4;
+		tag = READ_BE_UINT32(ptr);  ptr+=4;
+		size = READ_BE_UINT32(ptr); ptr+=4;
+		Final = (unsigned char *)malloc(size);
+		memcpy(&Final[0], &ptr[0], size);
+		_mixer->play_raw(NULL, Final, size, 22050, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+		free(CompFinal);
+	}
 }
 
 void Scumm::playBundleSound(char *sound)





More information about the Scummvm-git-logs mailing list