diff options
author | Nicola Mettifogo | 2007-07-27 23:41:43 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-07-27 23:41:43 +0000 |
commit | 8b62b591a8423ce958723efe171a6c140fcdb5d1 (patch) | |
tree | fb23c20e43bcdd956201ad41a71a27bb47a81542 | |
parent | 67869d2c10234479949bd74abc42931a019264e6 (diff) | |
download | scummvm-rg350-8b62b591a8423ce958723efe171a6c140fcdb5d1.tar.gz scummvm-rg350-8b62b591a8423ce958723efe171a6c140fcdb5d1.tar.bz2 scummvm-rg350-8b62b591a8423ce958723efe171a6c140fcdb5d1.zip |
Added detection target for Big Red Adventure, and derived new engine classes for supported games.
svn-id: r28247
-rw-r--r-- | engines/parallaction/detection.cpp | 31 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 16 |
2 files changed, 44 insertions, 3 deletions
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"); diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 3a2ecd8f0b..33dc5563e6 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -480,6 +480,22 @@ protected: // members int16 getHoverInventoryItem(int16 x, int16 y); }; +class Parallaction_ns : public Parallaction { + +public: + Parallaction_ns(OSystem* syst) : Parallaction(syst) { } + ~Parallaction_ns() { } + +}; + +class Parallaction_br : public Parallaction { + +public: + Parallaction_br(OSystem* syst) : Parallaction(syst) { } + ~Parallaction_br() { } + +}; + // FIXME: remove global extern Parallaction *_vm; |