diff options
author | Eugene Sandulenko | 2007-02-04 03:10:27 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2007-02-04 03:10:27 +0000 |
commit | 7b6bdd231d100110689a0e804ac53453d388e8d9 (patch) | |
tree | 4b6d953ae1b18601ed95cdcc4ac2f42b26a39f11 /engines | |
parent | 0d01bdd7996c07f93428f84a77e1a45c8c4af45a (diff) | |
download | scummvm-rg350-7b6bdd231d100110689a0e804ac53453d388e8d9.tar.gz scummvm-rg350-7b6bdd231d100110689a0e804ac53453d388e8d9.tar.bz2 scummvm-rg350-7b6bdd231d100110689a0e804ac53453d388e8d9.zip |
AdvancedDetector now has built-in fallback detection based on file lists.
Currently only gob engine benefits from it.
svn-id: r25374
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agi/detection.cpp | 2 | ||||
-rw-r--r-- | engines/agos/game.cpp | 2 | ||||
-rw-r--r-- | engines/cine/detection.cpp | 2 | ||||
-rw-r--r-- | engines/gob/detection.cpp | 160 | ||||
-rw-r--r-- | engines/kyra/plugin.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/detection.cpp | 2 | ||||
-rw-r--r-- | engines/saga/game.cpp | 2 |
7 files changed, 127 insertions, 45 deletions
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index dcb328c314..6b8e7348de 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -1013,6 +1013,8 @@ static const Common::ADParams detectionParams = { 0, // Name of single gameid (optional) "agi", + // List of files for file-based fallback detection (optional) + 0, // Flags Common::kADFlagComplexID }; diff --git a/engines/agos/game.cpp b/engines/agos/game.cpp index 89a22caa30..8652cb726b 100644 --- a/engines/agos/game.cpp +++ b/engines/agos/game.cpp @@ -95,6 +95,8 @@ static const Common::ADParams detectionParams = { obsoleteGameIDsTable, // Name of single gameid (optional) 0, + // List of files for file-based fallback detection (optional) + 0, // Flags 0 }; diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index c455322a85..14c829a0dc 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -450,6 +450,8 @@ static const Common::ADParams detectionParams = { obsoleteGameIDsTable, // Name of single gameid (optional) "cine", + // List of files for file-based fallback detection (optional) + 0, // Flags Common::kADFlagComplexID }; diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index 2379e8fa97..1997b117d6 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -45,10 +45,13 @@ using namespace Common; static const PlainGameDescriptor gobGames[] = { {"gob", "Gob engine game"}, {"gob1", "Gobliiins"}, + {"gob1cd", "Gobliiins CD"}, {"gob1-demo", "Gobliiins Demo"}, {"gob2", "Gobliins 2"}, + {"gob2cd", "Gobliins 2 CD"}, {"gob2-demo", "Gobliins 2 Demo"}, {"gob3", "Goblins Quest 3"}, + {"gob3cd", "Goblins Quest 3 CD"}, {"gob3-demo", "Goblins Quest 3 Demo"}, {"bargon", "Bargon Attack"}, {"ween", "Ween: The Prohpecy"}, @@ -66,6 +69,17 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { namespace Gob { static const GOBGameDescription gameDescriptions[] = { + { // Dummy entry for fallback detection + { + "gob1", + "unknown", + AD_ENTRY1(0, 0), + UNK_LANG, + kPlatformPC, + }, + GF_GOB1, + "intro" + }, { // Supplied by Florian Zeitz on scummvm-devel { "gob1", @@ -99,10 +113,21 @@ static const GOBGameDescription gameDescriptions[] = { GF_GOB1, "intro" }, - { // CD 1.000 version. Multilingual + { // Dummy entry for fallback detection { - "gob1", - "CD 1.000", + "gob1cd", + "unknown", + AD_ENTRY1(0, 0), + UNK_LANG, + kPlatformPC, + }, + GF_GOB1 | GF_CD, + "intro" + }, + { // CD 1.000 version. + { + "gob1cd", + "v1.000", AD_ENTRY1("intro.stk", "2fbf4b5b82bbaee87eb45d4404c28998"), UNK_LANG, kPlatformPC, @@ -112,10 +137,43 @@ static const GOBGameDescription gameDescriptions[] = { }, { // CD 1.02 version. Multilingual { - "gob1", - "CD 1.02", + "gob1cd", + "v1.02", AD_ENTRY1("intro.stk", "8bd873137b6831c896ee8ad217a6a398"), - UNK_LANG, + EN_USA, + kPlatformPC, + }, + GF_GOB1 | GF_CD, + "intro" + }, + { // CD 1.02 version. Multilingual + { + "gob1cd", + "v1.02", + AD_ENTRY1("intro.stk", "8bd873137b6831c896ee8ad217a6a398"), + FR_FRA, + kPlatformPC, + }, + GF_GOB1 | GF_CD, + "intro" + }, + { // CD 1.02 version. Multilingual + { + "gob1cd", + "v1.02", + AD_ENTRY1("intro.stk", "8bd873137b6831c896ee8ad217a6a398"), + IT_ITA, + kPlatformPC, + }, + GF_GOB1 | GF_CD, + "intro" + }, + { // CD 1.02 version. Multilingual + { + "gob1cd", + "v1.02", + AD_ENTRY1("intro.stk", "8bd873137b6831c896ee8ad217a6a398"), + ES_ESP, kPlatformPC, }, GF_GOB1 | GF_CD, @@ -154,6 +212,17 @@ static const GOBGameDescription gameDescriptions[] = { GF_GOB1, "intro" }, + { // Dummy entry for fallback detection + { + "gob2", + "unknown", + AD_ENTRY1(0, 0), + UNK_LANG, + kPlatformPC, + }, + GF_GOB2, + "intro" + }, { { "gob2", @@ -231,10 +300,21 @@ static const GOBGameDescription gameDescriptions[] = { GF_GOB2, "intro" }, + { // Dummy entry for fallback detection + { + "gob2cd", + "unknown", + AD_ENTRY1(0, 0), + UNK_LANG, + kPlatformPC, + }, + GF_GOB2 | GF_CD, + "intro" + }, { { - "gob2", - "CD 1.000", + "gob2cd", + "v1.000", AD_ENTRY1("intro.stk", "9de5fbb41cf97182109e5fecc9d90347"), EN_USA, kPlatformPC, @@ -244,8 +324,8 @@ static const GOBGameDescription gameDescriptions[] = { }, { { - "gob2", - "CD 1.02", + "gob2cd", + "v1.02", AD_ENTRY1("intro.stk", "24a6b32757752ccb1917ce92fd7c2a04"), EN_ANY, kPlatformPC, @@ -255,8 +335,8 @@ static const GOBGameDescription gameDescriptions[] = { }, { { - "gob2", - "CD 1.02", + "gob2cd", + "v1.02", AD_ENTRY1("intro.stk", "24a6b32757752ccb1917ce92fd7c2a04"), DE_DEU, kPlatformPC, @@ -266,8 +346,8 @@ static const GOBGameDescription gameDescriptions[] = { }, { { - "gob2", - "CD 1.02", + "gob2cd", + "v1.02", AD_ENTRY1("intro.stk", "24a6b32757752ccb1917ce92fd7c2a04"), FR_FRA, kPlatformPC, @@ -277,8 +357,8 @@ static const GOBGameDescription gameDescriptions[] = { }, { { - "gob2", - "CD 1.02", + "gob2cd", + "v1.02", AD_ENTRY1("intro.stk", "24a6b32757752ccb1917ce92fd7c2a04"), IT_ITA, kPlatformPC, @@ -288,8 +368,8 @@ static const GOBGameDescription gameDescriptions[] = { }, { { - "gob2", - "CD 1.02", + "gob2cd", + "v1.02", AD_ENTRY1("intro.stk", "24a6b32757752ccb1917ce92fd7c2a04"), ES_ESP, kPlatformPC, @@ -453,8 +533,8 @@ static const GOBGameDescription gameDescriptions[] = { }, { { - "gob3", - "CD 1.000", + "gob3cd", + "v1.000", AD_ENTRY1("intro.stk", "6f2c226c62dd7ab0ab6f850e89d3fc47"), UNK_LANG, kPlatformPC, @@ -464,8 +544,8 @@ static const GOBGameDescription gameDescriptions[] = { }, { { - "gob3", - "CD 1.02", + "gob3cd", + "v1.02", AD_ENTRY1("intro.stk", "c3e9132ea9dc0fb866b6d60dcda10261"), UNK_LANG, kPlatformPC, @@ -542,6 +622,15 @@ static const GOBGameDescription gameDescriptions[] = { { { NULL, NULL, { { NULL, 0, NULL, 0 } }, UNK_LANG, kPlatformUnknown }, 0, NULL } }; +static const char *fileBased[] = { + "gob1", "intro.stk", "disk1.stk", "disk2.stk", "disk3.stk", "disk4.stk", 0, + "gob1cd", "intro.stk", "gob.lic", 0, + "gob2", "intro.stk", 0, + "gob2", "intro.stk", "disk2.stk", "disk3.stk", 0, + "gob2cd", "intro.stk", "gobnew.lic", 0, + 0 +}; + } static const ADParams detectionParams = { @@ -557,8 +646,10 @@ static const ADParams detectionParams = { obsoleteGameIDsTable, // Name of single gameid (optional) "gob", + // List of files for file-based fallback detection (optional) + Gob::fileBased, // Flags - kADFlagComplexID + kADFlagComplexID | kADFlagFilebasedFallback }; ADVANCED_DETECTOR_DEFINE_PLUGIN(GOB, Gob::GobEngine, Gob::GAME_detectGames, detectionParams); @@ -593,28 +684,7 @@ bool GobEngine::detectGame() { } GameList GAME_detectGames(const FSList &fslist) { - GameList gl(AdvancedDetector::detectAllGames(fslist, detectionParams)); - - if (gl.empty()) { - for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { - if (file->isDirectory()) continue; - - if (!scumm_stricmp(file->name().c_str(), "intro.stk")) { - const PlainGameDescriptor *g = detectionParams.list; - while (g->gameid) { - if (0 == scumm_stricmp(detectionParams.singleid, g->gameid)) { - gl.push_back(GameDescriptor(g->gameid, g->description)); - - return gl; - } - - g++; - } - } - } - } - - return gl; + return AdvancedDetector::detectAllGames(fslist, detectionParams); } } // End of namespace Parallaction diff --git a/engines/kyra/plugin.cpp b/engines/kyra/plugin.cpp index 6f497e3a61..31f87afaa8 100644 --- a/engines/kyra/plugin.cpp +++ b/engines/kyra/plugin.cpp @@ -94,6 +94,8 @@ const Common::ADParams detectionParams = { 0, // Name of single gameid (optional) 0, + // List of files for file-based fallback detection (optional) + 0, // Flags 0 }; diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 898df9d7da..709879a4c0 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -93,6 +93,8 @@ static const Common::ADParams detectionParams = { 0, // Name of single gameid (optional) "parallaction", + // List of files for file-based fallback detection (optional) + 0, // Flags Common::kADFlagComplexID }; diff --git a/engines/saga/game.cpp b/engines/saga/game.cpp index f2c3ff0628..24dfd41398 100644 --- a/engines/saga/game.cpp +++ b/engines/saga/game.cpp @@ -114,6 +114,8 @@ static const Common::ADParams detectionParams = { obsoleteGameIDsTable, // Name of single gameid (optional) "saga", + // List of files for file-based fallback detection (optional) + 0, // Flags Common::kADFlagComplexID }; |