[Scummvm-cvs-logs] CVS: tools compress_san.cpp,1.16,1.17

Pawel Kolodziejski aquadran at users.sourceforge.net
Sun Sep 19 04:55:01 CEST 2004


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

Modified Files:
	compress_san.cpp 
Log Message:
fixed bug frame calculation after cut IACT without FOBJ

Index: compress_san.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/compress_san.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- compress_san.cpp	19 Sep 2004 10:43:16 -0000	1.16
+++ compress_san.cpp	19 Sep 2004 11:54:11 -0000	1.17
@@ -44,6 +44,7 @@
 	int32 offsetOutput;
 	int32 fobjDecompressedSize;
 	int32 fobjCompressedSize;
+	int32 lessIACTSize;
 };
 
 static byte _IACToutput[0x1000];
@@ -261,6 +262,7 @@
 		frameInfo[l].offsetOutput = ftell(output);
 		frameInfo[l].fobjDecompressedSize = 0;
 		frameInfo[l].fobjCompressedSize = 0;
+		frameInfo[l].lessIACTSize = 0;
 		writeUint32BE(output, frameSize);
 		for (;;) {
 			tag = readUint32BE(input); // chunk tag
@@ -320,7 +322,7 @@
 					fseek(input, 1, SEEK_CUR);
 					size++;
 				}
-				frameInfo[l].frameSize -= size + 8;
+				frameInfo[l].lessIACTSize = size + 8;
 				continue;
 			} else {
 skip:
@@ -343,19 +345,23 @@
 
 	fclose(input);
 
-	printf("Fixing anim header...");
+	printf("Fixing frames header...");
 	int32 sumDiff = 0;
 	for (l = 0; l < nbframes; l++) {
-		if (frameInfo[l].fobjCompressedSize == 0)
-			continue;
+		int32 diff = 0;
+		if (frameInfo[l].fobjCompressedSize != 0) {
+			diff += frameInfo[l].fobjDecompressedSize - (frameInfo[l].fobjCompressedSize + 4);
+		}
+		if (frameInfo[l].lessIACTSize != 0) {
+			diff += frameInfo[l].lessIACTSize;
+		}
 		fseek(output, frameInfo[l].offsetOutput, SEEK_SET);
-		int32 diff = frameInfo[l].fobjDecompressedSize - (frameInfo[l].fobjCompressedSize + 4);
 		sumDiff += diff;
 		writeUint32BE(output, frameInfo[l].frameSize - diff);
 	}
 	printf("done.\n");
 
-	printf("Fixing frames header...");
+	printf("Fixing anim header...");
 	fseek(output, 4, SEEK_SET);
 	writeUint32BE(output, animChunkSize - sumDiff);
 	printf("done.\n");





More information about the Scummvm-git-logs mailing list