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

Remere at users.sourceforge.net Remere at users.sourceforge.net
Sat Aug 8 22:06:09 CEST 2009


Revision: 43138
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43138&view=rev
Author:   Remere
Date:     2009-08-08 20:06:09 +0000 (Sat, 08 Aug 2009)

Log Message:
-----------
*compress_queen now outputs to a directory.

Modified Paths:
--------------
    tools/branches/gsoc2009-gui/compress_queen.cpp

Modified: tools/branches/gsoc2009-gui/compress_queen.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_queen.cpp	2009-08-08 20:03:05 UTC (rev 43137)
+++ tools/branches/gsoc2009-gui/compress_queen.cpp	2009-08-08 20:06:09 UTC (rev 43138)
@@ -90,15 +90,14 @@
 };
 
 CompressQueen::CompressQueen(const std::string &name) : CompressionTool(name, TOOLTYPE_COMPRESSION) {
-	_outputToDirectory = false;
 	_supportsProgressBar = true;
 	
 	ToolInput input;
 	input.format = "queen.1";
 	_inputPaths.push_back(input);
 
-	_shorthelp = "Used to compress Flight of the Amazon Queen data files.";
-	_helptext = "\nUsage: " + getName() + " [mode] [mode params] [-o outputfile] <inputfile (queen.1)>\n";
+	_shorthelp = "Used to compress Flight of the Amazon Queen data files. Output filename is " + std::string(FINAL_OUT) + " .";
+	_helptext = "\nUsage: " + getName() + " [mode] [mode params] [-o outputdir] <inputfile (queen.1)>\n\t" + _shorthelp + "\n";
 }
 
 const CompressQueen::GameVersion *CompressQueen::detectGameVersion(uint32 size) {
@@ -132,14 +131,16 @@
 	}
 }
 
-void CompressQueen::createFinalFile(Filename *outPath) {
+void CompressQueen::createFinalFile(Filename outPath) {
 	int i;
 	uint32 dataStartOffset;
 	uint32 dataSize;
 
+	outPath.setFullName(FINAL_OUT);
+
 	File inTbl(TEMP_TBL, "rb");
 	File inData(TEMP_DAT, "rb");
-	File outFinal(*outPath, "wb");
+	File outFinal(outPath, "wb");
 
 	dataStartOffset = inTbl.size() + EXTRA_TBL_HEADER;
 	dataSize = inData.size();
@@ -178,10 +179,8 @@
 	Filename inpath(_inputPaths[0].path);
 	Filename &outpath = _outputPath;
 
-	if (outpath.empty()) {
+	if (outpath.empty())
 		outpath = inpath;
-		outpath.setFullName(FINAL_OUT);
-	}
 
 	/* Open input file (QUEEN.1) */
 	inputData.open(inpath, "rb");
@@ -317,7 +316,7 @@
 	outputData.close();
 
 	/* Merge the temporary table and temporary datafile to create final file */
-	createFinalFile(&outpath);
+	createFinalFile(outpath);
 }
 
 #ifdef STANDALONE_MAIN


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