aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/plugin.cpp
diff options
context:
space:
mode:
authorMax Horn2007-02-09 18:23:59 +0000
committerMax Horn2007-02-09 18:23:59 +0000
commit7940720d71edcc6476e6b5f8f56d174ccb65b3f7 (patch)
treef392ce06fb03d08e51c9e5fc62ac0ad145a2e53a /engines/scumm/plugin.cpp
parent16a29408080d05016ec31da1c49c13e4a704c3e5 (diff)
downloadscummvm-rg350-7940720d71edcc6476e6b5f8f56d174ccb65b3f7.tar.gz
scummvm-rg350-7940720d71edcc6476e6b5f8f56d174ccb65b3f7.tar.bz2
scummvm-rg350-7940720d71edcc6476e6b5f8f56d174ccb65b3f7.zip
SCUMM: Added preferredtarget support
svn-id: r25453
Diffstat (limited to 'engines/scumm/plugin.cpp')
-rw-r--r--engines/scumm/plugin.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/engines/scumm/plugin.cpp b/engines/scumm/plugin.cpp
index 96095c9ddd..64db74de2c 100644
--- a/engines/scumm/plugin.cpp
+++ b/engines/scumm/plugin.cpp
@@ -975,7 +975,7 @@ static Common::String generateFilenameForDetection(const GameFilenamePattern &gf
}
struct DetectorDesc {
- FilesystemNode node;
+ FilesystemNode node;
Common::String md5;
uint8 md5sum[16];
const MD5Table *md5Entry; // Entry of the md5 table corresponding to this file, if any.
@@ -1346,7 +1346,6 @@ static bool testGame(const GameSettings *g, const DescMap &fileMD5Map, const Com
using namespace Scumm;
-
GameList Engine_SCUMM_gameIDList() {
const PlainGameDescriptor *g = gameDescriptions;
GameList games;
@@ -1393,6 +1392,27 @@ GameList Engine_SCUMM_detectGames(const FSList &fslist) {
GameDescriptor dg(x->game.gameid, findDescriptionFromGameID(x->game.gameid),
x->language, x->game.platform);
dg.updateDesc(x->extra); // Append additional information, if set, to the description.
+
+ // Compute and set the preferred target name for this game.
+ // Based on generateComplexID() in advancedDetector.cpp.
+ // TODO: Maybe also take the "extra" field into account, somehow?
+ // I.e. in order to distinguish the target names of e.g. EGA and
+ // VGA versions.
+ // Alternatively: add a "preferredTargetPrefix" field to the gameVariantsTable
+ // (with value 0 by default, implying "use the gameid as prefix").
+ // If we do that,
+ Common::String res(x->game.gameid);
+
+ if (x->game.platform != Common::kPlatformPC && x->game.platform != Common::kPlatformUnknown) {
+ res = res + "-" + Common::getPlatformAbbrev(x->game.platform);
+ }
+
+ if (x->language != Common::EN_ANY && x->language != Common::UNK_LANG) {
+ res = res + "-" + Common::getLanguageCode(x->language);
+ }
+
+ dg["preferredtarget"] = res;
+
detectedGames.push_back(dg);
}