aboutsummaryrefslogtreecommitdiff
path: root/engines/advancedDetector.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2016-09-15 18:39:45 +0200
committerBastien Bouclet2019-11-03 11:43:00 +0100
commitbb813719b56a3e2a51b7c73385d036f61fdde584 (patch)
tree098d51552ed8a5afde854cd8ed00a5f3d7ddc87e /engines/advancedDetector.cpp
parent9c8bd056d6d597a10f7f653b559dc34cd2bd2be9 (diff)
downloadscummvm-rg350-bb813719b56a3e2a51b7c73385d036f61fdde584.tar.gz
scummvm-rg350-bb813719b56a3e2a51b7c73385d036f61fdde584.tar.bz2
scummvm-rg350-bb813719b56a3e2a51b7c73385d036f61fdde584.zip
ENGINES: Change targets to have an 'engine ID'
The engine ID identifies which engine should be used to launch the target. Also remove the 'single ID' system. Different games from engines that used that system now have different game IDs. Also-By: Matthew Hoops <clone2727@gmail.com>
Diffstat (limited to 'engines/advancedDetector.cpp')
-rw-r--r--engines/advancedDetector.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index 10ddb0d073..4cc05aef32 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -82,8 +82,6 @@ static Common::String generatePreferredTarget(const ADGameDescription *desc) {
DetectedGame AdvancedMetaEngine::toDetectedGame(const ADDetectedGame &adGame) const {
const ADGameDescription *desc = adGame.desc;
- const char *gameId = _singleId ? _singleId : desc->gameId;
-
const char *title;
const char *extra;
if (desc->flags & ADGF_USEEXTRAASTITLE) {
@@ -99,7 +97,7 @@ DetectedGame AdvancedMetaEngine::toDetectedGame(const ADDetectedGame &adGame) co
extra = desc->extra;
}
- DetectedGame game(gameId, title, desc->language, desc->platform, extra);
+ DetectedGame game(getEngineId(), desc->gameId, title, desc->language, desc->platform, extra);
game.hasUnknownFiles = adGame.hasUnknownFiles;
game.matchedFiles = adGame.matchedFiles;
game.preferredTarget = generatePreferredTarget(desc);
@@ -264,7 +262,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
ADDetectedGame agdDesc;
for (uint i = 0; i < matches.size(); i++) {
- if ((_singleId || matches[i].desc->gameId == gameid) && !matches[i].hasUnknownFiles) {
+ if (matches[i].desc->gameId == gameid && !matches[i].hasUnknownFiles) {
agdDesc = matches[i];
break;
}
@@ -277,7 +275,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
if (agdDesc.desc) {
// Seems we found a fallback match. But first perform a basic
// sanity check: the gameid must match.
- if (!_singleId && agdDesc.desc->gameId != gameid)
+ if (agdDesc.desc->gameId != gameid)
agdDesc = ADDetectedGame();
}
}
@@ -556,21 +554,6 @@ ADDetectedGame AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles,
}
PlainGameList AdvancedMetaEngine::getSupportedGames() const {
- if (_singleId != NULL) {
- PlainGameList gl;
-
- const PlainGameDescriptor *g = _gameIds;
- while (g->gameId) {
- if (0 == scumm_stricmp(_singleId, g->gameId)) {
- gl.push_back(*g);
-
- return gl;
- }
- g++;
- }
- error("Engine %s doesn't have its singleid specified in ids list", _singleId);
- }
-
return PlainGameList(_gameIds);
}
@@ -589,7 +572,6 @@ AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, con
_extraGuiOptions(extraGuiOptions) {
_md5Bytes = 5000;
- _singleId = NULL;
_flags = 0;
_guiOptions = GUIO_NONE;
_maxScanDepth = 1;