[Scummvm-cvs-logs] SF.net SVN: scummvm: [29695] tools/branches/gsoc2007-toolsgui

lightcast at users.sourceforge.net lightcast at users.sourceforge.net
Sun Dec 2 11:16:19 CET 2007


Revision: 29695
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29695&view=rev
Author:   lightcast
Date:     2007-12-02 02:16:19 -0800 (Sun, 02 Dec 2007)

Log Message:
-----------
Merging update from trunk (rev. 29669)

Modified Paths:
--------------
    tools/branches/gsoc2007-toolsgui/README
    tools/branches/gsoc2007-toolsgui/convert_dxa.bat
    tools/branches/gsoc2007-toolsgui/convert_dxa_one.bat
    tools/branches/gsoc2007-toolsgui/encode_dxa.cpp
    tools/branches/gsoc2007-toolsgui/extract_loom_tg16.c
    tools/branches/gsoc2007-toolsgui/extract_mm_apple.c
    tools/branches/gsoc2007-toolsgui/extract_mm_c64.c
    tools/branches/gsoc2007-toolsgui/extract_mm_nes.c
    tools/branches/gsoc2007-toolsgui/extract_zak_c64.c
    tools/branches/gsoc2007-toolsgui/util.c
    tools/branches/gsoc2007-toolsgui/util.h
    tools/branches/gsoc2007-toolsgui/utils/voc.h

Added Paths:
-----------
    tools/branches/gsoc2007-toolsgui/utils/pack-end.h
    tools/branches/gsoc2007-toolsgui/utils/pack-start.h

Modified: tools/branches/gsoc2007-toolsgui/README
===================================================================
--- tools/branches/gsoc2007-toolsgui/README	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/README	2007-12-02 10:16:19 UTC (rev 29695)
@@ -107,8 +107,7 @@
 
                 There is no compression support yet for the following versions:
                 - The Mac CD Guild version of Inherit the Earth (uses MacBinary
-                *.bin files)
-                - The demo versions of Inherit the Earth
+                  *.bin files)
                 - The unsupported early DOS demo of Inherit the Earth
 
                 Example of usage:
@@ -180,9 +179,10 @@
                 TOUCHE.SO3 (MP3), TOUCHE.SOG (Vorbis), or TOUCHE.SOF (FLAC).
 
                 Once compressed, only TOUCHE.DAT and TOUCHE.SOx files are
+                required to play the game under ScummVM.
 
                 Example of usage:
-                comrpess_touche [params] <inputdir> <outputdir>
+                compress_touche [params] <inputdir> <outputdir>
 
 Script Tools:
         descumm

Modified: tools/branches/gsoc2007-toolsgui/convert_dxa.bat
===================================================================
--- tools/branches/gsoc2007-toolsgui/convert_dxa.bat	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/convert_dxa.bat	2007-12-02 10:16:19 UTC (rev 29695)
@@ -19,7 +19,7 @@
 SET DXA_PATH=C:\games\feeble\dxa
 SET DXA_CONVERT=CORRECT
 
-cd "%TOOLS_PATH%"
+cd /d "%TOOLS_PATH%"
 
 for %%i in (%SMK_PATH%\*.smk) do call convert_dxa_one "%%i"
 

Modified: tools/branches/gsoc2007-toolsgui/convert_dxa_one.bat
===================================================================
--- tools/branches/gsoc2007-toolsgui/convert_dxa_one.bat	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/convert_dxa_one.bat	2007-12-02 10:16:19 UTC (rev 29695)
@@ -18,13 +18,13 @@
 echo Processing %1...
 "%BINK_PATH%\BinkConv.exe" %1 "%SMK_PATH%\%~n1.png" /n-1 /z1 /#
 "%BINK_PATH%\BinkConv.exe" %1 "%SMK_PATH%\%~n1.wav" /v /#
