[Scummvm-cvs-logs] CVS: tools Makefile,1.36,1.37 README,1.21,1.22 compress_san.cpp,1.21,1.22 md5table.c,1.14,1.15 saga2mp3.c,1.2,1.3
Jonathan Gray
khalek at users.sourceforge.net
Sun Sep 19 20:12:29 CEST 2004
Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11853
Modified Files:
Makefile README compress_san.cpp md5table.c saga2mp3.c
Log Message:
LFLAGS->LDFLAGS, detabify README and limit it to 80 chars & misc fixes across a number of things.
Index: Makefile
===================================================================
RCS file: /cvsroot/scummvm/tools/Makefile,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- Makefile 8 Sep 2004 16:59:45 -0000 1.36
+++ Makefile 20 Sep 2004 03:07:47 -0000 1.37
@@ -2,8 +2,8 @@
CC := gcc
CXX := g++
-CFLAGS := -g -O -Wall -Wuninitialized -Wno-long-long -Wno-multichar
-LDFLAGS :=
+CFLAGS += -g -O -Wall -Wuninitialized -Wno-long-long -Wno-multichar
+# LDFLAGS +=
# Additional warnings
CFLAGS+= -Wshadow
@@ -34,46 +34,46 @@
all: $(TARGETS)
compress_san$(EXEEXT): compress_san.o util.o
- $(CXX) $(LFLAGS) -o $@ $+ -lz
+ $(CXX) $(LDFLAGS) -o $@ $+ -lz
convbdf$(EXEEXT): convbdf.o util.o
- $(CXX) $(LFLAGS) -o $@ $+
+ $(CXX) $(LDFLAGS) -o $@ $+
descumm$(EXEEXT): descumm-tool.o descumm.o descumm6.o descumm-common.o util.o
- $(CXX) $(LFLAGS) -o $@ $+
+ $(CXX) $(LDFLAGS) -o $@ $+
desword2$(EXEEXT): desword2.o util.o
- $(CXX) $(LFLAGS) -o $@ $+
+ $(CXX) $(LDFLAGS) -o $@ $+
extract$(EXEEXT): extract.o extract-common.o util.o
- $(CC) $(LFLAGS) -o $@ $+
+ $(CC) $(LDFLAGS) -o $@ $+
loom_tg16_extract$(EXEEXT): loom_tg16_extract.o
- $(CC) $(LFLAGS) -o $@ $+
+ $(CC) $(LDFLAGS) -o $@ $+
md5table$(EXEEXT): md5table.o util.o
- $(CXX) $(LFLAGS) -o $@ $+
+ $(CXX) $(LDFLAGS) -o $@ $+
mm_nes_extract$(EXEEXT): mm_nes_extract.o
- $(CC) $(LFLAGS) -o $@ $+
+ $(CC) $(LDFLAGS) -o $@ $+
queenrebuild$(EXEEXT): queenrebuild.o util.o
- $(CC) $(LFLAGS) -o $@ $+
+ $(CC) $(LDFLAGS) -o $@ $+
rescumm$(EXEEXT): rescumm.o util.o
- $(CC) $(LFLAGS) -o $@ $+
+ $(CC) $(LDFLAGS) -o $@ $+
saga2mp3$(EXEEXT): saga2mp3.o extract-common.o util.o
- $(CC) $(LFLAGS) -o $@ $+
+ $(CC) $(LDFLAGS) -o $@ $+
simon1decr$(EXEEXT): simon1decr.o
- $(CC) $(LFLAGS) -o $@ $+
+ $(CC) $(LDFLAGS) -o $@ $+
simon2mp3$(EXEEXT): simon2mp3.o extract-common.o util.o
- $(CC) $(LFLAGS) -o $@ $+
+ $(CC) $(LDFLAGS) -o $@ $+
sword2mp3$(EXEEXT): sword2mp3.o extract-common.o util.o
- $(CC) $(LFLAGS) -o $@ $+
+ $(CC) $(LDFLAGS) -o $@ $+
descumm.o descumm6.o descumm-common.o descumm-tool.o: descumm.h util.h
extract.o simon2mp3.o sword2mp3.o extract-common.o: util.h extract.h
Index: README
===================================================================
RCS file: /cvsroot/scummvm/tools/README,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- README 19 Sep 2004 15:40:30 -0000 1.21
+++ README 20 Sep 2004 03:07:47 -0000 1.22
@@ -41,17 +41,18 @@
compress_san <inputfile> <inputdir> <outputdir>
Compresses '.san' smush animation files. It uses lossless zlib
for compressing FOBJ gfx chunks inside a san file.
- It also can create ogg separate file with smush audio track (only
- COMI currently supported).
+ It also can create ogg separate file with smush audio track
+ (only COMI currently supported).
Example of usage:
compress_san opening.san uncomp comp
WARNING: The current status of 'flu' support is not good,
- PLEASE DO NOT COMPRESS this pair of files yet, it will be fixed later.
+ PLEASE DO NOT COMPRESS this pair of files yet, it will be fixed
+ later.
ScummVM support requires a zlib enabled build, and Ogg support
- for ogg audio track playback.
+ for ogg audio track playback.
Script Tools:
Index: compress_san.cpp
===================================================================
RCS file: /cvsroot/scummvm/tools/compress_san.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- compress_san.cpp 19 Sep 2004 16:31:38 -0000 1.21
+++ compress_san.cpp 20 Sep 2004 03:07:47 -0000 1.22
@@ -54,7 +54,6 @@
void encodeWaveWithOgg(char *filename) {
char fbuf[2048];
- char *tmp = fbuf;
bool err = false;
sprintf(fbuf, "oggenc -q 0 %s", filename);
@@ -119,7 +118,7 @@
fclose(_waveTmpFile);
_waveTmpFile = NULL;
}
-void writeToTempWave(char *fileName, byte *output_data, int size) {
+void writeToTempWave(char *fileName, byte *output_data, unsigned int size) {
if (!_waveTmpFile) {
_waveTmpFile = fopen(fileName, "wb");
if (!_waveTmpFile) {
@@ -134,7 +133,7 @@
}
_waveDataSize = 0;
}
- for (int j = 0; j < size; j += 2) {
+ for (unsigned int j = 0; j < size; j += 2) {
byte tmp = output_data[j + 0];
output_data[j + 0] = output_data[j + 1];
output_data[j + 1] = tmp;
Index: md5table.c
===================================================================
RCS file: /cvsroot/scummvm/tools/md5table.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- md5table.c 14 Apr 2004 11:47:53 -0000 1.14
+++ md5table.c 20 Sep 2004 03:07:47 -0000 1.15
@@ -150,6 +150,12 @@
exit(2);
}
+/* needed to call from qsort */
+int strcmp_wrapper(const void *s1, const void *s2)
+{
+ return strcmp((const char *)s1, (const char *)s2);
+}
+
int main(int argc, char *argv[])
{
FILE *inFile = stdin;
@@ -229,7 +235,7 @@
/* Printf header */
fprintf(outFile, c_header, generationDate);
/* Now sort the MD5 table (this allows for binary searches) */
- qsort(entriesBuffer, numEntries, entrySize, strcmp);
+ qsort(entriesBuffer, numEntries, entrySize, strcmp_wrapper);
/* Output the table */
for (i = 0; i < numEntries; ++i)
fprintf(outFile, entriesBuffer + i * entrySize);
Index: saga2mp3.c
===================================================================
RCS file: /cvsroot/scummvm/tools/saga2mp3.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- saga2mp3.c 16 Sep 2004 09:27:40 -0000 1.2
+++ saga2mp3.c 20 Sep 2004 03:07:47 -0000 1.3
@@ -47,17 +47,17 @@
struct RECORD *table;
struct RECORD *outtable;
- int length;
- FILE *tempf;
- char fbuf [2048];
- char *output;
- size_t size;
- bool audio;
- char buf [8];
+ int length;
+ FILE *tempf;
+ char fbuf[2048];
+ const char *output;
+ size_t size;
+ bool audio;
+ char buf[8];
res_file = fopen(infile, "rb");
res_size = fileSize(res_file);
- printf("filesize: %u\n", res_size);
+ printf("filesize: %lu\n", res_size);
/*
* At the end of the resource file there are 2 values: one points to the
* beginning of the resource table the other gives the number of
@@ -68,7 +68,7 @@
res_tbl_offset = readUint32LE(res_file);
res_tbl_ct = readUint32LE(res_file);
- printf("tabel offset: %u\nnumber of records: %u\n", res_tbl_offset, res_tbl_ct);
+ printf("tabel offset: %lu\nnumber of records: %lu\n", res_tbl_offset, res_tbl_ct);
if (res_tbl_offset != res_size - RSC_TABLEINFO_SIZE - RSC_TABLEENTRY_SIZE * res_tbl_ct) {
printf("Something's wrong with your resource file..\n");
@@ -87,7 +87,7 @@
table[t].offset = readUint32LE(res_file);
table[t].size = readUint32LE(res_file);
- printf("record: %u, offset: %u, size: %u\n", t, table[t].offset, table[t].size);
+ printf("record: %lu, offset: %lu, size: %lu\n", t, table[t].offset, table[t].size);
if ((table[t].offset > res_size) ||
(table[t].size > res_size)) {
@@ -137,12 +137,12 @@
}
tempf = fopen(output, "rb");
outtable[t].offset = ftell(outputfile);
- printf("Offset: %u, ", outtable[t].offset);
+ printf("Offset: %lu, ", outtable[t].offset);
while ((size = fread(fbuf, 1, 2048, tempf)) > 0) {
fwrite(fbuf, 1, size, outputfile);
}
outtable[t].size = ftell(tempf);
- printf("Size: %u\n", outtable[t].size);
+ printf("Size: %lu\n", outtable[t].size);
fclose(tempf);
}
More information about the Scummvm-git-logs
mailing list