[Scummvm-cvs-logs] scummvm-tools master -> 8a4665dc2c29f47a13c4934becbfbd98eec887c5

clone2727 clone2727 at gmail.com
Sat Sep 15 23:29:54 CEST 2012


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .

Summary:
582e9a8fe7 TOOLS: Cleanup extract_scumm_mac
8a4665dc2c TOOLS: Update version to 1.6.0


Commit: 582e9a8fe76bc36f75a5f0f2202a3815ef2c72c6
    https://github.com/scummvm/scummvm-tools/commit/582e9a8fe76bc36f75a5f0f2202a3815ef2c72c6
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2012-09-15T14:16:45-07:00

Commit Message:
TOOLS: Cleanup extract_scumm_mac

Changed paths:
    engines/scumm/extract_scumm_mac.cpp



diff --git a/engines/scumm/extract_scumm_mac.cpp b/engines/scumm/extract_scumm_mac.cpp
index 76a2e39..fe337d5 100644
--- a/engines/scumm/extract_scumm_mac.cpp
+++ b/engines/scumm/extract_scumm_mac.cpp
@@ -25,11 +25,7 @@
 
 #include <algorithm>
 
-/* this makes extract_scumm_mac convert extracted file names to lower case */
-#define CHANGECASE
-
 ExtractScummMac::ExtractScummMac(const std::string &name) : Tool(name, TOOLTYPE_EXTRACTION) {
-
 	ToolInput input;
 	input.format = "*.*";
 	_inputPaths.push_back(input);
@@ -50,96 +46,60 @@ InspectionMatch ExtractScummMac::inspectInput(const Common::Filename &filename)
 }
 
 void ExtractScummMac::execute() {
-	unsigned long file_record_off, file_record_len;
-	unsigned long file_off, file_len;
-	unsigned long data_file_len;
-	char file_name[0x20];
-	char *buf;
-	unsigned long i;
-	int j;
+	Common::Filename inPath(_inputPaths[0].path);
+	Common::Filename outPath(_outputPath);
 
-	Common::Filename inpath(_inputPaths[0].path);
-	Common::Filename outpath(_outputPath);
+	if (outPath.empty())
+		outPath.setFullPath("./");
 
-	if (outpath.empty())
-		outpath.setFullPath("./");
+	Common::File ifp(inPath, "rb");
 
-	Common::File ifp(inpath, "rb");
+	// Get the length of the data file to use for consistency checks
+	uint32 dataFileLength = ifp.size();
 
-	/* Get the length of the data file to use for consistency checks */
-	data_file_len = ifp.size();
+	// Read offset and length to the file records
+	uint32 fileRecordOffset = ifp.readUint32BE();
+	uint32 fileRecordLength = ifp.readUint32BE();
 
-	/* Read offset and length to the file records */
-	file_record_off = ifp.readUint32BE();
-	file_record_len = ifp.readUint32BE();
+	// Do a quick check to make sure the offset and length are good
+	if (fileRecordOffset + fileRecordLength > dataFileLength)
+		error("File records out of bounds");
 
-	/* Do a quick check to make sure the offset and length are good */
-	if (file_record_off + file_record_len > data_file_len) {
-		error("\'%s\'. file records out of bounds.", inpath.getFullPath().c_str());
-	}
+	// Do a little consistancy check on fileRecordLength
+	if (fileRecordLength % 0x28)
+		error("File record length not multiple of 40");
 
-	/* Do a little consistancy check on file_record_length */
-	if (file_record_len % 0x28) {
-		error("\'%s\'. file record length not multiple of 40.", inpath.getFullPath().c_str());
-	}
+	// Extract the files
+	for (uint32 i = 0; i < fileRecordLength; i += 0x28) {
+		// read a file record
+		ifp.seek(fileRecordOffset + i, SEEK_SET);
 
-	/* Extract the files */
-	for (i = 0; i < file_record_len; i += 0x28) {
-		/* read a file record */
-		ifp.seek(file_record_off + i, SEEK_SET);
-
-		file_off = ifp.readUint32BE();
-		file_len = ifp.readUint32BE();
-		ifp.read_throwsOnError(file_name, 0x20);
-
-		if (!file_name[0])
-			error("\'%s\'. file has no name.", inpath.getFullPath().c_str());
-
-		print("extracting \'%s\'", file_name);
-
-		/* For convenience compatibility with scummvm (and case sensitive
-		 * file systems) change the file name to lowercase.
-		 *
-		 * if i ever add the ability to pass flags on the command
-		 * line, i will make this optional, but i really don't
-		 * see the point to bothering
-		 */
-		for (j = 0; j < 0x20; j++) {
-			if (!file_name[j]) {
-				break;
-			}
-
-#ifdef CHANGECASE
-			file_name[j] = tolower(file_name[j]);
-#endif
-		}
+		uint32 fileOffset = ifp.readUint32BE();
+		uint32 fileLength = ifp.readUint32BE();
 
-		if (j == 0x20) {
-			file_name[0x1f] = 0;
-			warning("\'%s\'. file name not null terminated.", file_name);
-			print("data file \'%s\' may be not a file extract_scumm_mac can extract.", inpath.getFullPath().c_str());
-		}
+		char fileName[0x21];
+		ifp.read_throwsOnError(fileName, 0x20);
+		fileName[0x20] = 0;
 
-		print(", saving as \'%s\'", file_name);
+		if (!fileName[0])
+			error("File has no name");
 
-		/* Consistency check. make sure the file data is in the file */
-		if (file_off + file_len > data_file_len) {
-			error("\'%s\'. file out of bounds.", inpath.getFullPath().c_str());
-		}
+		print("Extracting %s...", fileName);
 
-		/* Write a file */
-		ifp.seek(file_off, SEEK_SET);
+		// Consistency check. make sure the file data is in the file
+		if (fileOffset + fileLength > dataFileLength)
+			error("File out of bounds");
 
-		outpath.setFullName(file_name);
-		Common::File ofp(outpath, "wb");
+		// Write a file
+		ifp.seek(fileOffset, SEEK_SET);
 
-		if (!(buf = (char *)malloc(file_len))) {
-			error("Could not allocate %ld bytes of memory.", file_len);
-		}
+		outPath.setFullName(fileName);
+		Common::File ofp(outPath, "wb");
 
-		ifp.read_throwsOnError(buf, file_len);
-		ofp.write(buf, file_len);
-		free(buf);
+		byte *buf = new byte[fileLength];
+		ifp.read_throwsOnError(buf, fileLength);
+		ofp.write(buf, fileLength);
+		delete[] buf;
 	}
 }
 


Commit: 8a4665dc2c29f47a13c4934becbfbd98eec887c5
    https://github.com/scummvm/scummvm-tools/commit/8a4665dc2c29f47a13c4934becbfbd98eec887c5
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2012-09-15T14:26:23-07:00

Commit Message:
TOOLS: Update version to 1.6.0

Changed paths:
    dists/macosx/Info.plist
    dists/scummvmtools.rc
    dists/win32/scummvm-tools.nsi
    internal_version.h
    update-version.pl



diff --git a/dists/macosx/Info.plist b/dists/macosx/Info.plist
index 77e4462..d5c73b0 100644
--- a/dists/macosx/Info.plist
+++ b/dists/macosx/Info.plist
@@ -9,7 +9,7 @@
 	<key>CFBundleExecutable</key>
 	<string>scummvm-tools</string>
 	<key>CFBundleGetInfoString</key>
-	<string>1.5.0git, Copyright 2001-2012 The ScummVM team</string>
+	<string>1.6.0git, Copyright 2001-2012 The ScummVM team</string>
 	<key>CFBundleIconFile</key>
 	<string>scummvmtools.icns</string>
 	<key>CFBundleIdentifier</key>
@@ -21,9 +21,9 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.5.0git</string>
+	<string>1.6.0git</string>
 	<key>CFBundleVersion</key>
-	<string>1.5.0git</string>
+	<string>1.6.0git</string>
 	<key>NSAppleScriptEnabled</key>
 	<false/>
 	<key>NSHumanReadableCopyright</key>
diff --git a/dists/scummvmtools.rc b/dists/scummvmtools.rc
index 629fe3c..3c5b21e 100644
--- a/dists/scummvmtools.rc
+++ b/dists/scummvmtools.rc
@@ -10,8 +10,8 @@
 IDI_ICON               ICON    DISCARDABLE     "gui/media/scummvmtools.ico"
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION     1,5,0,0
- PRODUCTVERSION  1,5,0,0
+ FILEVERSION     1,6,0,0
+ PRODUCTVERSION  1,6,0,0
  FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK
 #ifdef _DEBUG
  FILEFLAGS       VS_FF_DEBUG
@@ -28,13 +28,13 @@ BEGIN
         BEGIN
             VALUE "Comments", "Look! A three headed monkey (TM)! .. Nice use of the TM!\0"
             VALUE "FileDescription", "http://www.scummvm.org/\0"
-            VALUE "FileVersion", "1.5.0git\0"
+            VALUE "FileVersion", "1.6.0git\0"
             VALUE "InternalName", "scummvm\0"
             VALUE "LegalCopyright", "Copyright © 2001-2012 The ScummVM Team\0"
             VALUE "LegalTrademarks", "'SCUMM', and all SCUMM games are a TM of LucasArts. Simon The Sorcerer is a TM of AdventureSoft. Beneath a Steel Sky and Broken Sword are a TM of Revolution. Flight of the Amazon Queen is a TM of John Passfield and Steve Stamatiadis. \0"
             VALUE "OriginalFilename", "scummvm-tools.exe\0"
             VALUE "ProductName", "ScummVM Tools\0"
-            VALUE "ProductVersion", "1.5.0git\0"
+            VALUE "ProductVersion", "1.6.0git\0"
         END
     END
 
diff --git a/dists/win32/scummvm-tools.nsi b/dists/win32/scummvm-tools.nsi
index b636bf6..ee6d9f2 100644
--- a/dists/win32/scummvm-tools.nsi
+++ b/dists/win32/scummvm-tools.nsi
@@ -61,7 +61,7 @@ Name "ScummVM Tools"
 # General Symbol Definitions
 #########################################################################################
 !define REGKEY      "Software\ScummVM\$(^Name)"
-!define VERSION     "1.5.0git"
+!define VERSION     "1.6.0git"
 !define COMPANY     "ScummVM Team"
 !define URL         "http://scummvm.org/"
 !define DESCRIPTION "ScummVM Tools Installer. Look! A three headed monkey (TM)!"
@@ -81,7 +81,7 @@ XPStyle  on
 #TargetMinimalOS 5.0    ; Minimal version of windows for installer: Windows 2000 or more recent
                         ; (will build unicode installer with NSIS 2.50+)
 
-VIProductVersion 1.4.0.0
+VIProductVersion 1.6.0.0
 VIAddVersionKey  ProductName      $(^Name)
 VIAddVersionKey  ProductVersion  "${VERSION}"
 VIAddVersionKey  CompanyName     "${COMPANY}"
diff --git a/internal_version.h b/internal_version.h
index aeee93b..db091bd 100644
--- a/internal_version.h
+++ b/internal_version.h
@@ -2,4 +2,4 @@
 #define SCUMMVM_TOOLS_REVISION
 #endif
 
-#define SCUMMVM_TOOLS_VERSION "1.5.0git" SCUMMVM_TOOLS_REVISION
+#define SCUMMVM_TOOLS_VERSION "1.6.0git" SCUMMVM_TOOLS_REVISION
diff --git a/update-version.pl b/update-version.pl
index abde4d5..bbae1dd 100755
--- a/update-version.pl
+++ b/update-version.pl
@@ -33,7 +33,7 @@ print "Setting version to '$VERSION'\n";
 my @subs_files = qw(
 	internal_version.h
 	dists/macosx/Info.plist
-	dists/nsis/scummvm-tools.nsi
+	dists/win32/scummvm-tools.nsi
 	dists/scummvmtools.rc
 	);
 






More information about the Scummvm-git-logs mailing list