[Scummvm-cvs-logs] SF.net SVN: scummvm:[55764] scummvm/trunk

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Fri Feb 4 16:27:56 CET 2011


Revision: 55764
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55764&view=rev
Author:   mthreepwood
Date:     2011-02-04 15:27:56 +0000 (Fri, 04 Feb 2011)

Log Message:
-----------
COMMON: Only take the md5 of the resource fork data section

Since various apps can modify the type/creator of the files, we can't rely on the header of the resource fork to take the md5. I've therefore also recalculated all of the detector entries (all 5 of them) that use the Mac resource fork code.

Modified Paths:
--------------
    scummvm/trunk/common/macresman.cpp
    scummvm/trunk/common/macresman.h
    scummvm/trunk/engines/advancedDetector.cpp
    scummvm/trunk/engines/groovie/detection.cpp
    scummvm/trunk/engines/sci/detection_tables.h

Modified: scummvm/trunk/common/macresman.cpp
===================================================================
--- scummvm/trunk/common/macresman.cpp	2011-02-03 22:20:08 UTC (rev 55763)
+++ scummvm/trunk/common/macresman.cpp	2011-02-04 15:27:56 UTC (rev 55764)
@@ -83,18 +83,25 @@
 	return !_baseFileName.empty() && _mode != kResForkNone;
 }
 
