[Scummvm-cvs-logs] SF.net SVN: scummvm:[41457] tools/branches/gsoc2009-gui

Remere at users.sourceforge.net Remere at users.sourceforge.net
Fri Jun 12 02:19:43 CEST 2009


Revision: 41457
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41457&view=rev
Author:   Remere
Date:     2009-06-12 00:19:43 +0000 (Fri, 12 Jun 2009)

Log Message:
-----------
*Updated README with new tool syntax (not complete yet)
*Added back --mac argument to compress_agos
*Fixed spelling error in compress_sword2 that prevented compilation (tapped delete just before commit)
*Added -o argument to compress_agos.
*Changed -o argument for compress_queen to file name, not directory
*Fixed compress_scumm_san not working properly
*Updated all compression tools' --help message
*Fixed compress_gob output filename being inaccurate

Modified Paths:
--------------
    tools/branches/gsoc2009-gui/README
    tools/branches/gsoc2009-gui/compress_agos.cpp
    tools/branches/gsoc2009-gui/compress_gob.cpp
    tools/branches/gsoc2009-gui/compress_kyra.cpp
    tools/branches/gsoc2009-gui/compress_queen.cpp
    tools/branches/gsoc2009-gui/compress_saga.cpp
    tools/branches/gsoc2009-gui/compress_scumm_bun.cpp
    tools/branches/gsoc2009-gui/compress_scumm_san.cpp
    tools/branches/gsoc2009-gui/compress_sword2.cpp

Modified: tools/branches/gsoc2009-gui/README
===================================================================
--- tools/branches/gsoc2009-gui/README	2009-06-11 23:49:06 UTC (rev 41456)
+++ tools/branches/gsoc2009-gui/README	2009-06-12 00:19:43 UTC (rev 41457)
@@ -7,22 +7,26 @@
 example.
 
 Extraction Tools:
+		All extraction tools work on the simple format:
+			extract [-o outputdir] <inputfile>
+		If output directory is not specified, it defaults to out/inputfile
+
         extract_agos
                 Extracts the packed files used in the Amiga and AtariST
                 versions of Elvira 1/2, Waxworks and Simon the Sorcerer 1.
-
+				
                 Example of usage:
-                extract_agos <file 1> ... <file n>
+                extract_agos <infile 1> ... <infile n>
 
         extract_cine
                 Unpacks Delphine's Cinematique engine's archive files.
                 Should work at least with Future Wars and Operation Stealth.
                 Supports using Operation Stealth's 'vol.cnf' file as input
                 in which case it will try to unpack all the archive files
-                listed in 'vol.cnf'.
+                listed in 'vol.cnf'. Accepts only one input file.
 
                 Example of usage:
-                extract_cine [input file] [output directory]
+                extract_cine <infile>
 
         extract_kyra
                 Unpacks .PAK files from Kyrandia games.
@@ -31,9 +35,12 @@
                 all WESTWOOD.### files for that, since they are one big package
                 file splitted into several, so with -x you will extract *all*
                 files from the installer files.
+				
+				Takes some additional arguments, run extract_kyra --help for
+				details.
                 
                 Example of usage:
-                extract_kyra [params] <file>
+                extract_kyra -x [-o outputdir] <infile>
                 
         extract_loom_tg16
                 Extracts data files from the PC-Engine version of Loom.
@@ -41,33 +48,34 @@
                 to dump the code tracks on the CD.
                 
                 Example of usage:
-                extract_loom_tg16 <code_##.ISO>
+                extract_loom_tg16 [-o outputdir] <infile>
 
         extract_mm_apple
                 Extracts data files from the Apple II version of Maniac
                 Mansion.
                 
                 Example of usage:
-                extract_mm_apple <disk1.dsk> <disk2.dsk>
+                extract_mm_apple [-o outputdir] <disk1.dsk> <disk2.dsk>
 
         extract_mm_c64
                 Extracts data files from the Commodore 64 version of Maniac
                 Mansion.
 
                 Example of usage:
-                extract_mm_apple <disk1.d64> <disk2.d64>
+                extract_mm_apple [-o outputdir] <disk1.d64> <disk2.d64>
 
         extract_mm_nes
                 Extracts data files from the NES version of Maniac Mansion.
-
+				Japanese version is _not_ supported.
+				
                 Example of usage:
-                extract_mm_nes <file.PRG>
+                extract_mm_nes [-o outputdir] <infile.PRG>
 
         extract_parallaction
                 Extracts the contents of archives used by Nippon Safes
 
                 Example of usage:
