aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2018-05-06 12:57:08 +0200
committerBastien Bouclet2018-05-10 09:04:23 +0200
commit8fb149e3c7603f023dfccf2b2056a9a2fda431c2 (patch)
treea758cefc70a784a65045d09d96f44ed1c16abbb8
parentcf1ebf29516bd74927fd7b632b72fd8973f72e98 (diff)
downloadscummvm-rg350-8fb149e3c7603f023dfccf2b2056a9a2fda431c2.tar.gz
scummvm-rg350-8fb149e3c7603f023dfccf2b2056a9a2fda431c2.tar.bz2
scummvm-rg350-8fb149e3c7603f023dfccf2b2056a9a2fda431c2.zip
ENGINES: Change MetaEngine::findGame to return a plain game descriptor
-rw-r--r--base/commandLine.cpp14
-rw-r--r--base/main.cpp9
-rw-r--r--base/plugins.cpp16
-rw-r--r--engines/advancedDetector.cpp6
-rw-r--r--engines/advancedDetector.h2
-rw-r--r--engines/agos/detection.cpp2
-rw-r--r--engines/cine/detection.cpp2
-rw-r--r--engines/game.h5
-rw-r--r--engines/gob/detection/detection.cpp4
-rw-r--r--engines/metaengine.h8
-rw-r--r--engines/obsolete.cpp10
-rw-r--r--engines/obsolete.h2
-rw-r--r--engines/saga/detection.cpp2
-rw-r--r--engines/scumm/detection.cpp4
-rw-r--r--engines/sky/detection.cpp8
-rw-r--r--engines/sword1/detection.cpp18
-rw-r--r--engines/sword2/sword2.cpp6
-rw-r--r--gui/EventRecorder.cpp4
-rw-r--r--gui/editgamedialog.cpp8
-rw-r--r--gui/editgamedialog.h2
-rw-r--r--gui/launcher.cpp11
-rw-r--r--gui/recorderdialog.cpp4
22 files changed, 77 insertions, 70 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 8e701408ef..0755165094 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -714,10 +714,10 @@ static void listTargets() {
// FIXME: At this point, we should check for a "gameid" override
// to find the proper desc. In fact, the platform probably should
// be taken into account, too.
- Common::String gameid(name);
- GameDescriptor g = EngineMan.findGame(gameid);
- if (g.description().size() > 0)
- description = g.description();
+ const Common::String &gameid = name;
+ PlainGameDescriptor g = EngineMan.findGame(gameid);
+ if (g.description)
+ description = g.description;
}
targets.push_back(Common::String::format("%-20s %s", name.c_str(), description.c_str()));
@@ -770,7 +770,7 @@ static Common::Error listSaves(const Common::String &target) {
// Find the plugin that will handle the specified gameid
const Plugin *plugin = nullptr;
- GameDescriptor game = EngineMan.findGame(gameid, &plugin);
+ EngineMan.findGame(gameid, &plugin);
if (!plugin) {
// If the target was specified, treat this as an error, and otherwise skip it.
@@ -1276,8 +1276,8 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
// domain (i.e. a target) matching this argument, or alternatively
// whether there is a gameid matching that name.
if (!command.empty()) {
- GameDescriptor gd = EngineMan.findGame(command);
- if (ConfMan.hasGameDomain(command) || !gd.gameid().empty()) {
+ PlainGameDescriptor gd = EngineMan.findGame(command);
+ if (ConfMan.hasGameDomain(command) || gd.gameId) {
bool idCameFromCommandLine = false;
// WORKAROUND: Fix for bug #1719463: "DETECTOR: Launching
diff --git a/base/main.cpp b/base/main.cpp
index 8e783c9776..385b8f35a9 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -128,13 +128,13 @@ static const Plugin *detectPlugin() {
printf("User picked target '%s' (gameid '%s')...\n", ConfMan.getActiveDomainName().c_str(), gameid.c_str());
printf(" Looking for a plugin supporting this gameid... ");
- GameDescriptor game = EngineMan.findGame(gameid, &plugin);
+ PlainGameDescriptor game = EngineMan.findGame(gameid, &plugin);
if (plugin == 0) {
printf("failed\n");
warning("%s is an invalid gameid. Use the --list-games option to list supported gameid", gameid.c_str());
} else {
- printf("%s\n Starting '%s'\n", plugin->getName(), game.description().c_str());
+ printf("%s\n Starting '%s'\n", plugin->getName(), game.description);
}
return plugin;
@@ -210,7 +210,10 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
Common::String caption(ConfMan.get("description"));
if (caption.empty()) {
- caption = EngineMan.findGame(ConfMan.get("gameid")).description();
+ PlainGameDescriptor game = EngineMan.findGame(ConfMan.get("gameid"));
+ if (game.description) {
+ caption = game.description;
+ }
}
if (caption.empty())
caption = ConfMan.getActiveDomainName(); // Use the domain (=target) name
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 02f6998ad9..25dd3e1e0c 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -458,13 +458,13 @@ DECLARE_SINGLETON(EngineManager);
* For the uncached version, we first try to find the plugin using the gameId
* and only if we can't find it there, we loop through the plugins.
**/
-GameDescriptor EngineManager::findGame(const Common::String &gameName, const Plugin **plugin) const {
- GameDescriptor result;
+PlainGameDescriptor EngineManager::findGame(const Common::String &gameName, const Plugin **plugin) const {
+ PlainGameDescriptor result;
// First look for the game using the plugins in memory. This is critical
// for calls coming from inside games
result = findGameInLoadedPlugins(gameName, plugin);
- if (!result.gameid().empty()) {
+ if (result.gameId) {
return result;
}
@@ -472,7 +472,7 @@ GameDescriptor EngineManager::findGame(const Common::String &gameName, const Plu
// by plugin
if (PluginMan.loadPluginFromGameId(gameName)) {
result = findGameInLoadedPlugins(gameName, plugin);
- if (!result.gameid().empty()) {
+ if (result.gameId) {
return result;
}
}
@@ -481,7 +481,7 @@ GameDescriptor EngineManager::findGame(const Common::String &gameName, const Plu
PluginMan.loadFirstPlugin();
do {
result = findGameInLoadedPlugins(gameName, plugin);
- if (!result.gameid().empty()) {
+ if (result.gameId) {
// Update with new plugin file name
PluginMan.updateConfigWithFileName(gameName);
break;
@@ -494,10 +494,10 @@ GameDescriptor EngineManager::findGame(const Common::String &gameName, const Plu
/**
* Find the game within the plugins loaded in memory
**/
-GameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin) const {
+PlainGameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin) const {
// Find the GameDescriptor for this target
const PluginList &plugins = getPlugins();
- GameDescriptor result;
+ PlainGameDescriptor result;
if (plugin)
*plugin = 0;
@@ -506,7 +506,7 @@ GameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &game
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
result = (*iter)->get<MetaEngine>().findGame(gameName.c_str());
- if (!result.gameid().empty()) {
+ if (result.gameId) {
if (plugin)
*plugin = *iter;
return result;
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index 9c1a700423..43c2082c7d 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -602,14 +602,14 @@ GameList AdvancedMetaEngine::getSupportedGames() const {
return GameList(_gameIds);
}
-GameDescriptor AdvancedMetaEngine::findGame(const char *gameId) const {
+PlainGameDescriptor AdvancedMetaEngine::findGame(const char *gameId) const {
// First search the list of supported gameids for a match.
const PlainGameDescriptor *g = findPlainGameDescriptor(gameId, _gameIds);
if (g)
- return GameDescriptor(*g);
+ return *g;
// No match found
- return GameDescriptor();
+ return PlainGameDescriptor();
}
AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameIds, const ADExtraGuiOptionsMap *extraGuiOptions)
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index f1f55d0b4b..ec52134c78 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -267,7 +267,7 @@ public:
*/
virtual GameList getSupportedGames() const;
- virtual GameDescriptor findGame(const char *gameId) const;
+ PlainGameDescriptor findGame(const char *gameId) const override;
DetectedGames detectGames(const Common::FSList &fslist) const override;
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index dbc4ee9145..1847434200 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -99,7 +99,7 @@ public:
_directoryGlobs = directoryGlobs;
}
- virtual GameDescriptor findGame(const char *gameId) const {
+ PlainGameDescriptor findGame(const char *gameId) const override {
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
}
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index 6c8b4a676d..f1636c902b 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -84,7 +84,7 @@ public:
_guiOptions = GUIO2(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVELOAD);
}
- virtual GameDescriptor findGame(const char *gameId) const {
+ PlainGameDescriptor findGame(const char *gameId) const override {
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
}
diff --git a/engines/game.h b/engines/game.h
index 54c1af3949..88033dcf09 100644
--- a/engines/game.h
+++ b/engines/game.h
@@ -38,6 +38,9 @@
struct PlainGameDescriptor {
const char *gameId;
const char *description;
+
+ PlainGameDescriptor() : gameId(nullptr), description(nullptr) {}
+ PlainGameDescriptor(const char *id, const char *desc) : gameId(id), description(desc) {}
};
/**
@@ -66,7 +69,7 @@ enum GameSupportLevel {
class GameDescriptor : public Common::StringMap {
public:
GameDescriptor();
- GameDescriptor(const PlainGameDescriptor &pgd, Common::String guioptions = Common::String());
+ explicit GameDescriptor(const PlainGameDescriptor &pgd, Common::String guioptions = Common::String());
GameDescriptor(const Common::String &gameid,
const Common::String &description,
Common::Language language = Common::UNK_LANG,
diff --git a/engines/gob/detection/detection.cpp b/engines/gob/detection/detection.cpp
index 487b65f4a8..864a701aa6 100644
--- a/engines/gob/detection/detection.cpp
+++ b/engines/gob/detection/detection.cpp
@@ -33,7 +33,7 @@ class GobMetaEngine : public AdvancedMetaEngine {
public:
GobMetaEngine();
- virtual GameDescriptor findGame(const char *gameId) const;
+ PlainGameDescriptor findGame(const char *gameId) const override;
ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const override;
@@ -59,7 +59,7 @@ GobMetaEngine::GobMetaEngine() :
_guiOptions = GUIO1(GUIO_NOLAUNCHLOAD);
}
-GameDescriptor GobMetaEngine::findGame(const char *gameId) const {
+PlainGameDescriptor GobMetaEngine::findGame(const char *gameId) const {
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
}
diff --git a/engines/metaengine.h b/engines/metaengine.h
index 9a0280d116..9ce8dc9f11 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -71,8 +71,8 @@ public:
/** Returns a list of games supported by this engine. */
virtual GameList getSupportedGames() const = 0;
- /** Query the engine for a GameDescriptor for the specified gameid, if any. */
- virtual GameDescriptor findGame(const char *gameid) const = 0;
+ /** Query the engine for a PlainGameDescriptor for the specified gameid, if any. */
+ virtual PlainGameDescriptor findGame(const char *gameId) const = 0;
/**
* Runs the engine's game detector on the given list of files, and returns a
@@ -267,8 +267,8 @@ public:
*/
class EngineManager : public Common::Singleton<EngineManager> {
public:
- GameDescriptor findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin = NULL) const;
- GameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL) const;
+ PlainGameDescriptor findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin = NULL) const;
+ PlainGameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL) const;
DetectionResults detectGames(const Common::FSList &fslist) const;
const PluginList &getPlugins() const;
};
diff --git a/engines/obsolete.cpp b/engines/obsolete.cpp
index d65fb13ec1..48809df712 100644
--- a/engines/obsolete.cpp
+++ b/engines/obsolete.cpp
@@ -55,7 +55,7 @@ void upgradeTargetIfNecessary(const ObsoleteGameID *obsoleteList) {
}
}
-GameDescriptor findGameID(
+PlainGameDescriptor findGameID(
const char *gameid,
const PlainGameDescriptor *gameids,
const ObsoleteGameID *obsoleteList
@@ -63,7 +63,7 @@ GameDescriptor findGameID(
// First search the list of supported gameids for a match.
const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, gameids);
if (g)
- return GameDescriptor(*g);
+ return *g;
// If we didn't find the gameid in the main list, check if it
// is an obsolete game id.
@@ -73,16 +73,16 @@ GameDescriptor findGameID(
if (0 == scumm_stricmp(gameid, o->from)) {
g = findPlainGameDescriptor(o->to, gameids);
if (g && g->description)
- return GameDescriptor(gameid, "Obsolete game ID (" + Common::String(g->description) + ")");
+ return PlainGameDescriptor(gameid, g->description);
else
- return GameDescriptor(gameid, "Obsolete game ID");
+ return PlainGameDescriptor(gameid, "Obsolete game ID");
}
o++;
}
}
// No match found
- return GameDescriptor();
+ return PlainGameDescriptor();
}
} // End of namespace Engines
diff --git a/engines/obsolete.h b/engines/obsolete.h
index be0963a7dc..7c7249e52b 100644
--- a/engines/obsolete.h
+++ b/engines/obsolete.h
@@ -66,7 +66,7 @@ void upgradeTargetIfNecessary(const ObsoleteGameID *obsoleteList);
* Optionally can take a list of obsolete game ids into account in order
* to support obsolete gameids.
*/
-GameDescriptor findGameID(
+PlainGameDescriptor findGameID(
const char *gameid,
const PlainGameDescriptor *gameids,
const ObsoleteGameID *obsoleteList = 0
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index fcd78502d9..82c29d3389 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -105,7 +105,7 @@ public:
_singleId = "saga";
}
- virtual GameDescriptor findGame(const char *gameId) const {
+ PlainGameDescriptor findGame(const char *gameId) const override {
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
}
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 078cc8de27..2ba5bd3f74 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -960,7 +960,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
- virtual GameDescriptor findGame(const char *gameid) const;
+ PlainGameDescriptor findGame(const char *gameid) const override;
virtual DetectedGames detectGames(const Common::FSList &fslist) const override;
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
@@ -996,7 +996,7 @@ GameList ScummMetaEngine::getSupportedGames() const {
return GameList(gameDescriptions);
}
-GameDescriptor ScummMetaEngine::findGame(const char *gameid) const {
+PlainGameDescriptor ScummMetaEngine::findGame(const char *gameid) const {
return Engines::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable);
}
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index cc1f1adc82..629996bae1 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -78,7 +78,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const;
- virtual GameDescriptor findGame(const char *gameid) const;
+ PlainGameDescriptor findGame(const char *gameid) const override;
DetectedGames detectGames(const Common::FSList &fslist) const override;
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
@@ -112,7 +112,7 @@ bool Sky::SkyEngine::hasFeature(EngineFeature f) const {
GameList SkyMetaEngine::getSupportedGames() const {
GameList games;
- games.push_back(skySetting);
+ games.push_back(GameDescriptor(skySetting));
return games;
}
@@ -135,10 +135,10 @@ const ExtraGuiOptions SkyMetaEngine::getExtraGuiOptions(const Common::String &ta
return options;
}
-GameDescriptor SkyMetaEngine::findGame(const char *gameid) const {
+PlainGameDescriptor SkyMetaEngine::findGame(const char *gameid) const {
if (0 == scumm_stricmp(gameid, skySetting.gameId))
return skySetting;
- return GameDescriptor();
+ return PlainGameDescriptor();
}
DetectedGames SkyMetaEngine::detectGames(const Common::FSList &fslist) const {
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index 7fb86fec0b..62e8f1c905 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -88,7 +88,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
- virtual GameDescriptor findGame(const char *gameid) const;
+ PlainGameDescriptor findGame(const char *gameId) const override;
DetectedGames detectGames(const Common::FSList &fslist) const override;
virtual SaveStateList listSaves(const char *target) const;
virtual int getMaximumSaveSlot() const;
@@ -127,20 +127,20 @@ GameList SwordMetaEngine::getSupportedGames() const {
return games;
}
-GameDescriptor SwordMetaEngine::findGame(const char *gameid) const {
- if (0 == scumm_stricmp(gameid, sword1FullSettings.gameId))
+PlainGameDescriptor SwordMetaEngine::findGame(const char *gameId) const {
+ if (0 == scumm_stricmp(gameId, sword1FullSettings.gameId))
return sword1FullSettings;
- if (0 == scumm_stricmp(gameid, sword1DemoSettings.gameId))
+ if (0 == scumm_stricmp(gameId, sword1DemoSettings.gameId))
return sword1DemoSettings;
- if (0 == scumm_stricmp(gameid, sword1MacFullSettings.gameId))
+ if (0 == scumm_stricmp(gameId, sword1MacFullSettings.gameId))
return sword1MacFullSettings;
- if (0 == scumm_stricmp(gameid, sword1MacDemoSettings.gameId))
+ if (0 == scumm_stricmp(gameId, sword1MacDemoSettings.gameId))
return sword1MacDemoSettings;
- if (0 == scumm_stricmp(gameid, sword1PSXSettings.gameId))
+ if (0 == scumm_stricmp(gameId, sword1PSXSettings.gameId))
return sword1PSXSettings;
- if (0 == scumm_stricmp(gameid, sword1PSXDemoSettings.gameId))
+ if (0 == scumm_stricmp(gameId, sword1PSXDemoSettings.gameId))
return sword1PSXDemoSettings;
- return GameDescriptor();
+ return PlainGameDescriptor();
}
void Sword1CheckDirectory(const Common::FSList &fslist, bool *filesFound, bool recursion = false) {
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 27fcc74ad5..bf2f329119 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -94,7 +94,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const;
- virtual GameDescriptor findGame(const char *gameid) const;
+ PlainGameDescriptor findGame(const char *gameid) const override;
virtual DetectedGames detectGames(const Common::FSList &fslist) const;
virtual SaveStateList listSaves(const char *target) const;
virtual int getMaximumSaveSlot() const;
@@ -135,14 +135,14 @@ const ExtraGuiOptions Sword2MetaEngine::getExtraGuiOptions(const Common::String
return options;
}
-GameDescriptor Sword2MetaEngine::findGame(const char *gameid) const {
+PlainGameDescriptor Sword2MetaEngine::findGame(const char *gameid) const {
const Sword2::GameSettings *g = Sword2::sword2_settings;
while (g->gameid) {
if (0 == scumm_stricmp(gameid, g->gameid))
break;
g++;
}
- return GameDescriptor(g->gameid, g->description);
+ return PlainGameDescriptor(g->gameid, g->description);
}
bool isFullGame(const Common::FSList &fslist) {
diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index 849405410a..560df0ec35 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -600,13 +600,13 @@ void EventRecorder::setFileHeader() {
return;
}
TimeDate t;
- GameDescriptor desc = EngineMan.findGame(ConfMan.getActiveDomainName());
+ PlainGameDescriptor desc = EngineMan.findGame(ConfMan.getActiveDomainName());
g_system->getTimeAndDate(t);
if (_author.empty()) {
setAuthor("Unknown Author");
}
if (_name.empty()) {
- g_eventRec.setName(Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description());
+ g_eventRec.setName(Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description);
}
_playbackFile->getHeader().author = _author;
_playbackFile->getHeader().notes = _desc;
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index 4192c4058a..c4cf6e7800 100644
--- a/gui/editgamedialog.cpp
+++ b/gui/editgamedialog.cpp
@@ -95,7 +95,7 @@ protected:
}
};
-EditGameDialog::EditGameDialog(const String &domain, const String &desc)
+EditGameDialog::EditGameDialog(const String &domain)
: OptionsDialog(domain, "GameOptions") {
// Retrieve all game specific options.
const Plugin *plugin = nullptr;
@@ -106,7 +106,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
gameId = domain;
// Retrieve the plugin, since we need to access the engine's MetaEngine
// implementation.
- EngineMan.findGame(gameId, &plugin);
+ PlainGameDescriptor pgd = EngineMan.findGame(gameId, &plugin);
if (plugin) {
_engineOptions = plugin->get<MetaEngine>().getExtraGuiOptions(domain);
} else {
@@ -120,8 +120,8 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
// GAME: Determine the description string
String description(ConfMan.get("description", domain));
- if (description.empty() && !desc.empty()) {
- description = desc;
+ if (description.empty() && pgd.description) {
+ description = pgd.description;
}
// GUI: Add tab widget
diff --git a/gui/editgamedialog.h b/gui/editgamedialog.h
index a317e364c6..06a8514dd5 100644
--- a/gui/editgamedialog.h
+++ b/gui/editgamedialog.h
@@ -62,7 +62,7 @@ class EditGameDialog : public OptionsDialog {
typedef Common::String String;
typedef Common::Array<Common::String> StringArray;
public:
- EditGameDialog(const String &domain, const String &desc);
+ EditGameDialog(const String &domain);
void open();
virtual void apply();
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index b14be6c11e..f257c53e11 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -267,9 +267,9 @@ void LauncherDialog::updateListing() {
if (gameid.empty())
gameid = iter->_key;
if (description.empty()) {
- GameDescriptor g = EngineMan.findGame(gameid);
- if (g.contains("description"))
- description = g.description();
+ PlainGameDescriptor g = EngineMan.findGame(gameid);
+ if (g.description)
+ description = g.description;
}
if (description.empty()) {
@@ -443,7 +443,8 @@ void LauncherDialog::editGame(int item) {
String gameId(ConfMan.get("gameid", _domains[item]));
if (gameId.empty())
gameId = _domains[item];
- EditGameDialog editDialog(_domains[item], EngineMan.findGame(gameId).description());
+
+ EditGameDialog editDialog(_domains[item]);
if (editDialog.runModal() > 0) {
// User pressed OK, so make changes permanent
@@ -612,7 +613,7 @@ bool LauncherDialog::doGameDetection(const Common::String &path) {
Common::String domain = addGameToConf(result);
// Display edit dialog for the new entry
- EditGameDialog editDialog(domain, result.description());
+ EditGameDialog editDialog(domain);
if (editDialog.runModal() > 0) {
// User pressed OK, so make changes permanent
diff --git a/gui/recorderdialog.cpp b/gui/recorderdialog.cpp
index cd89b58f00..7a2cd048f4 100644
--- a/gui/recorderdialog.cpp
+++ b/gui/recorderdialog.cpp
@@ -167,9 +167,9 @@ void RecorderDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
case kRecordCmd: {
TimeDate t;
Common::String gameId = ConfMan.get("gameid", _target);
- GameDescriptor desc = EngineMan.findGame(gameId);
+ PlainGameDescriptor desc = EngineMan.findGame(gameId);
g_system->getTimeAndDate(t);
- EditRecordDialog editDlg(_("Unknown Author"), Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description(), "");
+ EditRecordDialog editDlg(_("Unknown Author"), Common::String::format("%.2d.%.2d.%.4d ", t.tm_mday, t.tm_mon, 1900 + t.tm_year) + desc.description, "");
if (editDlg.runModal() != kOKCmd) {
return;
}