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

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Tue Dec 15 19:23:00 CET 2009


Revision: 46387
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46387&view=rev
Author:   strangerke
Date:     2009-12-15 18:22:59 +0000 (Tue, 15 Dec 2009)

Log Message:
-----------
Fix the behavior in the GUI version

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

Modified: tools/branches/gsoc2009-gui/extract_gob_stk.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_gob_stk.cpp	2009-12-15 12:56:10 UTC (rev 46386)
+++ tools/branches/gsoc2009-gui/extract_gob_stk.cpp	2009-12-15 18:22:59 UTC (rev 46387)
@@ -23,8 +23,8 @@
 #include "util.h"
 #include "extract_gob_stk.h"
 
+#define confSTK10 "STK10"
 #define confSTK21 "STK21"
-#define confSTK10 "STK10"
 
 struct ExtractGobStk::Chunk {
 	char name[64];
@@ -46,7 +46,7 @@
 	_inputPaths.push_back(input);
 
 	_shorthelp = "Extracts the files from a Stick file used by 'gob' engine (.STK/.ITK/.LTK).";
-	_helptext = "\nUsage: " + getName() + " [-o outputname] stickname\nwhere\n  ouputname is used to force the gob config filename (used by compress_gob)\n  stickname is the name of the file to extract/decompress";
+	_helptext  = "Usage: " + getName() + " [-o outputname] stickname\nwhere\n  ouputname is used to force the gob config filename (used by compress_gob)\n  stickname is the name of the file to extract/decompress";
 }
 
 ExtractGobStk::~ExtractGobStk() {
@@ -71,6 +71,12 @@
 		_outputPath.setFullName(_outputPath.getFullName() + inpath.getExtension());
 	}
 
+	if (_outputPath.directory()) {
+		_outputPath.setFullName(inpath.getFullName());
+		_outputPath.setExtension("");
+		_outputPath.setFullName(_outputPath.getFullName() + inpath.getExtension());
+	}
+
 	_outputPath.setExtension(".gob");
 
 	gobConf.open(_outputPath.getFullPath(), "w");
@@ -88,7 +94,7 @@
 		readChunkList(stk, gobConf);
 	}
 
-	print("config file created: %s\n", _outputPath.getFullName().c_str());
+	print("config file created: %s\n", _outputPath.getFullPath().c_str());
 
 	extractChunks(_outputPath, stk);
 }
@@ -254,7 +260,7 @@
 	byte *unpackedData = NULL;
 
 	while (curChunk != 0) {
-		print("Extracting \"%s\"", curChunk->name);
+		print("Extracting \"%s\"\n", curChunk->name);
 
 		outpath.setFullName(curChunk->name);
 		File chunkFile(outpath, "wb");
@@ -289,7 +295,6 @@
 			}
 			delete[] data;
 		}
-
 		curChunk = curChunk->next;
 	}
 }


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