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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Wed Dec 2 02:12:09 CET 2009


Revision: 46236
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46236&view=rev
Author:   peres001
Date:     2009-12-02 01:12:09 +0000 (Wed, 02 Dec 2009)

Log Message:
-----------
Fixed order of parameters in the help text to match the invocation from tools_cli.

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

Modified: tools/branches/gsoc2009-gui/extract_parallaction.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_parallaction.cpp	2009-12-01 22:21:16 UTC (rev 46235)
+++ tools/branches/gsoc2009-gui/extract_parallaction.cpp	2009-12-02 01:12:09 UTC (rev 46236)
@@ -69,6 +69,8 @@
 	return _fileSize;
 }
 
+static int __count;
+
 void Archive::openSubfile(uint32 index) {
 	if (index >= _numFiles)
 		throw ToolException("File index out of bounds.");
@@ -86,8 +88,14 @@
 		_fileSize = getSizeOfPackedSubfile(srcData, srcSize);
 		_fileData = (byte *)malloc(_fileSize);
 
+		printf("unpacking file at position %i: %s [%x]\n", index, _names[index], srcOffset);
+		printf("packed size    = %i\n", srcSize);
+		printf("unpacked size  = %i\n", _fileSize);
+
 		unpackSubfile(srcData, srcSize);
 
+		printf("unpacked bytes = %i\n", __count);
+
 		free(srcData);
 	} else {
 		_fileSize = srcSize;
@@ -221,6 +229,8 @@
 }
 
 void ppdepack(byte *packed, byte *depacked, uint32 plen, uint32 unplen) {
+	__count = 0;
+
 	byte *dest;
 	int n_bits;
 	int idx;
@@ -256,6 +266,8 @@
 				bytes += to_add;
 			} while (to_add == 3);
 
+			__count += (bytes+1);
+
 			for (i = 0; i <= bytes; i++)
 				*--dest = get_bits(8);
 
@@ -283,6 +295,8 @@
 			offset = get_bits(n_bits);
 		}
 
+		__count += (bytes+1);
+
 		for (i = 0; i <= bytes; i++) {
 			dest[-1] = dest[offset];
 			dest--;
@@ -301,7 +315,7 @@
 	_inputPaths.push_back(input);
 
 	_shorthelp = "Extract data files from games built on the Parallaction engine.";
-	_helptext = "\nUsage: " + _name + " [--small] [-o <output dir> = out/] <file>\n" + _shorthelp + "\n";
+	_helptext = "\nUsage: " + _name + " [-o <output dir> = out/] [--small] <file>\n" + _shorthelp + "\n";
 }
 
 void ExtractParallaction::parseExtraArguments() {


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