diff options
author | Max Horn | 2006-03-09 12:52:10 +0000 |
---|---|---|
committer | Max Horn | 2006-03-09 12:52:10 +0000 |
commit | 46ee5c8f26b8b53d0c7268a8328edea0b4134611 (patch) | |
tree | f59d90e1b7aa70dc0a5e9e0e37112cf5023899bd /engines | |
parent | cd732d680bf251458fe8c22e8694e2475e3b2927 (diff) | |
download | scummvm-rg350-46ee5c8f26b8b53d0c7268a8328edea0b4134611.tar.gz scummvm-rg350-46ee5c8f26b8b53d0c7268a8328edea0b4134611.tar.bz2 scummvm-rg350-46ee5c8f26b8b53d0c7268a8328edea0b4134611.zip |
Added new method DetectedGame::updateDesc, to ease generation of uniform description strings
svn-id: r21166
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/plugin.cpp | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/engines/scumm/plugin.cpp b/engines/scumm/plugin.cpp index f3f337370d..b452f09d25 100644 --- a/engines/scumm/plugin.cpp +++ b/engines/scumm/plugin.cpp @@ -1150,12 +1150,8 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) { fileSet[file->path()] = false; } - // If known, add the platform to the description string - if (dg.platform != Common::kPlatformUnknown) { - dg.description += "("; - dg.description += Common::getPlatformDescription(dg.platform); - dg.description += ")"; - } + dg.updateDesc(); // Append the platform, if set, to the description. + detectedGames.push_back(dg); break; } @@ -1200,28 +1196,7 @@ DetectedGameList Engine_SCUMM_detectGames(const FSList &fslist) { dg.platform = Common::kPlatformMacintosh; else dg.platform = elem->platform; - - const bool hasCustomLanguage = (dg.language != Common::UNK_LANG); - const bool hasCustomPlatform = (dg.platform != Common::kPlatformUnknown); - const bool hasExtraDesc = (elem->extra && elem->extra[0]); - - // Adapt the description string if custom platform/language is set. - if (hasCustomLanguage || hasCustomPlatform || hasExtraDesc) { - dg.description += " ("; - if (hasCustomLanguage) - dg.description += Common::getLanguageDescription(dg.language); - if (hasCustomPlatform) { - if (hasCustomLanguage) - dg.description += "/"; - dg.description += Common::getPlatformDescription(dg.platform); - } - if (hasExtraDesc) { - if (hasCustomPlatform || hasCustomLanguage) - dg.description += "/"; - dg.description += elem->extra; - } - dg.description += ")"; - } + dg.updateDesc(elem->extra); // Append extra information to the description. // Insert the 'enhanced' game data into the candidate list detectedGames.push_back(dg); |