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

sev at users.sourceforge.net sev at users.sourceforge.net
Thu Jan 25 01:37:12 CET 2007


Revision: 25172
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25172&view=rev
Author:   sev
Date:     2007-01-24 16:37:12 -0800 (Wed, 24 Jan 2007)

Log Message:
-----------
Use file sizes in detection too.

Modified Paths:
--------------
    scummvm/trunk/common/advancedDetector.cpp
    scummvm/trunk/engines/saga/sagagame.cpp
    scummvm/trunk/engines/saga/sagagame.h

Modified: scummvm/trunk/common/advancedDetector.cpp
===================================================================
--- scummvm/trunk/common/advancedDetector.cpp	2007-01-25 00:36:48 UTC (rev 25171)
+++ scummvm/trunk/common/advancedDetector.cpp	2007-01-25 00:37:12 UTC (rev 25172)
@@ -197,7 +197,9 @@
 	StringSet filesList;
 
 	typedef StringMap StringMap;
+	typedef HashMap<String, int32, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> IntMap;
 	StringMap filesMD5;
+	IntMap filesSize;
 
 	String tstr, tstr2;
 	
@@ -224,6 +226,8 @@
 	
 	if (fslist != 0) {
 		for (FSList::const_iterator file = fslist->begin(); file != fslist->end(); ++file) {
+			Common::File f;
+
 			if (file->isDirectory()) continue;
 			tstr = file->name();
 			tstr.toLowercase();
@@ -237,6 +241,11 @@
 			}
 			filesMD5[tstr] = String(md5str);
 			filesMD5[tstr2] = String(md5str);
+
+			if (f.open(file->path())) {
+				filesSize[tstr] = filesSize[tstr2] = (int32)f.size();
+				f.close();
+			}
 		}
 	} else {
 		File testFile;
@@ -248,6 +257,7 @@
 			debug(3, "+ %s", tstr.c_str());
 			if (!filesMD5.contains(tstr)) {
 				if (testFile.open(file->_key)) {
+					filesSize[tstr] = filesSize[tstr2] = (int32)testFile.size();
 					testFile.close();
 
 					if (md5_file(file->_key.c_str(), md5sum, params.md5Bytes)) {
@@ -271,8 +281,8 @@
 
 		// Do not even bother to look at entries which do not have matching
 		// language and platform (if specified).
-		if ((g->language != language && language != UNK_LANG) ||
-			(g->platform != platform && platform != kPlatformUnknown)) {
+		if ((language != UNK_LANG && g->language != language) ||
+			(platform != kPlatformUnknown && g->platform != platform)) {
 			continue;
 		}
 		
@@ -283,13 +293,25 @@
 			tstr.toLowercase();
 			tstr2 = tstr + ".";
 
-			if (!filesMD5.contains(tstr) && !filesMD5.contains(tstr2)) {
-				fileMissing = true;
-				break;
+			if (fileDesc->md5 != NULL) {
+				if (!filesMD5.contains(tstr) && !filesMD5.contains(tstr2)) {
+					fileMissing = true;
+					break;
+				}
+				if (strcmp(fileDesc->md5, filesMD5[tstr].c_str()) && strcmp(fileDesc->md5, filesMD5[tstr2].c_str())) {
+					fileMissing = true;
+					break;
+				}
 			}
-			if (strcmp(fileDesc->md5, filesMD5[tstr].c_str()) && strcmp(fileDesc->md5, filesMD5[tstr2].c_str())) {
-				fileMissing = true;
-				break;
+			if (fileDesc->fileSize != -1) {
+				if (!filesMD5.contains(tstr) && !filesMD5.contains(tstr2)) {
+					fileMissing = true;
+					break;
+				}
+				if (fileDesc->fileSize != filesSize[tstr] && fileDesc->fileSize != filesSize[tstr2]) {
+					fileMissing = true;
+					break;
+				}
 			}
 			debug(3, "Matched file: %s", tstr.c_str());
 		}

Modified: scummvm/trunk/engines/saga/sagagame.cpp
===================================================================
--- scummvm/trunk/engines/saga/sagagame.cpp	2007-01-25 00:36:48 UTC (rev 25171)
+++ scummvm/trunk/engines/saga/sagagame.cpp	2007-01-25 00:37:12 UTC (rev 25172)
@@ -592,11 +592,11 @@
 		NULL,
 	},
 
-	// Inherit the earth - MAC Demo version
+	// Inherit the earth - MAC Demo version 2
 	{
 		{
 			"ite",
-			"Demo",
+			"Demo 2",
 			{
 	{"ited.rsc",		GAME_RESOURCEFILE,	"addfc9d82bc2fa1f4cab23743c652c08", -1},
 	{"scriptsd.rsc",	GAME_SCRIPTFILE,	"fded5c59b8b7c5976229f960d21e6b0b", -1},
@@ -623,11 +623,11 @@
 		ITEMacPatch_Files,
 	},
 
-	// Inherit the earth - early MAC Demo version
+	// Inherit the earth - MAC Demo version 1
 	{
 		{
 			"ite",
-			"early Demo",
+			"Demo 1",
 			{
 	{"ited.rsc",		GAME_RESOURCEFILE,	"addfc9d82bc2fa1f4cab23743c652c08", -1},
 	{"scriptsd.rsc",	GAME_SCRIPTFILE,	"fded5c59b8b7c5976229f960d21e6b0b", -1},
@@ -725,7 +725,7 @@
 			{
 	{"ited.rsc",		GAME_RESOURCEFILE,	"3a450852cbf3c80773984d565647e6ac", -1},
 	{"scriptsd.rsc",	GAME_SCRIPTFILE,	"3f12b67fa93e56e1a6be39d2921d80bb", -1},
-	{"soundsd.rsc",		GAME_SOUNDFILE,		"95a6c148e22e99a8c243f2978223583c", -1},
+	{"soundsd.rsc",		GAME_SOUNDFILE,		"95a6c148e22e99a8c243f2978223583c", 2026769},
 	{"voicesd.rsc",		GAME_VOICEFILE,		"e139d86bab2ee8ba3157337f894a92d4", -1},
 	{"musicd.rsc",		GAME_MUSICFILE,		"d6454756517f042f01210458abe8edd4", -1},
 	{ NULL, 0, NULL, 0}
@@ -748,22 +748,53 @@
 		ITELinPatch_Files,
 	},
 
-	// Inherit the earth - Win32 Demo version
+	// Inherit the earth - Win32 Demo version 3
 	{
 		{
 			"ite",
-			"Demo",
+			"Demo 3",
 			{
 	{"ited.rsc",		GAME_RESOURCEFILE,	"3a450852cbf3c80773984d565647e6ac", -1},
 	{"scriptsd.rsc",	GAME_SCRIPTFILE,	"3f12b67fa93e56e1a6be39d2921d80bb", -1},
-	{"soundsd.rsc",		GAME_SOUNDFILE,		"95a6c148e22e99a8c243f2978223583c", -1},
+	{"soundsd.rsc",		GAME_SOUNDFILE,		"95a6c148e22e99a8c243f2978223583c", 2005074},
 	{"voicesd.rsc",		GAME_VOICEFILE,		"e139d86bab2ee8ba3157337f894a92d4", -1},
+	{"musicd.rsc",		GAME_MUSICFILE,		"d6454756517f042f01210458abe8edd4", -1},
 	{ NULL, 0, NULL, 0}
 			},
 			Common::EN_ANY,
 			Common::kPlatformWindows,
 		},
 		GType_ITE,
+		GID_ITE_WINDEMO3,
+		GF_WYRMKEEP | GF_CD_FX | GF_SCENE_SUBSTITUTES,
+		&ITE_DisplayInfo,
+		ITE_DEFAULT_SCENE,
+		&ITE_Resources,
+		ARRAYSIZE(ITEWINDEMO_GameFonts),
+		ITEWINDEMO_GameFonts,
+		&ITEWINDEMO2_GameVoice,
+		&ITEWINDEMO2_GameSound,
+		&ITELINDEMO_GameMusic,
+		ARRAYSIZE(ITEWinPatch2_Files),
+		ITEWinPatch2_Files,
+	},
+
+	// Inherit the earth - Win32 Demo version 2
+	{
+		{
+			"ite",
+			"Demo 2",
+			{
+	{"ited.rsc",		GAME_RESOURCEFILE,	"3a450852cbf3c80773984d565647e6ac", -1},
+	{"scriptsd.rsc",	GAME_SCRIPTFILE,	"3f12b67fa93e56e1a6be39d2921d80bb", -1},
+	{"soundsd.rsc",		GAME_SOUNDFILE,		"95a6c148e22e99a8c243f2978223583c", 2005074},
+	{"voicesd.rsc",		GAME_VOICEFILE,		"e139d86bab2ee8ba3157337f894a92d4", -1},
+	{ NULL, 0, NULL, 0}
+			},
+			Common::EN_ANY,
+			Common::kPlatformWindows,
+		},
+		GType_ITE,
 		GID_ITE_WINDEMO2,
 		GF_WYRMKEEP | GF_CD_FX | GF_SCENE_SUBSTITUTES,
 		&ITE_DisplayInfo,
@@ -778,11 +809,11 @@
 		ITEWinPatch2_Files,
 	},
 
-	// Inherit the earth - early Win32 Demo version
+	// Inherit the earth - Win32 Demo version 1
 	{
 		{
 			"ite",
-			"early Demo",
+			"Demo 1",
 			{
 	{"ited.rsc",		GAME_RESOURCEFILE,	"3a450852cbf3c80773984d565647e6ac", -1},
 	{"scriptsd.rsc",	GAME_SCRIPTFILE,	"3f12b67fa93e56e1a6be39d2921d80bb", -1},

Modified: scummvm/trunk/engines/saga/sagagame.h
===================================================================
--- scummvm/trunk/engines/saga/sagagame.h	2007-01-25 00:36:48 UTC (rev 25171)
+++ scummvm/trunk/engines/saga/sagagame.h	2007-01-25 00:37:12 UTC (rev 25172)
@@ -22,6 +22,7 @@
 	GID_ITE_MACDEMO1, // older Wyrmkeep mac demo
 	GID_ITE_LINDEMO,
 	GID_ITE_WINDEMO2,
+	GID_ITE_WINDEMO3,
 	GID_ITE_MACDEMO2,
 
 	// German


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