-                extract_parallaction [--small] <file> <outputdir>
+                extract_parallaction [--small] [-o outputdir] <infile>
                 
         extract_scumm_mac
                 Extracts Macintosh "single file" SCUMM games into their
@@ -77,29 +85,39 @@
                 format.
 
                 Example of usage:
-                extract_scumm_mac <file>
+                extract_scumm_mac [-o outputdir] <infile>
 
         extract_zak_c64
                 Extracts data files from the Commodore 64 version of Zak
                 McKracken.
 
                 Example of usage:
-                extract_zak_c64 <disk1.d64> <disk2.d64>
+                extract_zak_c64 [-o outputdir] <disk1.d64> <disk2.d64>
 
         extract_gob_stk
                 Extracts data files from STK/ITK files of Coktel Vision
                 games.
 
                 Example of usage:
-                extract_gob_stk <file>
+                extract_gob_stk [-o outputdir] <infile>
 
 Compression Tools:
+		All compression tools work on the general format
+			compress [mode] [mode params] [-o output] <infile>
+		mode is either --mp3, --vorbis or --flac, the specifci mode params 
+		can be found by running the tool with --help.
+		output and input are for some tools a directory, for some a file.
+		
+
         compress_agos
                 Used to compress the Feeble Files or Simon the Sorcerer 1/2
                 voc/wav files to MP3, Vorbis or FLAC.
 
                 Example of usage:
-                compress_agos [params] <file | mac> 
+                compress_agos [mode params] [--mac] [-o outputfile] <infile>
+				
+				Specify --mac for the mac version (obviously).
+				Default output is input with changed extension.
 
         compress_kyra
                 Used to compress The Legend of Kyrandia, The Legend of
@@ -108,9 +126,9 @@
                 MP3, Vorbis or FLAC.
 
                 Examples of usage:
-                compress_kyra [params] GEMCUT.VRM inputdir/ outputdir/
-                compress_kyra [params] BATH1.AUD inputdir/ outputdir/
-                compress_kyra [params] ANYTALK.TLK inputdir/ outputdir/
+                compress_kyra [mode params] [-o outputdir] GEMCUT.VRM
+                compress_kyra [mode params] [-o outputdir] BATH1.AUD
+                compress_kyra [mode params] [-o outputdir] ANYTALK.TLK
 
                 Note: You have to keep the file extension the tool will append
                 else it will NOT work. Use it as shown above, copy all speech
@@ -122,17 +140,20 @@
                 and allow optional MP3, Vorbis or FLAC compression.
 
                 Example of usage:
-                compress_queen [params] queen.1
+                compress_queen [mode params] [-o outputfile] queen.1
+				
+				Default output file is "queen.1c"
 
         compress_saga
                 Used to compress SAGA engine digital sound files to MP3, Vorbis
                 or FLAC. 
 
                 Example of usage:
-                compress_saga [params] <file>
+                compress_saga [mode params] [-o outputfile] <infile>
 
                 Where <file> is the sound file you with to compress, without the
                 extension.
+				Default output file is input file with the extensions ".cmp"
 
                 For Inherit the Earth, the digital music (music.rsc), speech 
                 (voices.rsc or "inherit the earth voices") and sound effects
@@ -152,7 +173,9 @@
                 or FLAC.
 
                 Example of usage:
-                compress_scumm_bun [params] <file> <inputdir> <outputdir>
+                compress_scumm_bun [mode params] [-o outputfile] <infile>
+				
+				Default outputfile is inputfile with the extension ".bun"
 
                 Please note that FLAC compression will produce larger files
                 than the original, for The Curse of Monkey Island!
@@ -161,6 +184,11 @@
                 Compresses '.san' smush animation files. It uses lossless
                 zlib for compressing FOBJ gfx chunks inside a san file.
                 It also can create a separate Ogg file with the audio track.
