JANITORIAL: Remove obselete references to MetaEngineConnect

At some point when splitting the MetaEngine to a detection
plugin and a static meta engine, the former was called
MetaEngine while the latter was called MetaEngineConnect.
Thus was then later change to MetaEngineDetection and
MetaEngine. But some references were left to the former
names in comments and documentation.
This commit is contained in:
Thierry Crozat 2021-02-14 14:21:37 +00:00
parent 5e55ff8f0d
commit 67720ef658
6 changed files with 30 additions and 32 deletions

View file

@ -181,17 +181,17 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
err = Common::kPathNotDirectory; err = Common::kPathNotDirectory;
} }
// Create the game's MetaEngine. // Create the game's MetaEngineDetection.
const MetaEngineDetection &metaEngine = plugin->get<MetaEngineDetection>(); const MetaEngineDetection &metaEngineDetection = plugin->get<MetaEngineDetection>();
if (err.getCode() == Common::kNoError) { if (err.getCode() == Common::kNoError) {
// Set default values for all of the custom engine options // Set default values for all of the custom engine options
// Apparently some engines query them in their constructor, thus we // Apparently some engines query them in their constructor, thus we
// need to set this up before instance creation. // need to set this up before instance creation.
metaEngine.registerDefaultSettings(target); metaEngineDetection.registerDefaultSettings(target);
} }
// Right now we have a MetaEngine plugin. We must find the matching engine plugin to // Right now we have a MetaEngineDetection plugin. We must find the matching
// call createInstance and other connecting functions. // engine plugin to call createInstance and other connecting functions.
Plugin *enginePluginToLaunchGame = PluginMan.getEngineFromMetaEngine(plugin); Plugin *enginePluginToLaunchGame = PluginMan.getEngineFromMetaEngine(plugin);
if (!enginePluginToLaunchGame) { if (!enginePluginToLaunchGame) {
@ -199,9 +199,9 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
return err; return err;
} }
// Create the game's MetaEngineConnect. // Create the game's MetaEngine.
const MetaEngine &metaEngineConnect = enginePluginToLaunchGame->get<MetaEngine>(); const MetaEngine &metaEngine = enginePluginToLaunchGame->get<MetaEngine>();
err = metaEngineConnect.createInstance(&system, &engine); err = metaEngine.createInstance(&system, &engine);
// Check for errors // Check for errors
if (!engine || err.getCode() != Common::kNoError) { if (!engine || err.getCode() != Common::kNoError) {
@ -229,7 +229,7 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
Common::String caption(ConfMan.get("description")); Common::String caption(ConfMan.get("description"));
if (caption.empty()) { if (caption.empty()) {
PlainGameDescriptor game = metaEngine.findGame(ConfMan.get("gameid").c_str()); PlainGameDescriptor game = metaEngineDetection.findGame(ConfMan.get("gameid").c_str());
if (game.description) { if (game.description) {
caption = game.description; caption = game.description;
} }
@ -292,7 +292,7 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
#endif // USE_TRANSLATION #endif // USE_TRANSLATION
// Initialize any game-specific keymaps // Initialize any game-specific keymaps
Common::KeymapArray gameKeymaps = metaEngineConnect.initKeymaps(target.c_str()); Common::KeymapArray gameKeymaps = metaEngine.initKeymaps(target.c_str());
Common::Keymapper *keymapper = system.getEventManager()->getKeymapper(); Common::Keymapper *keymapper = system.getEventManager()->getKeymapper();
for (uint i = 0; i < gameKeymaps.size(); i++) { for (uint i = 0; i < gameKeymaps.size(); i++) {
keymapper->addGameKeymap(gameKeymaps[i]); keymapper->addGameKeymap(gameKeymaps[i]);

View file

@ -455,7 +455,7 @@ public:
* *
* The the engineID must match the one from MetaEngine. * The the engineID must match the one from MetaEngine.
* *
* @see MetaEngineConnect::getName(). * @see MetaEngine::getName().
*/ */
virtual const char *getName() const override = 0; virtual const char *getName() const override = 0;
@ -471,9 +471,9 @@ public:
* @note This is only meant to be used if fallback detection heavily depends on engine resources. * @note This is only meant to be used if fallback detection heavily depends on engine resources.
* *
* To use this, implement the intended fallbackDetectExtern inside the relevant MetaEngineConnect class. * To use this, implement the intended fallbackDetectExtern inside the relevant MetaEngine class.
* Then, override the method "fallbackDetect" inside your MetaEngine class. * Then, override the method "fallbackDetect" inside your MetaEngine class.
* Finally, provide a "hook" to fetch the relevant MetaEngineConnect class and then use the original detection * Finally, provide a "hook" to fetch the relevant MetaEngine class and then use the original detection
* method. * method.
* *
* An example of how this is implemented can be found in the Wintermute Engine. * An example of how this is implemented can be found in the Wintermute Engine.

View file

@ -261,7 +261,7 @@ WARN_UNUSED_RESULT bool MetaEngine::readSavegameHeader(Common::InSaveFile *in, E
////////////////////////////////////////////// //////////////////////////////////////////////
// MetaEngineConnect default implementations // MetaEngine default implementations
////////////////////////////////////////////// //////////////////////////////////////////////
SaveStateList MetaEngine::listSaves(const char *target) const { SaveStateList MetaEngine::listSaves(const char *target) const {

View file

@ -117,8 +117,7 @@ struct ExtendedSavegameHeader {
* *
* Every engine "plugin" provides a hook to get an instance of a MetaEngineDetection * Every engine "plugin" provides a hook to get an instance of a MetaEngineDetection
* subclass for that "engine plugin". For example, SCUMM provides ScummMetaEngineDetection. * subclass for that "engine plugin". For example, SCUMM provides ScummMetaEngineDetection.
* This is then in turn used by the frontend code to detect games, * This is then in turn used by the frontend code to detect games, and other useful functionality.
* and other useful functionality.
* *
* To instantiate actual Engine objects, see the class @ref MetaEngine. * To instantiate actual Engine objects, see the class @ref MetaEngine.
*/ */
@ -189,8 +188,7 @@ public:
}; };
/** /**
* A MetaEngine is another factory for Engine instances, and is very * A MetaEngine is another factory for Engine instances, and is very similar to MetaEngineDetection.
* similar to meta engines.
* *
* This class, however, is made of of bridged functionalities that can be used to connect * This class, however, is made of of bridged functionalities that can be used to connect
* an actual Engine with a MetaEngine. Every engine "plugin" provides a hook to get an instance * an actual Engine with a MetaEngine. Every engine "plugin" provides a hook to get an instance
@ -213,12 +211,12 @@ public:
/** /**
* Name of the engine plugin. * Name of the engine plugin.
* *
* Classes inheriting a MetaEngineConnect must provide an engineID here, * Classes inheriting a MetaEngine must provide an engineID here,
* which can then be used to match an Engine with MetaEngine. * which can then be used to match an Engine with MetaEngine.
* *
* For example, ScummMetaEngine inherits MetaEngine and provides a engineID of "Scumm". * For example, ScummMetaEngineDetection inherits MetaEngineDetection and provides a
* ScummMetaEngineConnect inherits MetaEngineConnect and provides the name "Scumm". * engineID of "scumm". ScummMetaEngine inherits MetaEngine and provides the name
* This way, an Engine can be easily matched with a MetaEngine. * "Scumm". This way, an Engine can be easily matched with a MetaEngine.
*/ */
virtual const char *getName() const = 0; virtual const char *getName() const = 0;
@ -356,8 +354,8 @@ public:
* Engines can build custom option dialogs from here, but by default a simple widget * Engines can build custom option dialogs from here, but by default a simple widget
* allowing to configure the extra GUI options is used. * allowing to configure the extra GUI options is used.
* *
* The engine that builds the Engines tab in the Edit Game dialog uses a MetaEngine. * The engine that builds the Engines tab in the Edit Game dialog uses a MetaEngineDetection.
* The engine that specifies a custom dialog when a game is running uses a MetaEngineConnect. * The engine that specifies a custom dialog when a game is running uses a MetaEngine.
* *
* Engines are not supposed to have an Engine tab in the Edit Game dialog * Engines are not supposed to have an Engine tab in the Edit Game dialog
* can return nullptr. * can return nullptr.

View file

@ -185,9 +185,9 @@ EditGameDialog::EditGameDialog(const String &domain)
if (metaEnginePlugin) { if (metaEnginePlugin) {
int tabId = tab->addTab(_("Engine"), "GameOptions_Engine"); int tabId = tab->addTab(_("Engine"), "GameOptions_Engine");
const MetaEngineDetection &metaEngine = metaEnginePlugin->get<MetaEngineDetection>(); const MetaEngineDetection &metaEngineDetection = metaEnginePlugin->get<MetaEngineDetection>();
metaEngine.registerDefaultSettings(_domain); metaEngineDetection.registerDefaultSettings(_domain);
_engineOptions = metaEngine.buildEngineOptionsWidgetStatic(tab, "GameOptions_Engine.Container", _domain); _engineOptions = metaEngineDetection.buildEngineOptionsWidgetStatic(tab, "GameOptions_Engine.Container", _domain);
if (_engineOptions) { if (_engineOptions) {
_engineOptions->setParentDialog(this); _engineOptions->setParentDialog(this);
@ -354,8 +354,8 @@ EditGameDialog::EditGameDialog(const String &domain)
// 9) The Achievements tab // 9) The Achievements tab
// //
if (enginePlugin) { if (enginePlugin) {
const MetaEngine &metaEngineConnect = enginePlugin->get<MetaEngine>(); const MetaEngine &metaEngine = enginePlugin->get<MetaEngine>();
Common::AchievementsInfo achievementsInfo = metaEngineConnect.getAchievementsInfo(domain); Common::AchievementsInfo achievementsInfo = metaEngine.getAchievementsInfo(domain);
if (achievementsInfo.descriptions.size() > 0) { if (achievementsInfo.descriptions.size() > 0) {
tab->addTab(_("Achievements"), "GameOptions_Achievements"); tab->addTab(_("Achievements"), "GameOptions_Achievements");
addAchievementsControls(tab, "GameOptions_Achievements.", achievementsInfo); addAchievementsControls(tab, "GameOptions_Achievements.", achievementsInfo);

View file

@ -495,9 +495,9 @@ void LauncherDialog::loadGame(int item) {
} }
if (enginePlugin) { if (enginePlugin) {
const MetaEngine &metaEngineConnect = enginePlugin->get<MetaEngine>(); const MetaEngine &metaEngine = enginePlugin->get<MetaEngine>();
if (metaEngineConnect.hasFeature(MetaEngine::kSupportsListSaves) && if (metaEngine.hasFeature(MetaEngine::kSupportsListSaves) &&
metaEngineConnect.hasFeature(MetaEngine::kSupportsLoadingDuringStartup)) { metaEngine.hasFeature(MetaEngine::kSupportsLoadingDuringStartup)) {
int slot = _loadDialog->runModalWithPluginAndTarget(enginePlugin, target); int slot = _loadDialog->runModalWithPluginAndTarget(enginePlugin, target);
if (slot >= 0) { if (slot >= 0) {
ConfMan.setActiveDomain(_domains[item]); ConfMan.setActiveDomain(_domains[item]);