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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Wed Dec 16 18:35:56 CET 2009


Revision: 46394
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46394&view=rev
Author:   mthreepwood
Date:     2009-12-16 17:35:55 +0000 (Wed, 16 Dec 2009)

Log Message:
-----------
Fix output folders in extract_t7g_mac and some minor cleanup.

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

Modified: tools/branches/gsoc2009-gui/extract_t7g_mac.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_t7g_mac.cpp	2009-12-16 16:52:03 UTC (rev 46393)
+++ tools/branches/gsoc2009-gui/extract_t7g_mac.cpp	2009-12-16 17:35:55 UTC (rev 46394)
@@ -51,14 +51,15 @@
 void ExtractT7GMac::dumpResource(File &infile, std::string name) {
 	// Show the resource details
 	uint32 fileSize = infile.readUint32BE();
-	print("  \"%s\" (%d bytes)\n", name.c_str(), fileSize);
+	print("  \"%s\" (%d bytes)", name.c_str(), fileSize);
 
 	// Read the resource contents
 	byte *buf = new byte[fileSize];
 	
 	try {
 		// Dump the resource to the output file
-		File out(name, "wb");
+		_outputPath.setFullName(name);
+		File out(_outputPath, "wb");
 		infile.read_throwsOnError(buf, fileSize);
 		out.write(buf, fileSize);
 	} catch (...) {
@@ -89,6 +90,9 @@
 
 void ExtractT7GMac::execute() {
 	File infile(_inputPaths[0].path, "rb");
+	
+	if (_outputPath.empty())
+		_outputPath.setFullPath("./");
 
 	// Read the resource fork header
 	infile.seek(offsetResFork, SEEK_SET);
@@ -122,7 +126,7 @@
 			case MKID_BE('INST'):
 			case MKID_BE('T7GM'):
 			{
-				print("Extracting \"%s\" resources\n", resType);
+				print("Extracting \"%s\" resources", resType);
 				uint16 numRes = infile.readUint16BE();
 				uint32 offsetRefList = offsetResTypes + infile.readUint16BE();
 
@@ -130,7 +134,7 @@
 				break;
 			}
 			default:
-				print("Skipping \"%s\" resources\n", resType);
+				print("Skipping \"%s\" resources", resType);
 				break;
 		}
 	}


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