aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorBastien Bouclet2016-09-15 18:39:45 +0200
committerBastien Bouclet2019-11-03 11:43:00 +0100
commitbb813719b56a3e2a51b7c73385d036f61fdde584 (patch)
tree098d51552ed8a5afde854cd8ed00a5f3d7ddc87e /gui
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 'gui')
-rw-r--r--gui/EventRecorder.cpp17
-rw-r--r--gui/launcher.cpp18
-rw-r--r--gui/massadd.cpp7
-rw-r--r--gui/recorderdialog.cpp3
-rw-r--r--gui/saveload.cpp6
-rw-r--r--gui/unknown-game-dialog.cpp4
6 files changed, 22 insertions, 33 deletions
diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index d249ea4eff..a7f6e1be65 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -599,7 +599,7 @@ void EventRecorder::setFileHeader() {
return;
}
TimeDate t;
- PlainGameDescriptor desc = EngineMan.findGame(ConfMan.getActiveDomainName());
+ PlainGameDescriptor desc = EngineMan.findTarget(ConfMan.getActiveDomainName());
g_system->getTimeAndDate(t);
if (_author.empty()) {
setAuthor("Unknown Author");
@@ -618,9 +618,7 @@ SDL_Surface *EventRecorder::getSurface(int width, int height) {
}
bool EventRecorder::switchMode() {
- const Common::String gameId = ConfMan.get("gameid");
- const Plugin *plugin = nullptr;
- EngineMan.findGame(gameId, &plugin);
+ const Plugin *plugin = EngineMan.findPlugin(ConfMan.get("engineid"));
bool metaInfoSupport = plugin->get<MetaEngine>().hasFeature(MetaEngine::kSavesSupportMetaInfo);
bool featuresSupport = metaInfoSupport &&
g_engine->canSaveGameStateCurrently() &&
@@ -630,8 +628,10 @@ bool EventRecorder::switchMode() {
return false;
}
+ const Common::String target = ConfMan.getActiveDomainName();
+ SaveStateList saveList = plugin->get<MetaEngine>().listSaves(target.c_str());
+
int emptySlot = 1;
- SaveStateList saveList = plugin->get<MetaEngine>().listSaves(gameId.c_str());
for (SaveStateList::const_iterator x = saveList.begin(); x != saveList.end(); ++x) {
int saveSlot = x->getSaveSlot();
if (saveSlot == 0) {
@@ -666,10 +666,9 @@ bool EventRecorder::checkForContinueGame() {
void EventRecorder::deleteTemporarySave() {
if (_temporarySlot == -1) return;
- const Common::String gameId = ConfMan.get("gameid");
- const Plugin *plugin = 0;
- EngineMan.findGame(gameId, &plugin);
- plugin->get<MetaEngine>().removeSaveState(gameId.c_str(), _temporarySlot);
+ const Plugin *plugin = EngineMan.findPlugin(ConfMan.get("engineid"));
+ const Common::String target = ConfMan.getActiveDomainName();
+ plugin->get<MetaEngine>().removeSaveState(target.c_str(), _temporarySlot);
_temporarySlot = -1;
}
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index ac414e0fa1..c8c2cc0583 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -269,8 +269,9 @@ void LauncherDialog::updateListing() {
if (gameid.empty())
gameid = iter->_key;
+
if (description.empty()) {
- PlainGameDescriptor g = EngineMan.findGame(gameid);
+ PlainGameDescriptor g = EngineMan.findTarget(iter->_key);
if (g.description)
description = g.description;
}
@@ -416,9 +417,6 @@ void LauncherDialog::editGame(int item) {
// This is useful because e.g. MonkeyVGA needs AdLib music to have decent
// music support etc.
assert(item >= 0);
- String gameId(ConfMan.get("gameid", _domains[item]));
- if (gameId.empty())
- gameId = _domains[item];
EditGameDialog editDialog(_domains[item]);
if (editDialog.runModal() > 0) {
@@ -480,17 +478,13 @@ void LauncherDialog::recordGame(int item) {
#endif
void LauncherDialog::loadGame(int item) {
- String gameId = ConfMan.get("gameid", _domains[item]);
- if (gameId.empty())
- gameId = _domains[item];
-
- const Plugin *plugin = nullptr;
-
- EngineMan.findGame(gameId, &plugin);
-
String target = _domains[item];
target.toLowercase();
+ // Look for the plugin
+ const Plugin *plugin = nullptr;
+ EngineMan.findTarget(target, &plugin);
+
if (plugin) {
const MetaEngine &metaEngine = plugin->get<MetaEngine>();
if (metaEngine.hasFeature(MetaEngine::kSupportsListSaves) &&
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index f4d857a528..1d1d119303 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -207,7 +207,7 @@ void MassAddDialog::handleTickle() {
while (path != "/" && path.lastChar() == '/')
path.deleteLastChar();
- // Check for existing config entries for this path/gameid/lang/platform combination
+ // Check for existing config entries for this path/engineid/gameid/lang/platform combination
if (_pathToTargets.contains(path)) {
Common::String resultPlatformCode = Common::getPlatformCode(result.platform);
Common::String resultLanguageCode = Common::getLanguageCode(result.language);
@@ -215,11 +215,12 @@ void MassAddDialog::handleTickle() {
bool duplicate = false;
const StringArray &targets = _pathToTargets[path];
for (StringArray::const_iterator iter = targets.begin(); iter != targets.end(); ++iter) {
- // If the gameid, platform and language match -> skip it
+ // If the engineid, gameid, platform and language match -> skip it
Common::ConfigManager::Domain *dom = ConfMan.getDomain(*iter);
assert(dom);
- if ((*dom)["gameid"] == result.gameId &&
+ if ((*dom)["engineid"] == result.engineId &&
+ (*dom)["gameid"] == result.gameId &&
(*dom)["platform"] == resultPlatformCode &&
(*dom)["language"] == resultLanguageCode) {
duplicate = true;
diff --git a/gui/recorderdialog.cpp b/gui/recorderdialog.cpp
index 7a2cd048f4..ced5bcbc5b 100644
--- a/gui/recorderdialog.cpp
+++ b/gui/recorderdialog.cpp
@@ -166,8 +166,7 @@ void RecorderDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
break;
case kRecordCmd: {
TimeDate t;
- Common::String gameId = ConfMan.get("gameid", _target);
- PlainGameDescriptor desc = EngineMan.findGame(gameId);
+ PlainGameDescriptor desc = EngineMan.findTarget(_target);
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, "");
if (editDlg.runModal() != kOKCmd) {
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index 6de8be97d8..4e2525a7c6 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -76,11 +76,7 @@ Common::String SaveLoadChooser::createDefaultSaveDescription(const int slot) con
}
int SaveLoadChooser::runModalWithCurrentTarget() {
- const Common::String gameId = ConfMan.get("gameid");
-
- const Plugin *plugin = 0;
- EngineMan.findGame(gameId, &plugin);
-
+ const Plugin *plugin = EngineMan.findPlugin(ConfMan.get("engineid"));
return runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName());
}
diff --git a/gui/unknown-game-dialog.cpp b/gui/unknown-game-dialog.cpp
index 790f724948..cdbfcd4e97 100644
--- a/gui/unknown-game-dialog.cpp
+++ b/gui/unknown-game-dialog.cpp
@@ -193,13 +193,13 @@ Common::String UnknownGameDialog::generateBugtrackerURL() {
Common::String report = generateUnknownGameReport(_detectedGame, false, false);
report = encodeUrlString(report);
- Common::String engineName = encodeUrlString(_detectedGame.engineName);
+ Common::String engineId = encodeUrlString(_detectedGame.engineId);
return Common::String::format(
"https://www.scummvm.org/unknowngame?"
"engine=%s"
"&description=%s",
- engineName.c_str(),
+ engineId.c_str(),
report.c_str());
}