From daf5c3055157375b3448e7512f37d0ed08b6273b Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 13 Aug 2007 09:02:11 +0000 Subject: Switch Parallaction back to single gameid (to be compatible with 0.10.x), and made it use new AdvancedDetector features. svn-id: r28585 --- engines/parallaction/detection.cpp | 39 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'engines/parallaction/detection.cpp') diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 84c45584a4..ebfc37e795 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -48,6 +48,7 @@ Common::Platform Parallaction::getPlatform() const { return _gameDescription->de } static const PlainGameDescriptor parallactionGames[] = { + {"parallaction", "Parallaction engine game"}, {"nippon", "Nippon Safes Inc."}, {"bra", "The Big Red Adventure"}, {0, 0} @@ -176,7 +177,7 @@ static const Common::ADParams detectionParams = { // Structure for autoupgrading obsolete targets 0, // Name of single gameid (optional) - 0, + "parallaction", // List of files for file-based fallback detection (optional) 0, // Fallback callback @@ -185,33 +186,27 @@ static const Common::ADParams detectionParams = { Common::kADFlagAugmentPreferredTarget }; -GameList Engine_PARALLACTION_gameIDList() { - return GameList(parallactionGames); -} - -GameDescriptor Engine_PARALLACTION_findGameID(const char *gameid) { - return Common::AdvancedDetector::findGameID(gameid, parallactionGames); -} - -GameList Engine_PARALLACTION_detectGames(const FSList &fslist) { - return Common::AdvancedDetector::detectAllGames(fslist, detectionParams); -} - -PluginError Engine_PARALLACTION_create(OSystem *syst, Engine **engine) { - assert(engine); - const char *gameid = ConfMan.get("gameid").c_str(); +bool engineCreate(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { + const Parallaction::PARALLACTIONGameDescription *gd = (const Parallaction::PARALLACTIONGameDescription *)(encapsulatedDesc.realDesc); + bool res = true; - if (!scumm_stricmp("nippon", gameid)) { + switch (gd->gameType) { + case Parallaction::GType_Nippon: *engine = new Parallaction::Parallaction_ns(syst); - } else - if (!scumm_stricmp("bra", gameid)) { + break; + case Parallaction::GType_BRA: *engine = new Parallaction::Parallaction_br(syst); - } else - error("Parallaction engine created with invalid gameid ('%s')", gameid); + break; + default: + res = false; + error("Parallaction engine: unknown gameType"); + } - return kNoError; + return res; } +ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(PARALLACTION, engineCreate, detectionParams); + REGISTER_PLUGIN(PARALLACTION, "Parallaction engine", "Nippon Safes Inc. (C) Dynabyte"); -- cgit v1.2.3