-cd "%SMK_PATH%"
+cd /d "%SMK_PATH%"
 "%TOOLS_PATH%\encode_dxa.exe" --vorbis "%~n1.smk"
 echo Deleting temp files
 del "%SMK_PATH%\%~n1*.png"
 del "%SMK_PATH%\%~n1.wav"
 move "%SMK_PATH%\%~n1.*" "%DXA_PATH%"
-cd "%TOOLS_PATH%"
+cd /d "%TOOLS_PATH%"
 
 goto quit
 

Modified: tools/branches/gsoc2007-toolsgui/encode_dxa.cpp
===================================================================
--- tools/branches/gsoc2007-toolsgui/encode_dxa.cpp	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/encode_dxa.cpp	2007-12-02 10:16:19 UTC (rev 29695)
@@ -25,7 +25,6 @@
 #include "util.h"
 
 #include <png.h>
-#include <zlib.h>
 
 const uint32 typeDEXA = 0x41584544;
 const uint32 typeFRAM = 0x4d415246;

Modified: tools/branches/gsoc2007-toolsgui/extract_loom_tg16.c
===================================================================
--- tools/branches/gsoc2007-toolsgui/extract_loom_tg16.c	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/extract_loom_tg16.c	2007-12-02 10:16:19 UTC (rev 29695)
@@ -23,29 +23,10 @@
 #include "util.h"
 #include <stdarg.h>
 
-typedef int BOOL;
-#define TRUE 1
-#define FALSE 0
-
 /* if defined, generates a set of .LFL files */
 /* if not defined, dumps all resources to separate files */
 #define MAKE_LFLS
 
-#ifdef _MSC_VER
-	#define vsnprintf _vsnprintf
-#endif
-
-void notice(const char *s, ...) {
-	char buf[1024];
-	va_list va;
-
-	va_start(va, s);
-	vsnprintf(buf, 1024, s, va);
-	va_end(va);
-
-	fprintf(stdout, "%s\n", buf);
-}
-
 uint8 read_cbyte (FILE *input, short *ctr) {
 	(*ctr) += 1;
 	return readByte(input);
@@ -845,7 +826,7 @@
 		}
 
 		if (rtype != 0x11) {
-			error("extract_resource(globdata) - resource tag is incorrect!");
+			error("extract_resource(globdata) - resource tag is incorrect");
 		}
 
 		writeUint32LE(output, (uint16)(rlen + 1));
@@ -870,7 +851,7 @@
 			}
 
 			if (rtype != 0x01) {
-				error("extract_resource(room) - resource tag is incorrect!");
+				error("extract_resource(room) - resource tag is incorrect");
 			}
 
 			off = ftell(output);
@@ -1027,7 +1008,7 @@
 
 		break;
 	case RES_SOUND:
-		error("extract_resource(sound) - sound resources are not supported!");
+		error("extract_resource(sound) - sound resources are not supported");
 		break;
 	case RES_COSTUME:
 		rlen = read_cword(input, &i);
@@ -1040,7 +1021,7 @@
 		}
 
 		if (rtype != 0x03) {
-			error("extract_resource(costume) - resource tag is incorrect!");
+			error("extract_resource(costume) - resource tag is incorrect");
 		}
 
 		writeUint32LE(output, (uint16)(rlen + 1));
@@ -1062,7 +1043,7 @@
 		}
 
 		if (rtype != 0x02) {
-			error("extract_resource(script) - resource tag is incorrect!");
+			error("extract_resource(script) - resource tag is incorrect");
 		}
 
 		writeUint32LE(output, (uint16)(rlen + 1));
@@ -1096,7 +1077,7 @@
 		break;
 #endif
 	default:
-		warning("extract_resource - unknown resource type %d specified!", res->type);
+		warning("extract_resource - unknown resource type %d specified", res->type);
 	}
 }
 
@@ -1291,8 +1272,9 @@
 	FILE *output;
 	sprintf(fname, fn_template, num);
 
