diff options
Diffstat (limited to 'engines/touche/detection.cpp')
-rw-r--r-- | engines/touche/detection.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index 3fe558b01f..41b2062ffc 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -110,7 +110,7 @@ static const Common::ADFileBasedFallback fileBasedFallback[] = { { 0, { 0 } } }; -} +} // End of namespace Touche static const Common::ADParams detectionParams = { (const byte *)Touche::gameDescriptions, @@ -124,21 +124,14 @@ static const Common::ADParams detectionParams = { Common::kADFlagAugmentPreferredTarget | Common::kADFlagPrintWarningOnFileBasedFallback }; -ADVANCED_DETECTOR_DEFINE_PLUGIN(TOUCHE, Touche::ToucheEngine, detectionParams); - -REGISTER_PLUGIN(TOUCHE, "Touche Engine", "Touche: The Adventures of the 5th Musketeer (C) Clipper Software"); - -namespace Touche { - -bool ToucheEngine::detectGame() { - Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); +static bool Engine_TOUCHE_createInstance(OSystem *syst, Engine **engine, const Common::EncapsulatedADGameDesc &encapsulatedDesc) { const Common::ADGameDescription *gd = encapsulatedDesc.realDesc; - - if (gd == 0) - return false; - - _language = gd->language; - return true; + if (gd) { + *engine = new Touche::ToucheEngine(syst, gd->language); + } + return gd != 0; } -} // End of namespace Touche +ADVANCED_DETECTOR_DEFINE_PLUGIN(TOUCHE, Engine_TOUCHE_createInstance, detectionParams); + +REGISTER_PLUGIN(TOUCHE, "Touche Engine", "Touche: The Adventures of the 5th Musketeer (C) Clipper Software"); |