diff options
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 |