[Scummvm-cvs-logs] CVS: tools compress_scumm_bun.cpp,1.1,1.2

Pawel Kolodziejski aquadran at users.sourceforge.net
Sun Jan 23 00:11:03 CET 2005


Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6735

Modified Files:
	compress_scumm_bun.cpp 
Log Message:
update

Index: compress_scumm_bun.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/compress_scumm_bun.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- compress_scumm_bun.cpp	23 Jan 2005 08:00:00 -0000	1.1
+++ compress_scumm_bun.cpp	23 Jan 2005 08:10:26 -0000	1.2
@@ -776,7 +776,7 @@
 
 typedef struct { int offset, size, codec; } CompTable;
 
-byte *decompressBundleSound(int index, FILE *input) {
+byte *decompressBundleSound(int index, FILE *input, int32 &finalSize) {
 	byte compOutput[0x2000];
 	int i;
 
@@ -801,7 +801,7 @@
 	byte *compInput = (byte *)malloc(maxSize + 1);
 	byte *compFinal = (byte *)malloc(1);
 
-	int32 finalSize = 0;
+	finalSize = 0;
 
 	for (i = 0; i < numCompItems; i++) {
 		compInput[compTable[i].size] = 0;
@@ -814,6 +814,9 @@
 		finalSize += outputSize;
 	}
 
+	free(compInput);
+	free(compTable);
+
 	return compFinal;
 }
 
@@ -825,6 +828,7 @@
 	char outputDir[200];
 	char inputFilename[200];
 	char tmpPath[200];
+	char tmp2Path[200];
 
 	strcpy(inputFilename, argv[1]);
 	strcpy(inputDir, argv[2]);
@@ -872,12 +876,18 @@
 		bundleTable[i].size = readUint32BE(input);
 	}
 
+	int32 size = 0;
 	for (int h = 0; h < numFiles; h++) {
-		byte *compFinal = decompressBundleSound(h, input);
+		byte *compFinal = decompressBundleSound(h, input, size);
+
+		sprintf(tmp2Path, "%s/%s.wav", outputDir, bundleTable[h].filename);
+		writeToTempWave(tmp2Path, compFinal, size);
 
 		free(compFinal);
 	}
 
+	free(bundleTable);
+
 	fclose(input);
 
 	printf("compression done.\n");





More information about the Scummvm-git-logs mailing list