From c640d1c604f219a5be5412d6c5ea8a85f44ec4b4 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 3 Nov 2007 21:06:58 +0000 Subject: Patch #1825276: "DETECTION: advanced detector engine simplification" svn-id: r29386 --- engines/cruise/detection.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'engines/cruise/detection.cpp') diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index 8307a483ad..1c311dc39d 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -111,17 +111,14 @@ static const Common::ADParams detectionParams = { Common::kADFlagAugmentPreferredTarget }; -ADVANCED_DETECTOR_DEFINE_PLUGIN(CRUISE, Cruise::CruiseEngine, detectionParams); - -REGISTER_PLUGIN(CRUISE, "Cinematique evo 2 engine", "Cruise for a Corpse (C) Delphine Software"); - -namespace Cruise { - -bool CruiseEngine::initGame() { - Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); - _gameDescription = (const CRUISEGameDescription *)(encapsulatedDesc.realDesc); - - return (_gameDescription != 0); +static bool Engine_CRUISE_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { + const Cruise::CRUISEGameDescription *gd = (const Cruise::CRUISEGameDescription *)(encapsulatedDesc.realDesc); + if (gd) { + *engine = new Cruise::CruiseEngine(syst, gd); + } + return gd != 0; } -} // End of namespace Cruise +ADVANCED_DETECTOR_DEFINE_PLUGIN(CRUISE, Engine_CRUISE_createInstance, detectionParams); + +REGISTER_PLUGIN(CRUISE, "Cinematique evo 2 engine", "Cruise for a Corpse (C) Delphine Software"); -- cgit v1.2.3