aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/detection.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2007-07-27 23:41:43 +0000
committerNicola Mettifogo2007-07-27 23:41:43 +0000
commit8b62b591a8423ce958723efe171a6c140fcdb5d1 (patch)
treefb23c20e43bcdd956201ad41a71a27bb47a81542 /engines/parallaction/detection.cpp
parent67869d2c10234479949bd74abc42931a019264e6 (diff)
downloadscummvm-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
Diffstat (limited to 'engines/parallaction/detection.cpp')
-rw-r--r--engines/parallaction/detection.cpp31
1 files changed, 28 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");