diff options
author | Eugene Sandulenko | 2007-11-03 21:06:58 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2007-11-03 21:06:58 +0000 |
commit | c640d1c604f219a5be5412d6c5ea8a85f44ec4b4 (patch) | |
tree | 5d6efb4954efb93e4d6e2f71a37486a666ee20ce /engines/gob/detection.cpp | |
parent | c06905149286c3fbd803d3ca7522bbe66a6ad129 (diff) | |
download | scummvm-rg350-c640d1c604f219a5be5412d6c5ea8a85f44ec4b4.tar.gz scummvm-rg350-c640d1c604f219a5be5412d6c5ea8a85f44ec4b4.tar.bz2 scummvm-rg350-c640d1c604f219a5be5412d6c5ea8a85f44ec4b4.zip |
Patch #1825276: "DETECTION: advanced detector engine simplification"
svn-id: r29386
Diffstat (limited to 'engines/gob/detection.cpp')
-rw-r--r-- | engines/gob/detection.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index 22b249a4a8..db07c72414 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -1701,20 +1701,22 @@ static const ADParams detectionParams = { kADFlagAugmentPreferredTarget }; -ADVANCED_DETECTOR_DEFINE_PLUGIN(GOB, Gob::GobEngine, detectionParams); +static bool Engine_GOB_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { + const Gob::GOBGameDescription *gd = (const Gob::GOBGameDescription *)(encapsulatedDesc.realDesc); + if (gd) { + *engine = new Gob::GobEngine(syst); + ((Gob::GobEngine *)*engine)->initGame(gd); + } + return gd != 0; +} -REGISTER_PLUGIN(GOB, "Gob Engine", "Goblins Games (C) Coktel Vision"); +ADVANCED_DETECTOR_DEFINE_PLUGIN(GOB, Engine_GOB_createInstance, detectionParams); +REGISTER_PLUGIN(GOB, "Gob Engine", "Goblins Games (C) Coktel Vision"); namespace Gob { -bool GobEngine::detectGame() { - Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); - const GOBGameDescription *gd = (const GOBGameDescription *)(encapsulatedDesc.realDesc); - - if (gd == 0) - return false; - +void GobEngine::initGame(const GOBGameDescription *gd) { if (gd->startTotBase == 0) { _startTot = new char[10]; _startTot0 = new char[11]; @@ -1733,8 +1735,6 @@ bool GobEngine::detectGame() { _features = gd->features; _language = gd->desc.language; _platform = gd->desc.platform; - - return true; } } // End of namespace Gob |