-	if (!(output = fopen(fname, "wb"))) {
-		error("Error: unable to create %s!", fname);
+	output = fopen(fname, "wb");
+	if (!output) {
+		error("Error: unable to create %s", fname);
 	}
 
 	extract_resource(input, output, res);
@@ -1350,8 +1332,9 @@
 
 	getPath(argv[argc - 1], inputPath);
 
-	if (!(input = fopen(argv[1], "rb"))) {
-		error("Error: unable to open file %s for input!", argv[1]);
+	input = fopen(argv[1], "rb");
+	if (!input) {
+		error("Error: unable to open file %s for input", argv[1]);
 	}
 
 	InitCRC();
@@ -1367,7 +1350,7 @@
 		notice("ISO contents verified as Loom Japan (track 2)");
 		break;
 	default:
-		error("ISO contents not recognized!");
+		error("ISO contents not recognized");
 		break;
 	}
 
@@ -1378,8 +1361,9 @@
 		p_lfl lfl = &lfls[i];
 
 		sprintf(fname, "%s/%02i.LFL", inputPath, lfl->num);
-		if (!(output = fopen(fname, "wb"))) {
-			error("Error: unable to create %s!", fname);
+		output = fopen(fname, "wb");
+		if (!output) {
+			error("Error: unable to create %s", fname);
 		}
 
 		notice("Creating %s...", fname);
@@ -1415,7 +1399,8 @@
 	}
 
 	sprintf(fname, "%s/00.LFL", inputPath);
-	if (!(output = fopen(fname, "wb"))) {
+	output = fopen(fname, "wb");
+	if (!output) {
 		error("Error: unable to create index file!");
 	}
 
@@ -1469,8 +1454,9 @@
 	fclose(output);
 
 	sprintf(fname, "%s/97.LFL", inputPath);
-	if (!(output = fopen(fname, "wb"))) {
-		error("Error: unable to create charset file!");
+	output = fopen(fname, "wb");
+	if (!output) {
+		error("Error: unable to create charset file 97.LFL");
 	}
 
 	notice("Creating %s...", fname);
@@ -1478,8 +1464,9 @@
 	fclose(output);
 
 	sprintf(fname, "%s/98.LFL", inputPath);
-	if (!(output = fopen(fname, "wb"))) {
-		error("Error: unable to create charset file!");
+	output = fopen(fname, "wb");
+	if (!output) {
+		error("Error: unable to create charset file 98.LFL");
 	}
 
 	notice("Creating %s...", fname);
@@ -1487,8 +1474,9 @@
 	fclose(output);
 
 	sprintf(fname, "%s/99.LFL", inputPath);
-	if (!(output = fopen(fname, "wb"))) {
-		error("Error: unable to create charset file!");
+	output = fopen(fname, "wb");
+	if (!output) {
+		error("Error: unable to create charset file 99.LFL");
 	}
 
 	notice("Creating %s...", fname);

Modified: tools/branches/gsoc2007-toolsgui/extract_mm_apple.c
===================================================================
--- tools/branches/gsoc2007-toolsgui/extract_mm_apple.c	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/extract_mm_apple.c	2007-12-02 10:16:19 UTC (rev 29695)
@@ -23,14 +23,6 @@
 #include "util.h"
 #include <stdarg.h>
 
-typedef int BOOL;
-#define TRUE 1
-#define FALSE 0
-
-#ifdef _MSC_VER
-	#define vsnprintf _vsnprintf
-#endif
-
 void writeByteAlt(FILE *fp, uint8 b) {
 	writeByte(fp, (uint8)(b ^ 0xFF));
 }
@@ -42,19 +34,23 @@
 #define writeByte writeByteAlt
 #define writeUint16LE writeUint16LEAlt
 
-void notice(const char *s, ...) {
-	char buf[1024];
-	va_list va;
+#define NUM_ROOMS 55
+unsigned char room_disks[NUM_ROOMS], room_tracks[NUM_ROOMS], room_sectors[NUM_ROOMS];
+static const int SectorOffset[36] = {
+ 	         0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256,
+ 	         272, 288, 304, 320, 336, 352, 368,
+ 	         384, 400, 416, 432, 448, 464,
+ 	         480, 496, 512, 528, 544, 560
+ 	 };
+static const int ResourcesPerFile[NUM_ROOMS] = {
+         0, 11,  1,  3,  9, 12,  1, 13, 10,  6,
+         4,  1,  7,  1,  1,  2,  7,  8, 19,  9,
+         6,  9,  2,  6,  8,  4, 16,  8,  3,  3,
+        12, 12,  2,  8,  1,  1,  2,  1,  9,  1,
+         3,  7,  3,  3, 13,  5,  4,  3,  1,  1,
+         3, 10,  1,  0,  0
+};
 
-	va_start(va, s);
-	vsnprintf(buf, 1024, s, va);
-	va_end(va);
-
-	fprintf(stdout, "%s\n", buf);
-}
-
-unsigned char room_disks[55], room_tracks[55], room_sectors[55];
-
 int main (int argc, char **argv) {
 	FILE *input1, *input2, *output;
 	char fname[1024];
@@ -70,11 +66,11 @@
 	getPath(argv[argc - 1], inputPath);
 
 	if (!(input1 = fopen(argv[1], "rb"))) {
-		error("Error: unable to open file %s for input!", argv[1]);
+		error("Error: unable to open file %s for input", argv[1]);
 	}
 
 	if (!(input2 = fopen(argv[2], "rb"))) {
-		error("Error: unable to open file %s for input!", argv[2]);
+		error("Error: unable to open file %s for input", argv[2]);
 	}
 
 	fseek(input1, 142080, SEEK_SET);
@@ -152,23 +148,7 @@
 
 	fclose(output);
 
-	for (i = 0; i < 55; i++) {
-		const int SectorOffset[36] = {
-			0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256,
-			272, 288, 304, 320, 336, 352, 368,
-			384, 400, 416, 432, 448, 464,
-			480, 496, 512, 528, 544, 560
-		};
-
-		const int ResourcesPerFile[55] = {
-			 0, 11,  1,  3,  9, 12,  1, 13, 10,  6,
-			 4,  1,  7,  1,  1,  2,  7,  8, 19,  9,
-			 6,  9,  2,  6,  8,  4, 16,  8,  3,  3,
-			12, 12,  2,  8,  1,  1,  2,  1,  9,  1,
-			 3,  7,  3,  3, 13,  5,  4,  3,  1,  1,
-			 3, 10,  1,  0,  0
-		};
-
+	for (i = 0; i < NUM_ROOMS; i++) {
 		FILE *input;
 
 		if (room_disks[i] == '1') {

Modified: tools/branches/gsoc2007-toolsgui/extract_mm_c64.c
===================================================================
--- tools/branches/gsoc2007-toolsgui/extract_mm_c64.c	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/extract_mm_c64.c	2007-12-02 10:16:19 UTC (rev 29695)
@@ -23,14 +23,6 @@
 #include "util.h"
 #include <stdarg.h>
 
-typedef int BOOL;
-#define TRUE 1
-#define FALSE 0
-
-#ifdef _MSC_VER
-	#define vsnprintf _vsnprintf
-#endif
-
 void writeByteAlt(FILE *fp, uint8 b) {
 	writeByte(fp, (uint8)(b ^ 0xFF));
 }
@@ -42,19 +34,26 @@
 #define writeByte writeByteAlt
 #define writeUint16LE writeUint16LEAlt
 
-void notice(const char *s, ...) {
-	char buf[1024];
-	va_list va;
+#define NUM_ROOMS 55
+unsigned char room_disks[NUM_ROOMS], room_tracks[NUM_ROOMS], room_sectors[NUM_ROOMS];
 
-	va_start(va, s);
-	vsnprintf(buf, 1024, s, va);
-	va_end(va);
+const int SectorOffset[36] = {
+	0,
+	0, 21, 42, 63, 84, 105, 126, 147, 168, 189, 210, 231, 252, 273, 294, 315, 336,
+	357, 376, 395, 414, 433, 452, 471,
+	490, 508, 526, 544, 562, 580,
+	598, 615, 632, 649, 666
+};
 
-	fprintf(stdout, "%s\n", buf);
-}
+const int ResourcesPerFile[55] = {
+	 0, 11,  1,  3,  9, 12,  1, 13, 10,  6,
+	 4,  1,  7,  1,  1,  2,  7,  8, 19,  9,
+	 6,  9,  2,  6,  8,  4, 16,  8,  3,  3,
+	12, 12,  2,  8,  1,  1,  2,  1,  9,  1,
+	 3,  7,  3,  3, 13,  5,  4,  3,  1,  1,
+	 3, 10,  1,  0,  0
+};
 
-unsigned char room_disks[55], room_tracks[55], room_sectors[55];
-
 int main (int argc, char **argv) {
 	FILE *input1, *input2, *output;
 	char fname[1024];
@@ -70,11 +69,11 @@
 	getPath(argv[argc - 1], inputPath);
 
 	if (!(input1 = fopen(argv[1], "rb"))) {
-		error("Error: unable to open file %s for input!", argv[1]);
+		error("Error: unable to open file %s for input", argv[1]);
 	}
 
 	if (!(input2 = fopen(argv[2], "rb"))) {
-		error("Error: unable to open file %s for input!", argv[2]);
+		error("Error: unable to open file %s for input", argv[2]);
 	}
 
 	/* check signature */
@@ -148,23 +147,6 @@
 	fclose(output);
 
 	for (i = 0; i < 55; i++) {
-		const int SectorOffset[36] = {
-			0,
-			0, 21, 42, 63, 84, 105, 126, 147, 168, 189, 210, 231, 252, 273, 294, 315, 336,
-			357, 376, 395, 414, 433, 452, 471,
-			490, 508, 526, 544, 562, 580,
-			598, 615, 632, 649, 666
-		};
-
-		const int ResourcesPerFile[55] = {
-			 0, 11,  1,  3,  9, 12,  1, 13, 10,  6,
-			 4,  1,  7,  1,  1,  2,  7,  8, 19,  9,
-			 6,  9,  2,  6,  8,  4, 16,  8,  3,  3,
-			12, 12,  2,  8,  1,  1,  2,  1,  9,  1,
-			 3,  7,  3,  3, 13,  5,  4,  3,  1,  1,
-			 3, 10,  1,  0,  0
-		};
-
 		FILE *input;
 
 		if (room_disks[i] == '1') {

Modified: tools/branches/gsoc2007-toolsgui/extract_mm_nes.c
===================================================================
--- tools/branches/gsoc2007-toolsgui/extract_mm_nes.c	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/extract_mm_nes.c	2007-12-02 10:16:19 UTC (rev 29695)
@@ -23,18 +23,10 @@
 #include "util.h"
 #include <stdarg.h>
 
-typedef int BOOL;
-#define TRUE 1
-#define FALSE 0
-
 /* if defined, generates a set of .LFL files */
 /* if not defined, dumps all resources to separate files */
 #define MAKE_LFLS
 
-#ifdef _MSC_VER
-	#define vsnprintf _vsnprintf
-#endif
-
 #ifdef MAKE_LFLS
 void writeByteAlt(FILE *fp, uint8 b) {
 	writeByte(fp, (uint8)(b ^ 0xFF));
@@ -48,17 +40,6 @@
 #define writeUint16LE writeUint16LEAlt
 #endif
 
-void notice(const char *s, ...) {
-	char buf[1024];
-	va_list va;
-
-	va_start(va, s);
-	vsnprintf(buf, 1024, s, va);
-	va_end(va);
-
-	fprintf(stdout, "%s\n", buf);
-}
-
 typedef enum _res_type {
 	NES_UNKNOWN,
 	NES_GLOBDATA,
@@ -1002,7 +983,7 @@
 		}
 		break;
 	default:
-		error("extract_resource - unknown resource type %d specified!", res->type);
+		error("extract_resource - unknown resource type %d specified", res->type);
 	}
 }
 
@@ -1133,15 +1114,7 @@
 	{ -1, NULL }
 };
 
-#if defined(__GNUC__)
-#define GCC_PACK __attribute__((packed))
-#else
-#define GCC_PACK
-#endif
-#if defined(_MSC_VER)
-#pragma pack(push, 1)
-#endif
-
+#include "utils/pack-start.h"   /* START STRUCT PACKING */
 struct _lfl_index {
 	uint8 room_lfl[55];
 	uint16 room_addr[55];
@@ -1153,16 +1126,15 @@
 	uint16 sound_addr[100];
 } GCC_PACK lfl_index;
 
-#if defined(_MSC_VER)
-#pragma pack(pop)
-#endif
+#include "utils/pack-end.h"     /* END STRUCT PACKING */
 #else /* !MAKE_LFLS */
 void dump_resource (FILE *input, char *fn_template, int num, p_resource res) {
 	char fname[256];
 	FILE *output;
 	sprintf(fname, fn_template, num);
 
-	if (!(output = fopen(fname, "wb"))) {
+	output = fopen(fname, "wb");
+	if (!output) {
 		error("Error: unable to create %s!", fname);
 	}
 
@@ -1215,7 +1187,7 @@
 	getPath(argv[argc - 1], inputPath);
 
 	if (!(input = fopen(argv[1], "rb"))) {
-		error("Error: unable to open file %s for input!", argv[1]);
+		error("Error: unable to open file %s for input", argv[1]);
 	}
 
 	if ((readByte(input) == 'N') && (readByte(input) == 'E') && (readByte(input) == 'S') && (readByte(input) == 0x1A)) {
@@ -1254,10 +1226,10 @@
         notice("ROM contents verified as Maniac Mansion (Spain)");
         break;
 	case 0x3DA2085E:
-		error("Maniac Mansion (Japan) is not supported!");
+		error("Maniac Mansion (Japan) is not supported");
 		break;
 	default:
-		error("ROM contents not recognized! (%08X)", CRC);
+		error("ROM contents not recognized (%08X)", CRC);
 		break;
 	}
 
@@ -1268,8 +1240,9 @@
 		p_lfl lfl = &lfls[i];
 
 		sprintf(fname, "%s/%02i.LFL", inputPath, lfl->num);
-		if (!(output = fopen(fname, "wb"))) {
-			error("Error: unable to create %s!", fname);
+		output = fopen(fname, "wb");
+		if (!output) {
+			error("Error: unable to create %s", fname);
 		}
 
 		notice("Creating %s...", fname);
@@ -1331,7 +1304,7 @@
 				lfl_index.costume_addr[78] = (uint16)ftell(output);
 				break;
 			default:
-				error("Unindexed entry found!");
+				error("Unindexed entry found");
 				break;
 			}
 
@@ -1343,8 +1316,9 @@
 	}
 
 	sprintf(fname, "%s/00.LFL", inputPath);
-	if (!(output = fopen(fname, "wb"))) {
-		error("Error: unable to create index file!");
+	output = fopen(fname, "wb");
+	if (!output) {
+		error("Error: unable to create index file");
 	}
 
 	notice("Creating %s...", fname);

Modified: tools/branches/gsoc2007-toolsgui/extract_zak_c64.c
===================================================================
--- tools/branches/gsoc2007-toolsgui/extract_zak_c64.c	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/extract_zak_c64.c	2007-12-02 10:16:19 UTC (rev 29695)
@@ -23,14 +23,6 @@
 #include "util.h"
 #include <stdarg.h>
 
-typedef int BOOL;
-#define TRUE 1
-#define FALSE 0
-
-#ifdef _MSC_VER
-	#define	vsnprintf _vsnprintf
-#endif
-
 void writeByteAlt(FILE *fp, uint8 b) {
 	writeByte(fp, (uint8)(b ^ 0xFF));
 }
@@ -42,19 +34,25 @@
 #define writeByte writeByteAlt
 #define writeUint16LE writeUint16LEAlt
 
-void notice(const char *s, ...) {
-	char buf[1024];
-	va_list va;
+#define NUM_ROOMS 59
+unsigned char room_disks[NUM_ROOMS], room_tracks[NUM_ROOMS], room_sectors[NUM_ROOMS];
+const int SectorOffset[36] = {
+	0,
+	0, 21, 42, 63, 84, 105, 126, 147, 168, 189, 210, 231, 252, 273, 294, 315, 336,
+	357, 376, 395, 414, 433, 452, 471,
+	490, 508, 526, 544, 562, 580,
+	598, 615, 632, 649, 666
+};
 
-	va_start(va, s);
-	vsnprintf(buf, 1024, s, va);
-	va_end(va);
+const int ResourcesPerFile[59] = {
+	 0, 29, 12, 14, 13,  4,  4, 10,  7,  4,
+	14, 19,  5,  4,  7,  6, 11,  9,  4,  4,
+	 1,  3,  3,  5,  1,  9,  4, 10, 13,  6,
+	 7, 10,  2,  6,  1, 11,  2,  5,  7,  1,
+	 7,  1,  4,  2,  8,  6,  6,  6,  4, 13,
+	 3,  1,  2,  1,  2,  1, 10,  1,  1
+};
 
-	fprintf(stdout, "%s\n", buf);
-}
-
-unsigned char room_disks[59], room_tracks[59], room_sectors[59];
-
 int main (int argc, char **argv) {
 	FILE *input1, *input2, *output;
 	char fname[1024];
@@ -106,15 +104,15 @@
 	}
 
 	/* copy room offsets */
-	for (i = 0; i < 59; i++) {
+	for (i = 0; i < NUM_ROOMS; i++) {
 		room_disks[i] = readByte(input1);
 		writeByte(output, room_disks[i]);
 	}
 
-	for (i = 0; i < 59; i++) {
+	for (i = 0; i < NUM_ROOMS; i++) {
 		room_sectors[i] = readByte(input1);
-		room_tracks[i] = readByte(input1);
 		writeByte(output, room_sectors[i]);
+		room_tracks[i] = readByte(input1);
 		writeByte(output, room_tracks[i]);
 	}
 
@@ -147,24 +145,7 @@
 
 	fclose(output);
 
-	for (i = 0; i < 59; i++) {
-		const int SectorOffset[36] = {
-			0,
-			0, 21, 42, 63, 84, 105, 126, 147, 168, 189, 210, 231, 252, 273, 294, 315, 336,
-			357, 376, 395, 414, 433, 452, 471,
-			490, 508, 526, 544, 562, 580,
-			598, 615, 632, 649, 666
-		};
-
-		const int ResourcesPerFile[59] = {
-			 0, 29, 12, 14, 13,  4,  4, 10,  7,  4,
-			14, 19,  5,  4,  7,  6, 11,  9,  4,  4,
-			 1,  3,  3,  5,  1,  9,  4, 10, 13,  6,
-			 7, 10,  2,  6,  1, 11,  2,  5,  7,  1,
-			 7,  1,  4,  2,  8,  6,  6,  6,  4, 13,
-			 3,  1,  2,  1,  2,  1, 10,  1,  1
-		};
-
+	for (i = 0; i < NUM_ROOMS; i++) {
 		FILE *input;
 
 		if (room_disks[i] == '1') {

Modified: tools/branches/gsoc2007-toolsgui/util.c
===================================================================
--- tools/branches/gsoc2007-toolsgui/util.c	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/util.c	2007-12-02 10:16:19 UTC (rev 29695)
@@ -62,6 +62,17 @@
 	fprintf(stderr, "DEBUG: %s!\n", buf);
 }
 
+void notice(const char *s, ...) {
+        char buf[1024];
+        va_list va;
+
+        va_start(va, s);
+        vsnprintf(buf, 1024, s, va);
+        va_end(va);
+
+        fprintf(stdout, "%s\n", buf);
+}
+
 uint8 readByte(FILE *fp) {
 	return fgetc(fp);
 }

Modified: tools/branches/gsoc2007-toolsgui/util.h
===================================================================
--- tools/branches/gsoc2007-toolsgui/util.h	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/util.h	2007-12-02 10:16:19 UTC (rev 29695)
@@ -77,10 +77,6 @@
 
 	#define SCUMM_LITTLE_ENDIAN
 
-	#define START_PACK_STRUCTS pack(push, 1)
-	#define END_PACK_STRUCTS   pack(pop)
-
-
 #elif defined(__MINGW32__)
 
 	#define scumm_stricmp stricmp
@@ -88,9 +84,6 @@
 
 	#define SCUMM_LITTLE_ENDIAN
 
-	#define START_PACK_STRUCTS pack(push, 1)
-	#define END_PACK_STRUCTS   pack(pop)
-
 #elif defined(UNIX)
 
 	#define scumm_stricmp strcasecmp
@@ -101,11 +94,6 @@
 	#define SCUMM_NEED_ALIGNMENT
 	#endif
 
-	#if !defined(__GNUC__)
-	#define START_PACK_STRUCTS pack (1)
-	#define END_PACK_STRUCTS   pack ()
-	#endif
-
 #else
 
 	#error No system type defined
@@ -228,6 +216,7 @@
 void NORETURN_PRE error(const char *s, ...) NORETURN_POST;
 void warning(const char *s, ...);
 void debug(int level, const char *s, ...);
+void notice(const char *s, ...);
 void getPath(const char *fullpath, char *path);
 void getFilename(const char *fullpath, char *filename);
 

Added: tools/branches/gsoc2007-toolsgui/utils/pack-end.h
===================================================================
--- tools/branches/gsoc2007-toolsgui/utils/pack-end.h	                        (rev 0)
+++ tools/branches/gsoc2007-toolsgui/utils/pack-end.h	2007-12-02 10:16:19 UTC (rev 29695)
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#if defined(SCUMMVM_USE_PRAGMA_PACK)
+  #pragma pack()
+#endif


Property changes on: tools/branches/gsoc2007-toolsgui/utils/pack-end.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Added: tools/branches/gsoc2007-toolsgui/utils/pack-start.h
===================================================================
--- tools/branches/gsoc2007-toolsgui/utils/pack-start.h	                        (rev 0)
+++ tools/branches/gsoc2007-toolsgui/utils/pack-start.h	2007-12-02 10:16:19 UTC (rev 29695)
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#if defined(SCUMMVM_USE_PRAGMA_PACK)
+  #pragma pack(1)
+#endif


Property changes on: tools/branches/gsoc2007-toolsgui/utils/pack-start.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Modified: tools/branches/gsoc2007-toolsgui/utils/voc.h
===================================================================
--- tools/branches/gsoc2007-toolsgui/utils/voc.h	2007-12-02 09:41:44 UTC (rev 29694)
+++ tools/branches/gsoc2007-toolsgui/utils/voc.h	2007-12-02 10:16:19 UTC (rev 29695)
@@ -31,11 +31,8 @@
 
 class AudioStream;
 
+#include "pack-start.h" /* START STRUCT PACKING */
 
-#if !defined(__GNUC__)
-#pragma START_PACK_STRUCTS
-#endif
-
 struct VocFileHeader {
 	uint8 desc[20];
 	uint16 datablock_offset;
@@ -50,9 +47,7 @@
 	uint8 pack;
 } GCC_PACK;
 
-#if !defined(__GNUC__)
-#pragma END_PACK_STRUCTS
-#endif
+#include "pack-end.h"   /* END STRUCT PACKING */
 
 /**
  * Take a sample rate parameter as it occurs in a VOC sound header, and


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