diff options
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/agi.cpp | 11 | ||||
-rw-r--r-- | engines/agi/agi.h | 6 | ||||
-rw-r--r-- | engines/agi/detection.cpp | 26 | ||||
-rw-r--r-- | engines/agi/preagi.cpp | 9 | ||||
-rw-r--r-- | engines/agi/preagi.h | 4 |
5 files changed, 10 insertions, 46 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index a8d521ff69..e46b017ad8 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -605,11 +605,11 @@ AgiButtonStyle::AgiButtonStyle(Common::RenderMode renderMode) { setAmigaStyle(renderMode == Common::kRenderAmiga); } -AgiBase::AgiBase(OSystem *syst) : Engine(syst) { +AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { } -AgiEngine::AgiEngine(OSystem *syst) : AgiBase(syst) { +AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) { // Setup mixer if (!_mixer->isReady()) { @@ -783,13 +783,6 @@ AgiEngine::~AgiEngine() { int AgiEngine::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/agi/agi.h b/engines/agi/agi.h index 358660619b..c1b649435c 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -656,7 +656,7 @@ public: virtual int agiGetKeypressLow() = 0; virtual int agiIsKeypressLow() = 0; - AgiBase(OSystem *syst); + AgiBase(OSystem *syst, const AGIGameDescription *gameDesc); #define INITIAL_IMAGE_STACK_SIZE 32 @@ -695,10 +695,8 @@ protected: void shutdown(); void initialize(); - bool initGame(); - public: - AgiEngine(OSystem *syst); + AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc); virtual ~AgiEngine(); int getGameId() { return _gameId; diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 9bb767f7d8..2b64913992 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -2253,13 +2253,13 @@ bool engineCreateAgi(OSystem *syst, Engine **engine, Common::EncapsulatedADGameD switch (gd->gameType) { case Agi::GType_PreAGI: - *engine = new Agi::PreAgiEngine(syst); + *engine = new Agi::PreAgiEngine(syst, gd); break; case Agi::GType_V2: - *engine = new Agi::AgiEngine(syst); + *engine = new Agi::AgiEngine(syst, gd); break; case Agi::GType_V3: - *engine = new Agi::AgiEngine(syst); + *engine = new Agi::AgiEngine(syst, gd); break; default: res = false; @@ -2269,25 +2269,7 @@ bool engineCreateAgi(OSystem *syst, Engine **engine, Common::EncapsulatedADGameD return res; } -ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(AGI, engineCreateAgi, detectionParams); +ADVANCED_DETECTOR_DEFINE_PLUGIN(AGI, engineCreateAgi, detectionParams); REGISTER_PLUGIN(AGI, "AGI preAGI + v2 + v3 Engine", "Sierra AGI Engine (C) Sierra On-Line Software"); -namespace Agi { - -bool AgiEngine::initGame() { - Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); - _gameDescription = (const AGIGameDescription *)(encapsulatedDesc.realDesc); - - return (_gameDescription != 0); -} - -bool PreAgiEngine::initGame() { - Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); - _gameDescription = (const AGIGameDescription *)(encapsulatedDesc.realDesc); - - return (_gameDescription != 0); -} - -} // End of namespace Agi - diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp index 1ef889a5fa..217134c525 100644 --- a/engines/agi/preagi.cpp +++ b/engines/agi/preagi.cpp @@ -51,7 +51,7 @@ namespace Agi { -PreAgiEngine::PreAgiEngine(OSystem *syst) : AgiBase(syst) { +PreAgiEngine::PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) { // Setup mixer if (!_mixer->isReady()) { @@ -195,13 +195,6 @@ PreAgiEngine::~PreAgiEngine() { } int PreAgiEngine::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/agi/preagi.h b/engines/agi/preagi.h index ef2ea41528..39e61592ae 100644 --- a/engines/agi/preagi.h +++ b/engines/agi/preagi.h @@ -40,14 +40,12 @@ protected: void shutdown(); void initialize(); - bool initGame(); - public: void agiTimerLow() {} int agiGetKeypressLow() { return 0; } int agiIsKeypressLow() { return 0; } - PreAgiEngine(OSystem *syst); + PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc); virtual ~PreAgiEngine(); int getGameId() { return _gameId; |