From 8b62b591a8423ce958723efe171a6c140fcdb5d1 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Fri, 27 Jul 2007 23:41:43 +0000 Subject: Added detection target for Big Red Adventure, and derived new engine classes for supported games. svn-id: r28247 --- engines/parallaction/detection.cpp | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'engines/parallaction/detection.cpp') diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 44e9126b70..512df60fa9 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -27,6 +27,7 @@ #include "base/plugins.h" +#include "common/config-manager.h" #include "common/advancedDetector.h" #include "parallaction/parallaction.h" @@ -47,7 +48,6 @@ 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 +176,7 @@ static const Common::ADParams detectionParams = { // Structure for autoupgrading obsolete targets 0, // Name of single gameid (optional) - "parallaction", + 0, // List of files for file-based fallback detection (optional) 0, // Fallback callback @@ -185,7 +185,32 @@ static const Common::ADParams detectionParams = { Common::kADFlagAugmentPreferredTarget }; -ADVANCED_DETECTOR_DEFINE_PLUGIN(PARALLACTION, Parallaction::Parallaction, detectionParams); +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(); + + if (!scumm_stricmp("nippon", gameid)) { + *engine = new Parallaction::Parallaction_ns(syst); + } else + if (!scumm_stricmp("bra", gameid)) { + *engine = new Parallaction::Parallaction_br(syst); + } else + error("Parallaction engine created with invalid gameid ('%s')", gameid); + + return kNoError; +} REGISTER_PLUGIN(PARALLACTION, "Parallaction engine", "Nippon Safes Inc. (C) Dynabyte"); -- cgit v1.2.3