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/cruise | |
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/cruise')
-rw-r--r-- | engines/cruise/cruise.cpp | 7 | ||||
-rw-r--r-- | engines/cruise/cruise.h | 2 | ||||
-rw-r--r-- | engines/cruise/detection.cpp | 21 |
3 files changed, 11 insertions, 19 deletions
diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp index 3e7f42c3e4..8252877046 100644 --- a/engines/cruise/cruise.cpp +++ b/engines/cruise/cruise.cpp @@ -44,7 +44,7 @@ Common::SaveFileManager * g_saveFileMan; CruiseEngine *g_cruise; -CruiseEngine::CruiseEngine(OSystem * syst) : Engine(syst) { +CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { #ifdef PALMOS_MODE _currentVolumeFile = new Common::File(); @@ -75,11 +75,6 @@ CruiseEngine::~CruiseEngine() { } int CruiseEngine::init() { - // Detect game - if (!initGame()) { - GUIErrorMessage ("No valid games were found in the specified directory."); - return -1; - } // Initialize backend _system->beginGFXTransaction(); initCommonGFX(false); diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h index d99860d254..4a6bcff498 100644 --- a/engines/cruise/cruise.h +++ b/engines/cruise/cruise.h @@ -51,7 +51,7 @@ protected: bool initGame(); public: - CruiseEngine(OSystem * syst); + CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc); virtual ~ CruiseEngine(); int getGameType() const; 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"); |