[Scummvm-cvs-logs] SF.net SVN: scummvm:[52941] scummvm/trunk/tools/skycpt

tdhs at users.sourceforge.net tdhs at users.sourceforge.net
Wed Sep 29 04:57:11 CEST 2010


Revision: 52941
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52941&view=rev
Author:   tdhs
Date:     2010-09-29 02:57:11 +0000 (Wed, 29 Sep 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    scummvm/trunk/tools/skycpt/AsciiCptCompile.cpp
    scummvm/trunk/tools/skycpt/AsciiCptCompile.vcproj
    scummvm/trunk/tools/skycpt/README
    scummvm/trunk/tools/skycpt/TextFile.cpp
    scummvm/trunk/tools/skycpt/cptcompiler.cpp

Modified: scummvm/trunk/tools/skycpt/AsciiCptCompile.cpp
===================================================================
--- scummvm/trunk/tools/skycpt/AsciiCptCompile.cpp	2010-09-29 00:56:51 UTC (rev 52940)
+++ scummvm/trunk/tools/skycpt/AsciiCptCompile.cpp	2010-09-29 02:57:11 UTC (rev 52941)
@@ -56,8 +56,8 @@
 		printf("Sorry, this program only works on little endian systems.\nGoodbye.\n");
 		return 0;
 	}
-	TextFile *cptDef = new TextFile("compact.txt");
-	FILE *inf = fopen("compact.txt", "r");
+	TextFile *cptDef = new TextFile("COMPACT.TXT");
+	FILE *inf = fopen("COMPACT.TXT", "r");
 	FILE *dbg = fopen("compact.dbg", "wb");
 	FILE *out = fopen("compact.bin", "wb");
 	FILE *sve = fopen("savedata.txt", "r");
@@ -70,7 +70,3 @@
 	printf("done\n");
 	return 0;
 }
-
-
-
-

Modified: scummvm/trunk/tools/skycpt/AsciiCptCompile.vcproj
===================================================================
--- scummvm/trunk/tools/skycpt/AsciiCptCompile.vcproj	2010-09-29 00:56:51 UTC (rev 52940)
+++ scummvm/trunk/tools/skycpt/AsciiCptCompile.vcproj	2010-09-29 02:57:11 UTC (rev 52941)
@@ -387,7 +387,7 @@
 				RelativePath=".\asmSrc\9compact.inc">
 			</File>
 			<File
-				RelativePath=".\Compact.txt">
+				RelativePath=".\COMPACT.TXT">
 			</File>
 			<File
 				RelativePath=".\savedata.txt">

Modified: scummvm/trunk/tools/skycpt/README
===================================================================
--- scummvm/trunk/tools/skycpt/README	2010-09-29 00:56:51 UTC (rev 52940)
+++ scummvm/trunk/tools/skycpt/README	2010-09-29 02:57:11 UTC (rev 52941)
@@ -39,10 +39,14 @@
 	Afterwards, it'll automatically show the load/save dialog where you save the game.
 7) Rename the Savegame files you created to "RESET.*", depending on the version.
 	e.g. RESET.288 for v.0.00288
-8) Copy the files into the skycpt tool directory, execute the tool again.
+8) Rename each file with a ".gz" suffix and run gunzip on it.
+   This removes the ScummVM gzip savefile compression.
+   Failing to do this will cause skycpt to abort at a filesize assert
+   when reading the "RESET.*" files.
+9) Copy the files into the skycpt tool directory, execute the tool again.
 	It'll create a new COMPACT.DBG.
-9) Rename this file to SKY.CPT.
-10) DELETE IT BECAUSE IT'S PROBABLY BROKEN, NOT WORTH BOTHERING WITH ANYWAYS
+10) Rename this file to SKY.CPT.
+11) DELETE IT BECAUSE IT'S PROBABLY BROKEN, NOT WORTH BOTHERING WITH ANYWAYS
 	AND DOWNLOAD THE SKY.CPT FILE FROM THE URL ABOVE!!
 
 Oh, I almost forgot.

Modified: scummvm/trunk/tools/skycpt/TextFile.cpp
===================================================================
--- scummvm/trunk/tools/skycpt/TextFile.cpp	2010-09-29 00:56:51 UTC (rev 52940)
+++ scummvm/trunk/tools/skycpt/TextFile.cpp	2010-09-29 02:57:11 UTC (rev 52941)
@@ -28,13 +28,14 @@
 
 TextFile::TextFile(const char *name) {
 	FILE *inf = fopen(name, "r");
+	_lines = NULL;
 	if (!inf) {
 		printf("Unable to open file %s\n", name);
 		getchar();
+	} else {
+		read(inf);
+		fclose(inf);
 	}
-	_lines = NULL;
-	read(inf);
-	fclose(inf);
 }
 
 uint32 crop(char *line) {

Modified: scummvm/trunk/tools/skycpt/cptcompiler.cpp
===================================================================
--- scummvm/trunk/tools/skycpt/cptcompiler.cpp	2010-09-29 00:56:51 UTC (rev 52940)
+++ scummvm/trunk/tools/skycpt/cptcompiler.cpp	2010-09-29 02:57:11 UTC (rev 52941)
@@ -475,7 +475,7 @@
 	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 @@
 		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));


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list