+				
+                Example of usage:
+				compress_scumm_san [mode params] [-o outputfile] <infile>
+				
+				Default output is inputfile with the extension ".san"
 
                 In order to use such compressed files, your ScummVM binary
                 must have been built with zlib support enabled (you can find
@@ -181,7 +209,10 @@
                 or .sof (FLAC).
 
                 Example of usage:
-                compress_scumm_sou [params] monster.sou
+                compress_scumm_sou [mode params] [-o outpufile] <infile>
+				
+				Default output file is inputfile with changed extensions,
+				depends on the compression method used.
 
         compress_sword1
                 Used to compress Broken Sword 1's music and speech .clu
@@ -210,7 +241,10 @@
                 required to play the game under ScummVM.
 
                 Example of usage:
-                compress_touche [params] <inputdir> <outputdir>
+                compress_touche [mode params] [-o outputfile] <infile>
+				
+				Default outpufile is infile with modified extension (depends
+				on compression method).
 
         compress_tucker
                 Used to compress .wav files from FX/MUSIC/SPEECH directories

Modified: tools/branches/gsoc2009-gui/compress_agos.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_agos.cpp	2009-06-11 23:49:06 UTC (rev 41456)
+++ tools/branches/gsoc2009-gui/compress_agos.cpp	2009-06-12 00:19:43 UTC (rev 41457)
@@ -29,17 +29,15 @@
 
 static CompressMode gCompMode = kMP3Mode;
 
-static void end(Filename *inputPath) {
+static void end(Filename *outPath) {
 	int size;
 	char fbuf[2048];
 
-	inputPath->setExtension(audio_extensions[gCompMode]);
-
 	fclose(output_snd);
 	fclose(output_idx);
 	fclose(input);
 
-	output_idx = fopen(inputPath->getFullPath(), "wb");
+	output_idx = fopen(outPath->getFullPath(), "wb");
 
 	input = fopen(TEMP_IDX, "rb");
 	while ((size = fread(fbuf, 1, 2048, input)) > 0) {
@@ -241,14 +239,14 @@
 	}
 }
 
-const char *helptext = "\nUsage: %s [params] [--mac] <file>\n" kCompressionAudioHelp;
+const char *helptext = "\nUsage: %s [mode] [mode params] [--mac] <infile>\n" kCompressionAudioHelp;
 
 int main(int argc, char *argv[]) {
 	bool convertMac = false;
 
-	Filename inpath;
+	Filename inpath, outpath;
 	int first_arg = 1;
-//	int last_arg = argc - 1;
+	int last_arg = argc - 1;
 
 	parseHelpArguments(argv, argc, helptext);
 
@@ -260,8 +258,28 @@
 		exit(2);
 	}
 
+	if(strcmp(argv[first_arg], "--mac") == 0) {
+		++first_arg;
+		convertMac = true;
+	}
+	
+	// Now we try to find the proper output file
+	// also make sure we skip those arguments
+	if (parseOutputFileArguments(&outpath, argv, argc, first_arg))
+		first_arg += 2;
+	else if (parseOutputFileArguments(&outpath, argv, argc, last_arg - 2))
+		last_arg -= 2;
+	else 
+		// Just leave it empty, we just change extension of input file
+		;
+
 	inpath.setFullPath(argv[first_arg]);
 
+	if(outpath.empty()) {
+		outpath = inpath;
+		outpath.setExtension(audio_extensions[gCompMode]);
+	}
+
 	if (convertMac) {
 		convert_mac(&inpath);
 		inpath.setFullName("simon2");
@@ -269,7 +287,7 @@
 		convert_pc(&inpath);
 	}
 
-	end(&inpath);
+	end(&outpath);
 
 	return(0);
 }

Modified: tools/branches/gsoc2009-gui/compress_gob.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_gob.cpp	2009-06-11 23:49:06 UTC (rev 41456)
+++ tools/branches/gsoc2009-gui/compress_gob.cpp	2009-06-12 00:19:43 UTC (rev 41457)
@@ -45,8 +45,9 @@
 
 byte *packData(byte *src, uint32 &size);
 
+const char *helptext = "\nUsage: %s [-o <output> = out.stk] <input file>\n";
+
 int main(int argc, char **argv) {
-	char *outFilename;
 	Chunk *chunks;
 	FILE *stk;
 	FILE *gobConf;
@@ -56,7 +57,7 @@
 	int last_arg = argc - 1;
 
 	// Check if we should display some helpful text
-	parseHelpArguments(argv, argc, "\nUsage: %s [-o <output> = out.stk] <input file>\n");
+	parseHelpArguments(argv, argc, helptext);
 
 	// Now we try to find the proper output
 	// also make sure we skip those arguments
@@ -79,8 +80,8 @@
 	outpath.setExtension(".stk");
 
 	// Open output filk
-	if (!(stk = fopen(outFilename, "wb")))
-		error("Couldn't create file \"%s\"", outFilename);
+	if (!(stk = fopen(outpath.getFullPath(), "wb")))
+		error("Couldn't create file \"%s\"", outpath.getFullPath());
 
 	// Read the input into memory
 	chunks = readChunkConf(gobConf, chunkCount);

Modified: tools/branches/gsoc2009-gui/compress_kyra.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_kyra.cpp	2009-06-11 23:49:06 UTC (rev 41456)
+++ tools/branches/gsoc2009-gui/compress_kyra.cpp	2009-06-12 00:19:43 UTC (rev 41457)
@@ -31,7 +31,7 @@
 
 static CompressMode gCompMode = kMP3Mode;
 
-const char *helptext = "\nUsage: %s [params] [mode params] [-o out = ] <infile>\n" kCompressionAudioHelp;
+const char *helptext = "\nUsage: %s [mode] [mode params] [-o out = ] <infile>\n" kCompressionAudioHelp;
 
 int main(int argc, char *argv[]) {
 	Filename inpath, outpath;

Modified: tools/branches/gsoc2009-gui/compress_queen.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_queen.cpp	2009-06-11 23:49:06 UTC (rev 41456)
+++ tools/branches/gsoc2009-gui/compress_queen.cpp	2009-06-12 00:19:43 UTC (rev 41457)
@@ -160,7 +160,7 @@
 	}
 }
 
-void createFinalFile(Filename *inputPath) {
+void createFinalFile(Filename *outPath) {
 	FILE *inTbl, *inData, *outFinal;
 	int i;
 	uint32 dataStartOffset;
@@ -170,10 +170,10 @@
 	checkOpen(inTbl, TEMP_TBL);
 	inData = fopen(TEMP_DAT, "rb");
 	checkOpen(inData, TEMP_DAT);
-	inputPath->setFullName(FINAL_OUT);
-	outFinal = fopen(inputPath->getFullPath(), "wb");
-	checkOpen(outFinal, inputPath->getFullPath());
 
+	outFinal = fopen(outPath->getFullPath(), "wb");
+	checkOpen(outFinal, outPath->getFullPath());
+
 	dataStartOffset = fileSize(inTbl) + EXTRA_TBL_HEADER;
 	dataSize = fileSize(inData);
 
@@ -206,7 +206,7 @@
 	unlink(TEMP_DAT);
 }
 
-const char *helptext = "\nUsage: %s [params] queen.1\n" kCompressionAudioHelp;
+const char *helptext = "\nUsage: %s [mode] [mode params] [-o outputfile] <inputfile (queen.1)>\n" kCompressionAudioHelp;
 
 int main(int argc, char *argv[]) {
 	FILE *inputData, *inputTbl, *outputTbl, *outputData, *tmpFile, *compFile;
@@ -234,12 +234,17 @@
 		first_arg += 2;
 	else if (parseOutputFileArguments(&outpath, argv, argc, last_arg - 2))
 		last_arg -= 2;
-	else
-		// Standard output
-		outpath.setFullPath("out");
+	else 
+		// Just leave it empty, we just change extension of input file
+		;
 
 	inpath.setFullPath(argv[first_arg]);
 
+	if(outpath.empty()) {
+		outpath = inpath;
+		outpath.setFullName(FINAL_OUT);
+	}
+
 	/* Open input file (QUEEN.1) */
 	inputData = fopen(inpath.getFullPath(), "rb");
 	checkOpen(inputData, inpath.getFullPath());
@@ -378,7 +383,7 @@
 	fclose(inputData);
 
 	/* Merge the temporary table and temporary datafile to create final file */
-	createFinalFile(&inpath);
+	createFinalFile(&outpath);
 
 	return 0;
 }

Modified: tools/branches/gsoc2009-gui/compress_saga.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_saga.cpp	2009-06-11 23:49:06 UTC (rev 41456)
+++ tools/branches/gsoc2009-gui/compress_saga.cpp	2009-06-12 00:19:43 UTC (rev 41457)
@@ -305,8 +305,8 @@
 
 		Audio::AudioStream *voxStream = Audio::makeADPCMStream(&inputFileStream, inputSize, Audio::kADPCMOki);
 		buffer = (byte *)malloc(sampleSize);
-        uint32 voxSize = voxStream->readBuffer((int16*)buffer, inputSize * 2);
-        if (voxSize != inputSize * 2)
+		uint32 voxSize = voxStream->readBuffer((int16*)buffer, inputSize * 2);
+		if (voxSize != inputSize * 2)
 			error("Wrong VOX output size");
 		writeBufferToFile((uint8 *)buffer, sampleSize, TEMP_RAW);
 		free(buffer);
@@ -436,14 +436,13 @@
 	printf("Done!\n");
 }
 
-const char *helptext = "\nUsage: %s [params] [mode params] [-o out = 'infile.cmp'] <infile>\n" kCompressionAudioHelp;
+const char *helptext = "\nUsage: %s [mode] [mode params] [-o outputfile = infile.cmp] <inputfile>\n" kCompressionAudioHelp;
 
 int main(int argc, char *argv[]) {
 	Filename inpath, outpath;
 	int first_arg = 1;
 	int last_arg = argc - 1;
 
-
 	parseHelpArguments(argv, argc, helptext);
 
 	// compression mode
@@ -460,7 +459,10 @@
 	if (parseOutputFileArguments(&outpath, argv, argc, first_arg))
 		first_arg += 2;
 	else if (parseOutputFileArguments(&outpath, argv, argc, last_arg - 2))
-		last_arg -= 2;;
+		last_arg -= 2;
+	else 
+		// Just leave it empty, we just change extension of input file
+		;
 
 	inpath.setFullPath(argv[first_arg]);
 

Modified: tools/branches/gsoc2009-gui/compress_scumm_bun.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_scumm_bun.cpp	2009-06-11 23:49:06 UTC (rev 41456)
+++ tools/branches/gsoc2009-gui/compress_scumm_bun.cpp	2009-06-12 00:19:43 UTC (rev 41457)
@@ -1088,7 +1088,7 @@
 	cbundleCurIndex++;
 }
 
-const char *helptext = "\nUsage: %s [mode] [mode-params] [-o outputfile = inputfile.san] <inputfile>\n";
+const char *helptext = "\nUsage: %s [mode] [mode-params] [-o outputfile = inputfile.bun] <inputfile>\n";
 
 int main(int argc, char *argv[]) {
 	Filename inpath, outpath;

Modified: tools/branches/gsoc2009-gui/compress_scumm_san.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_scumm_san.cpp	2009-06-11 23:49:06 UTC (rev 41456)
+++ tools/branches/gsoc2009-gui/compress_scumm_san.cpp	2009-06-12 00:19:43 UTC (rev 41457)
@@ -634,7 +634,7 @@
 
 // TODO
 // Feature set seems more limited than what kCompressionAudioHelp contains
-const char *helptext = "\nUsage: %s [mode] [mode-params] <file> <inputdir> <outputdir>\n" kCompressionAudioHelp;
+const char *helptext = "\nUsage: %s [mode] [mode-params] [-o outpufile = inputfile.san] <inputfile>\n" kCompressionAudioHelp;
 
 int main(int argc, char *argv[]) {
 	Filename inpath, outpath;
@@ -671,25 +671,24 @@
 		// Just leave it empty, we just change extension of input file
 		;
 
+	inpath.setFullPath(argv[first_arg]);
+
+	if(outpath.empty()) {
+		// Change extension for output
+		outpath = inpath;
+		outpath.setExtension(".san");
+	}
+
 	// We need this path for some functions, alot quicker than rewriting
 	// them to use the Filename class
 	outpath.getPath(outdir);
 
-
-	inpath.setFullPath(argv[first_arg]);
-
 	FILE *input = fopen(inpath.getFullPath(), "rb");
 	if (!input) {
 		printf("Cannot open file: %s\n", inpath.getFullPath());
 		exit(-1);
 	}
 
-	if(outpath.empty()) {
-		// Change extension for output
-		outpath = inpath;
-		outpath.setExtension(".san");
-	}
-
 	FILE *output = fopen(outpath.getFullPath(), "wb");
 	if (!output) {
 		printf("Cannot open file: %s\n", outpath.getFullPath());

Modified: tools/branches/gsoc2009-gui/compress_sword2.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_sword2.cpp	2009-06-11 23:49:06 UTC (rev 41456)
+++ tools/branches/gsoc2009-gui/compress_sword2.cpp	2009-06-12 00:19:43 UTC (rev 41457)
@@ -96,7 +96,7 @@
 			g_output_filename = OUTPUT_OGG;
 			break;
 		case kFlacMode:
-			g_output_filename = OUTPUT_FLA;
+			g_output_filename = OUTPUT_FLAC;
 			break;
 		default:
 			printf(helptext, argv[0]);


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