TOOLS : Fixes for skycpt use, particularly on case-sensitive OS

In order to allow for work on bug #1507756 "BASS: Officer Blunt wrong animation (?)",
the skycpt tool needs to be run, but this was only previously used on case-insensitive
OS i.e. Win32. To get this to work normally on case-sensitive OS i.e. Unix, a number of
corrections were made to the hardcoded filenames to ensure the same case as the
input files.

Minor corrections :
The README was also amended to deal with the pitfall of decompressing savefiles.
Added output of each RESET.* file as processed so offending file can be seen on assertion.
Corrected segfault on missing COMPACT.TXT, so exit is more graceful.

svn-id: r52941
This commit is contained in:
David Turner 2010-09-29 02:57:11 +00:00
parent e400554c2d
commit 05a08d61c7
5 changed files with 17 additions and 15 deletions

View file

@ -475,7 +475,7 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE *
bool filesExist = true;
char inName[32];
for (int i = 0; i < 7; i++) {
sprintf(inName, "reset.%03d", gameVers[i]);
sprintf(inName, "RESET.%03d", gameVers[i]);
FILE *test = fopen(inName, "rb");
if (test)
fclose(test);
@ -505,8 +505,9 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE *
fwrite(&tmp, 2, 1, debOutf);
printf("reset destination: %ld\n", ftell(debOutf));
for (int cnt = 0; cnt < 6; cnt++) {
printf("Processing diff v0.0%03d\n", gameVers[cnt]);
uint16 diffPos = 0;
sprintf(inName, "reset.%03d", gameVers[cnt]);
sprintf(inName, "RESET.%03d", gameVers[cnt]);
FILE *resDiff = fopen(inName, "rb");
fseek(resDiff, 0, SEEK_END);
assert(ftell(resDiff) == (resSize * 2));