aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/detection.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2007-08-13 08:59:38 +0000
committerEugene Sandulenko2007-08-13 08:59:38 +0000
commit6004c1142b5a31d1032e3f74b0a532d86bcbcca9 (patch)
tree3910261e29da0b39cb5e825a7604dbbc7000732e /engines/agos/detection.cpp
parent7dcb8503a34d5f286ba3aad56fdc5bdabda57862 (diff)
downloadscummvm-rg350-6004c1142b5a31d1032e3f74b0a532d86bcbcca9.tar.gz
scummvm-rg350-6004c1142b5a31d1032e3f74b0a532d86bcbcca9.tar.bz2
scummvm-rg350-6004c1142b5a31d1032e3f74b0a532d86bcbcca9.zip
Use new AD code in AGOS detection.
svn-id: r28583
Diffstat (limited to 'engines/agos/detection.cpp')
-rw-r--r--engines/agos/detection.cpp63
1 files changed, 25 insertions, 38 deletions
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index f16224dacd..fe4dc71fea 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -101,55 +101,42 @@ static const Common::ADParams detectionParams = {
Common::kADFlagAugmentPreferredTarget
};
-GameList Engine_AGOS_gameIDList() {
- return GameList(simonGames);
-}
-
-GameDescriptor Engine_AGOS_findGameID(const char *gameid) {
- return Common::AdvancedDetector::findGameID(gameid, simonGames, obsoleteGameIDsTable);
-}
+bool engineCreate(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) {
+ const AGOS::AGOSGameDescription *gd = (const AGOS::AGOSGameDescription *)(encapsulatedDesc.realDesc);
+ bool res = true;
-GameList Engine_AGOS_detectGames(const FSList &fslist) {
- return Common::AdvancedDetector::detectAllGames(fslist, detectionParams);
-}
-
-PluginError Engine_AGOS_create(OSystem *syst, Engine **engine) {
- assert(engine);
- const char *gameid = ConfMan.get("gameid").c_str();
-
- //Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
- //const AGOSGameDescription *gd = (const AGOSGameDescription *)(encapsulatedDesc.realDesc);
- //if (gd == 0) {
- // return kNoGameDataFoundError;
- //}
-
- if (!scumm_stricmp("elvira1", gameid)) {
+ switch (gd->gameType) {
+ case AGOS::GType_ELVIRA1:
*engine = new AGOS::AGOSEngine_Elvira1(syst);
- } else if (!scumm_stricmp("elvira2", gameid)) {
+ break;
+ case AGOS::GType_ELVIRA2:
*engine = new AGOS::AGOSEngine_Elvira2(syst);
- } else if (!scumm_stricmp("waxworks", gameid)) {
+ break;
+ case AGOS::GType_WW:
*engine = new AGOS::AGOSEngine_Waxworks(syst);
- } else if (!scumm_stricmp("simon1", gameid)) {
+ break;
+ case AGOS::GType_SIMON1:
*engine = new AGOS::AGOSEngine_Simon1(syst);
- } else if (!scumm_stricmp("simon2", gameid)) {
+ break;
+ case AGOS::GType_SIMON2:
*engine = new AGOS::AGOSEngine_Simon2(syst);
- } else if (!scumm_stricmp("feeble", gameid)) {
+ break;
+ case AGOS::GType_FF:
*engine = new AGOS::AGOSEngine_Feeble(syst);
- } else if (!scumm_stricmp("dimp", gameid)) {
- *engine = new AGOS::AGOSEngine_PuzzlePack(syst);
- } else if (!scumm_stricmp("jumble", gameid)) {
+ break;
+ case AGOS::GType_PP:
*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
- } else if (!scumm_stricmp("puzzle", gameid)) {
- *engine = new AGOS::AGOSEngine_PuzzlePack(syst);
- } else if (!scumm_stricmp("swampy", gameid)) {
- *engine = new AGOS::AGOSEngine_PuzzlePack(syst);
- } else {
- error("AGOS engine created with invalid gameid");
+ break;
+ default:
+ res = false;
+ error("AGOS engine: unknown gameType");
}
- return kNoError;
+ return res;
}
-
+
+ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(AGOS, engineCreate, detectionParams);
+
REGISTER_PLUGIN(AGOS, "AGOS", "AGOS (C) Adventure Soft");
namespace AGOS {