diff options
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/detection.cpp | 20 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 4 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 6 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 6 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 6 |
5 files changed, 9 insertions, 33 deletions
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 33da65fba4..ba87b6cee0 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -184,16 +184,16 @@ static const Common::ADParams detectionParams = { Common::kADFlagAugmentPreferredTarget }; -bool engineCreateParallaction(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { +static bool Engine_PARALLACTION_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { const Parallaction::PARALLACTIONGameDescription *gd = (const Parallaction::PARALLACTIONGameDescription *)(encapsulatedDesc.realDesc); bool res = true; switch (gd->gameType) { case Parallaction::GType_Nippon: - *engine = new Parallaction::Parallaction_ns(syst); + *engine = new Parallaction::Parallaction_ns(syst, gd); break; case Parallaction::GType_BRA: - *engine = new Parallaction::Parallaction_br(syst); + *engine = new Parallaction::Parallaction_br(syst, gd); break; default: res = false; @@ -203,18 +203,6 @@ bool engineCreateParallaction(OSystem *syst, Engine **engine, Common::Encapsulat return res; } -ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(PARALLACTION, engineCreateParallaction, detectionParams); +ADVANCED_DETECTOR_DEFINE_PLUGIN(PARALLACTION, Engine_PARALLACTION_createInstance, detectionParams); REGISTER_PLUGIN(PARALLACTION, "Parallaction engine", "Nippon Safes Inc. (C) Dynabyte"); - - -namespace Parallaction { - -bool Parallaction::detectGame() { - Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); - _gameDescription = (const PARALLACTIONGameDescription *)(encapsulatedDesc.realDesc); - - return (_gameDescription != 0); -} - -} // End of namespace Parallaction diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 9ae5e97d0c..b942cd81ad 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -91,8 +91,8 @@ static Job *_jDrawInventory = NULL; static Job *_jRunScripts = NULL; -Parallaction::Parallaction(OSystem *syst) : - Engine(syst), _char(this) { +Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc) : + Engine(syst), _gameDescription(gameDesc), _char(this) { // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what // needs fixing, or remove it! diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 01e3997b95..7a1a272cb7 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -363,7 +363,7 @@ class Parallaction : public Engine { public: - Parallaction(OSystem *syst); + Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc); ~Parallaction(); int init(); @@ -640,7 +640,7 @@ public: class Parallaction_ns : public Parallaction { public: - Parallaction_ns(OSystem* syst) : Parallaction(syst) { } + Parallaction_ns(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction(syst, gameDesc) { } ~Parallaction_ns(); int init(); @@ -922,7 +922,7 @@ class Parallaction_br : public Parallaction_ns { typedef Parallaction_ns Super; public: - Parallaction_br(OSystem* syst) : Parallaction_ns(syst) { } + Parallaction_br(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction_ns(syst, gameDesc) { } ~Parallaction_br(); int init(); diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 1a38cda9d8..97e9784d47 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -59,12 +59,6 @@ const char *partFirstLocation[] = { int Parallaction_br::init() { - // Detect game - if (!detectGame()) { - GUIErrorMessage("No valid games were found in the specified directory."); - return -1; - } - _screenWidth = 640; _screenHeight = 400; diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 652ffd1d64..0075664a42 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -111,12 +111,6 @@ void LocationName::bind(const char *s) { int Parallaction_ns::init() { - // Detect game - if (!detectGame()) { - GUIErrorMessage("No valid games were found in the specified directory."); - return -1; - } - _screenWidth = 320; _screenHeight = 200; |