[Scummvm-cvs-logs] CVS: tools compress_san.cpp,1.5,1.6
Pawel Kolodziejski
aquadran at users.sourceforge.net
Tue Apr 13 13:27:08 CEST 2004
Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22840
Modified Files:
compress_san.cpp
Log Message:
support for *.flu files too, but not tested yet
Index: compress_san.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/compress_san.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- compress_san.cpp 13 Apr 2004 19:45:25 -0000 1.5
+++ compress_san.cpp 13 Apr 2004 20:12:34 -0000 1.6
@@ -33,7 +33,7 @@
}
void showhelp(char *exename) {
- printf("\nUsage: %s <inputfile>.san <outputfile>.san\n", exename);
+ printf("\nUsage: %s <inputfile>.san <outputfile>.san [<file>.flu>]\n", exename);
// printf("\nParams:\n");
// printf("\n --help this help message\n");
exit(2);
@@ -51,21 +51,27 @@
if (argc < 3)
showhelp(argv[0]);
- i = argc - 2;
- FILE *input = fopen(argv[i], "rb");
+ FILE *input = fopen(argv[1], "rb");
if (!input) {
- printf("Cannot open file: %s\n", argv[i]);
+ printf("Cannot open file: %s\n", argv[1]);
exit(-1);
}
- i = argc - 1;
-
- FILE *output = fopen(argv[i], "wb");
+ FILE *output = fopen(argv[2], "wb");
if (!output) {
- printf("Cannot open file: %s\n", argv[i]);
+ printf("Cannot open file: %s\n", argv[2]);
exit(-1);
}
+ FILE *flu = NULL;
+ if (argc == 4) {
+ flu = fopen(argv[3], "wb");
+ if (!flu) {
+ printf("Cannot open file: %s\n", argv[3]);
+ exit(-1);
+ }
+ }
+
uint32 tag;
int32 l, size;
@@ -154,6 +160,14 @@
fseek(output, 4, SEEK_SET);
writeUint32BE(output, animChunkSize - sumDiff);
+ if (flu) {
+ fseek(flu, 0x308, SEEK_SET);
+ for (l = 0; l < nbframes; l++) {
+ writeUint32BE(output, frameInfo[l].offsetOutput - 4);
+ }
+ fclose(flu);
+ }
+
free(frameInfo);
fclose(output);
More information about the Scummvm-git-logs
mailing list