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/cine | |
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/cine')
-rw-r--r-- | engines/cine/cine.cpp | 8 | ||||
-rw-r--r-- | engines/cine/cine.h | 2 | ||||
-rw-r--r-- | engines/cine/detection.cpp | 21 |
3 files changed, 11 insertions, 20 deletions
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 70be3e821d..7a8dfac60f 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -50,7 +50,7 @@ Common::SaveFileManager *g_saveFileMan; CineEngine *g_cine; -CineEngine::CineEngine(OSystem *syst) : Engine(syst) { +CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { Common::addSpecialDebugLevel(kCineDebugScript, "Script", "Script debug level"); // Setup mixer @@ -74,12 +74,6 @@ CineEngine::~CineEngine() { } int CineEngine::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/cine/cine.h b/engines/cine/cine.h index 026fb3e54c..b225f9490a 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -71,7 +71,7 @@ protected: bool initGame(); public: - CineEngine(OSystem *syst); + CineEngine(OSystem *syst, const CINEGameDescription *gameDesc); virtual ~CineEngine(); int getGameType() const; diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index f4b9b0c94e..9e449e2ca1 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -487,17 +487,14 @@ static const Common::ADParams detectionParams = { Common::kADFlagAugmentPreferredTarget }; -ADVANCED_DETECTOR_DEFINE_PLUGIN(CINE, Cine::CineEngine, detectionParams); - -REGISTER_PLUGIN(CINE, "Cinematique evo 1 engine", "Future Wars & Operation Stealth (C) Delphine Software"); - -namespace Cine { - -bool CineEngine::initGame() { - Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); - _gameDescription = (const CINEGameDescription *)(encapsulatedDesc.realDesc); - - return (_gameDescription != 0); +static bool Engine_CINE_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { + const Cine::CINEGameDescription *gd = (const Cine::CINEGameDescription *)(encapsulatedDesc.realDesc); + if (gd) { + *engine = new Cine::CineEngine(syst, gd); + } + return gd != 0; } -} // End of namespace Cine +ADVANCED_DETECTOR_DEFINE_PLUGIN(CINE, Engine_CINE_createInstance, detectionParams); + +REGISTER_PLUGIN(CINE, "Cinematique evo 1 engine", "Future Wars & Operation Stealth (C) Delphine Software"); |