-uint32 MacResManager::getResForkSize() const {
+uint32 MacResManager::getResForkDataSize() const {
 	if (!hasResFork())
 		return 0;
 
-	return _resForkSize;
+	_stream->seek(_resForkOffset + 4);
+	return _stream->readUint32BE();
 }
 
 String MacResManager::computeResForkMD5AsString(uint32 length) const {
 	if (!hasResFork())
 		return String();
 
-	SeekableSubReadStream resForkStream(_stream, _resForkOffset, _resForkOffset + _resForkSize);
+	_stream->seek(_resForkOffset);
+	uint32 dataOffset = _stream->readUint32BE() + _resForkOffset;
+	/* uint32 mapOffset = */ _stream->readUint32BE();
+	uint32 dataLength = _stream->readUint32BE();
+
+
+	SeekableSubReadStream resForkStream(_stream, dataOffset, dataOffset + dataLength);
 	return computeStreamMD5AsString(resForkStream, MIN<uint32>(length, _resForkSize));
 }
 

Modified: scummvm/trunk/common/macresman.h
===================================================================
--- scummvm/trunk/common/macresman.h	2011-02-03 22:20:08 UTC (rev 55763)
+++ scummvm/trunk/common/macresman.h	2011-02-04 15:27:56 UTC (rev 55764)
@@ -134,10 +134,10 @@
 	String getResName(uint32 typeID, uint16 resID) const;
 
 	/**
-	 * Get the size of the resource fork
-	 * @return The size of the resource fork
+	 * Get the size of the data portion of the resource fork
+	 * @return The size of the data portion of the resource fork
 	 */
-	uint32 getResForkSize() const;
+	uint32 getResForkDataSize() const;
 
 	/**
 	 * Calculate the MD5 checksum of the resource fork

Modified: scummvm/trunk/engines/advancedDetector.cpp
===================================================================
--- scummvm/trunk/engines/advancedDetector.cpp	2011-02-03 22:20:08 UTC (rev 55763)
+++ scummvm/trunk/engines/advancedDetector.cpp	2011-02-04 15:27:56 UTC (rev 55764)
@@ -460,7 +460,7 @@
 
 				if (macResMan->open(parent, fname)) {
 					tmp.md5 = macResMan->computeResForkMD5AsString(params.md5Bytes);
-					tmp.size = macResMan->getResForkSize();
+					tmp.size = macResMan->getResForkDataSize();
 					debug(3, "> '%s': '%s'", fname.c_str(), tmp.md5.c_str());
 					filesSizeMD5[fname] = tmp;
 				}

Modified: scummvm/trunk/engines/groovie/detection.cpp
===================================================================
--- scummvm/trunk/engines/groovie/detection.cpp	2011-02-03 22:20:08 UTC (rev 55763)
+++ scummvm/trunk/engines/groovie/detection.cpp	2011-02-04 15:27:56 UTC (rev 55764)
@@ -75,7 +75,7 @@
 	{
 		{
 			"t7g", "",
-			AD_ENTRY1s("T7GMac", "6bdee8d0f9eef6d58d02fcd7deec3fb2", 1830783),
+			AD_ENTRY1s("T7GMac", "acdc4a58dd3f007f65e99b99d78e0bce", 1814029),
 			Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK,
 			Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM
 		},

Modified: scummvm/trunk/engines/sci/detection_tables.h
===================================================================
--- scummvm/trunk/engines/sci/detection_tables.h	2011-02-03 22:20:08 UTC (rev 55763)
+++ scummvm/trunk/engines/sci/detection_tables.h	2011-02-04 15:27:56 UTC (rev 55764)
@@ -681,10 +681,10 @@
 
 	// Gabriel Knight - English Macintosh
 	{"gk1", "", {
-		{"Data1", 0, "7a89c96365a4da5d3b3efdc3a94bab3e", 5831362},
-		{"Data2", 0, "db70638e972c3706e4dc9e01ef3a30ea", 6696048},
-		{"Data3", 0, "d740126293aea176c4f8a6c71634cff4", 3683997},
-		{"Data4", 0, "f6cbf2605f618ce035bed162d66b2b8a", 3233086},
+		{"Data1", 0, "044d3bcd7e5b5bb0393d954ade8053fe", 5814918},
+		{"Data2", 0, "99a0c63febf9e44e12a00f99c00eae0f", 6685352},
+		{"Data3", 0, "f25068b408b09275d8b698866462f578", 3677599},
+		{"Data4", 0, "1cceebbe411b26c860a74f91c337fdf3", 3230086},
 		AD_LISTEND},
 		Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO_NONE },
 
@@ -892,8 +892,8 @@
 	// Hoyle 4 (Hoyle Classic Card Games) - English Macintosh Floppy
 	// VERSION file reports "2.0"
 	{"hoyle4", "", {
-		{"Data1", 0, "afad082944d36ce4d2a9e646efc49da1", 7731536},
-		{"Data2", 0, "615ed2efe969f845cd8f0686af0b06f2", 1543825},
+		{"Data1", 0, "99575fae4579540a314bbedd72d51e8c", 7682887},
+		{"Data2", 0, "7d4bf5bdf3c02edbf35cb8471c84ec13", 1539134},
 		AD_LISTEND},
 		Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO_NOSPEECH	},
 
@@ -1400,8 +1400,8 @@
 	// King's Quest 6 - English Macintosh Floppy
 	// VERSION file reports "1.0"
 	{"kq6", "", {
-		{"Data1", 0, "f3c38a33c94293b8ff0337c1090a4973", 3916479},
-		{"Data2", 0, "b255edf327d7b366dce816b7debf3b94", 15046256},
+		{"Data1", 0, "a183fc0c22fcbd9be4c8800d974b5599", 3892124},
+		{"Data2", 0, "b3722460dfd3097a1fbaf99a21ad8ea5", 15031272},
 		AD_LISTEND},
 		Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO_NOSPEECH	},
 
@@ -2750,8 +2750,8 @@
 	// Quest for Glory 1 VGA Remake - English Macintosh Floppy
 	// VERSION file reports "2.0"
 	{"qfg1vga", "VGA", {
-		{"Data1", 0, "14f26bc75f24bb1ecc94532df17b5371", 1768155},
-		{"Data2", 0, "a7aee8bd46fc9cef7fd3bea93ef173e0", 6586422},
+		{"Data1", 0, "106527ff8756e4e1a795d63d23e8b833", 1752358},
+		{"Data2", 0, "5cdd92033231159c6e9c71d43e9f194d", 6574746},
 		AD_LISTEND},
 		Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO_NOSPEECH	},
 


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