aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/detection.cpp10
-rw-r--r--engines/agos/game.cpp10
-rw-r--r--engines/cine/detection.cpp10
-rw-r--r--engines/gob/detection.cpp22
-rw-r--r--engines/kyra/plugin.cpp15
-rw-r--r--engines/parallaction/detection.cpp8
-rw-r--r--engines/saga/game.cpp8
-rw-r--r--engines/touche/plugin.cpp8
8 files changed, 45 insertions, 46 deletions
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 96e74d2da7..920ef287ce 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -1741,6 +1741,8 @@ static const Common::ADParams detectionParams = {
"agi",
// List of files for file-based fallback detection (optional)
0,
+ // Fallback callback
+ 0,
// Flags
Common::kADFlagAugmentPreferredTarget
};
@@ -1752,12 +1754,8 @@ REGISTER_PLUGIN(AGI, "AGI v2 + v3 Engine", "Sierra AGI Engine (C) Sierra On-Line
namespace Agi {
bool AgiEngine::initGame() {
- int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
- if (i < 0)
- return false;
-
- _gameDescription = &gameDescriptions[i];
- return true;
+ _gameDescription = (const AGIGameDescription *)Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+ return (_gameDescription != 0);
}
} // End of namespace Agi
diff --git a/engines/agos/game.cpp b/engines/agos/game.cpp
index 6df5a1a7a5..e0e60c43a2 100644
--- a/engines/agos/game.cpp
+++ b/engines/agos/game.cpp
@@ -96,6 +96,8 @@ static const Common::ADParams detectionParams = {
0,
// List of files for file-based fallback detection (optional)
0,
+ // Fallback callback
+ 0,
// Flags
Common::kADFlagAugmentPreferredTarget
};
@@ -107,12 +109,8 @@ REGISTER_PLUGIN(AGOS, "AGOS", "AGOS (C) Adventure Soft");
namespace AGOS {
bool AGOSEngine::initGame() {
- int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
- if (i < 0)
- return false;
-
- _gameDescription = &gameDescriptions[i];
- return true;
+ _gameDescription = (const AGOSGameDescription *)Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+ return (_gameDescription != 0);
}
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index ad5f917e91..7edb196d02 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -480,6 +480,8 @@ static const Common::ADParams detectionParams = {
"cine",
// List of files for file-based fallback detection (optional)
0,
+ // Fallback callback
+ 0,
// Flags
Common::kADFlagAugmentPreferredTarget
};
@@ -491,12 +493,8 @@ REGISTER_PLUGIN(CINE, "Cinematique evo 1 engine", "Future Wars & Operation Steal
namespace Cine {
bool CineEngine::initGame() {
- int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
- if (i < 0)
- return false;
-
- _gameDescription = &gameDescriptions[i];
- return true;
+ _gameDescription = (const CINEGameDescription *)Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+ return (_gameDescription != 0);
}
} // End of namespace Cine
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index 7140892787..8dca4c4eb7 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -913,6 +913,8 @@ static const ADParams detectionParams = {
"gob",
// List of files for file-based fallback detection (optional)
Gob::fileBased,
+ // Fallback callback
+ 0,
// Flags
kADFlagAugmentPreferredTarget
};
@@ -925,25 +927,27 @@ REGISTER_PLUGIN(GOB, "Gob Engine", "Goblins Games (C) Coktel Vision");
namespace Gob {
bool GobEngine::detectGame() {
- int i = AdvancedDetector::detectBestMatchingGame(detectionParams);
+ const GOBGameDescription *gd = (const GOBGameDescription *)Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+ if (gd == 0)
+ return false;
- if (gameDescriptions[i].startTotBase == 0) {
+ if (gd->startTotBase == 0) {
_startTot = new char[10];
_startTot0 = new char[11];
strcpy(_startTot, "intro.tot");
strcpy(_startTot0, "intro0.tot");
} else {
- _startTot = new char[strlen(gameDescriptions[i].startTotBase) + 5];
- _startTot0 = new char[strlen(gameDescriptions[i].startTotBase) + 6];
- strcpy(_startTot, gameDescriptions[i].startTotBase);
- strcpy(_startTot0, gameDescriptions[i].startTotBase);
+ _startTot = new char[strlen(gd->startTotBase) + 5];
+ _startTot0 = new char[strlen(gd->startTotBase) + 6];
+ strcpy(_startTot, gd->startTotBase);
+ strcpy(_startTot0, gd->startTotBase);
strcat(_startTot, ".tot");
strcat(_startTot0, "0.tot");
}
- _features = gameDescriptions[i].features;
- _language = gameDescriptions[i].desc.language;
- _platform = gameDescriptions[i].desc.platform;
+ _features = gd->features;
+ _language = gd->desc.language;
+ _platform = gd->desc.platform;
return true;
}
diff --git a/engines/kyra/plugin.cpp b/engines/kyra/plugin.cpp
index 0fdf766cc9..25b7df4ae4 100644
--- a/engines/kyra/plugin.cpp
+++ b/engines/kyra/plugin.cpp
@@ -97,6 +97,8 @@ const Common::ADParams detectionParams = {
0,
// List of files for file-based fallback detection (optional)
0,
+ // Fallback callback
+ 0,
// Flags
0
};
@@ -119,19 +121,16 @@ PluginError Engine_KYRA_create(OSystem *syst, Engine **engine) {
assert(engine);
const char *gameid = ConfMan.get("gameid").c_str();
- int id = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
- if (id == -1) {
- // FIXME: This case currently can never happen, as we simply error out
- // inside AdvancedDetector::detectBestMatchingGame.
-
+ const KYRAGameDescription *gd = (const KYRAGameDescription *)Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+ if (gd == 0) {
// maybe add non md5 based detection again?
return kNoGameDataFoundError;
}
- Kyra::GameFlags flags = adGameDescs[id].flags;
+ Kyra::GameFlags flags = gd->flags;
- flags.lang = adGameDescs[id].desc.language;
- flags.platform = adGameDescs[id].desc.platform;
+ flags.lang = gd->desc.language;
+ flags.platform = gd->desc.platform;
Common::Platform platform = Common::parsePlatform(ConfMan.get("platform"));
if (platform != Common::kPlatformUnknown) {
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp
index 23db8c0597..dd8c3706ff 100644
--- a/engines/parallaction/detection.cpp
+++ b/engines/parallaction/detection.cpp
@@ -94,6 +94,8 @@ static const Common::ADParams detectionParams = {
"parallaction",
// List of files for file-based fallback detection (optional)
0,
+ // Fallback callback
+ 0,
// Flags
Common::kADFlagAugmentPreferredTarget
};
@@ -106,10 +108,8 @@ REGISTER_PLUGIN(PARALLACTION, "Parallaction engine", "Nippon Safes Inc. (C) Dyna
namespace Parallaction {
bool Parallaction::detectGame() {
- int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
-
- _gameDescription = &gameDescriptions[i];
- return true;
+ _gameDescription = (const PARALLACTIONGameDescription *)Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+ return (_gameDescription != 0);
}
} // End of namespace Parallaction
diff --git a/engines/saga/game.cpp b/engines/saga/game.cpp
index ca3e4ddfca..820331b9c7 100644
--- a/engines/saga/game.cpp
+++ b/engines/saga/game.cpp
@@ -115,6 +115,8 @@ static const Common::ADParams detectionParams = {
"saga",
// List of files for file-based fallback detection (optional)
0,
+ // Fallback callback
+ 0,
// Flags
Common::kADFlagAugmentPreferredTarget
};
@@ -126,12 +128,10 @@ REGISTER_PLUGIN(SAGA, "SAGA Engine", "Inherit the Earth (C) Wyrmkeep Entertainme
namespace Saga {
bool SagaEngine::initGame() {
- int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
- if (i < 0)
+ _gameDescription = (const SAGAGameDescription *)Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+ if (_gameDescription == 0)
return false;
- _gameDescription = &gameDescriptions[i];
-
_gameDisplayInfo = *_gameDescription->gameDisplayInfo;
_displayClip.right = _gameDisplayInfo.logicalWidth;
_displayClip.bottom = _gameDisplayInfo.logicalHeight;
diff --git a/engines/touche/plugin.cpp b/engines/touche/plugin.cpp
index 3749a73027..5bd94d69d3 100644
--- a/engines/touche/plugin.cpp
+++ b/engines/touche/plugin.cpp
@@ -108,6 +108,8 @@ static const Common::ADParams detectionParams = {
"touche",
// List of files for file-based fallback detection (optional)
0,
+ // Fallback callback
+ 0,
// Flags
0
};
@@ -119,11 +121,11 @@ REGISTER_PLUGIN(TOUCHE, "Touche Engine", "Touche: The Adventures of the 5th Musk
namespace Touche {
bool ToucheEngine::detectGame() {
- int i = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
- if (i < 0)
+ const Common::ADGameDescription *gd = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
+ if (gd == 0)
return false;
- _language = gameDescriptions[i].language;
+ _language = gd->language;
return true;
}