[Scummvm-git-logs] scummvm master -> 67720ef65840c33f828c27edfc107acdbabde162

criezy criezy at scummvm.org
Sun Feb 14 14:33:12 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
67720ef658 JANITORIAL: Remove obselete references to MetaEngineConnect


Commit: 67720ef65840c33f828c27edfc107acdbabde162
    https://github.com/scummvm/scummvm/commit/67720ef65840c33f828c27edfc107acdbabde162
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-02-14T14:32:36Z

Commit Message:
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.

Changed paths:
    base/main.cpp
    engines/advancedDetector.h
    engines/metaengine.cpp
    engines/metaengine.h
    gui/editgamedialog.cpp
    gui/launcher.cpp


diff --git a/base/main.cpp b/base/main.cpp
index a88af9cc7c..ad987f5063 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -181,17 +181,17 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
 		err = Common::kPathNotDirectory;
 	}
 
-	// Create the game's MetaEngine.
-	const MetaEngineDetection &metaEngine = plugin->get<MetaEngineDetection>();
+	// Create the game's MetaEngineDetection.
+	const MetaEngineDetection &metaEngineDetection = plugin->get<MetaEngineDetection>();
 	if (err.getCode() == Common::kNoError) {
 		// Set default values for all of the custom engine options
 		// Apparently some engines query them in their constructor, thus we
 		// 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
-	// call createInstance and other connecting functions.
+	// Right now we have a MetaEngineDetection plugin. We must find the matching
+	// engine plugin to call createInstance and other connecting functions.
 	Plugin *enginePluginToLaunchGame = PluginMan.getEngineFromMetaEngine(plugin);
 
 	if (!enginePluginToLaunchGame) {
@@ -199,9 +199,9 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
 		return err;
 	}
 
-	// Create the game's MetaEngineConnect.
-	const MetaEngine &metaEngineConnect = enginePluginToLaunchGame->get<MetaEngine>();
-	err = metaEngineConnect.createInstance(&system, &engine);
+	// Create the game's MetaEngine.
+	const MetaEngine &metaEngine = enginePluginToLaunchGame->get<MetaEngine>();
+	err = metaEngine.createInstance(&system, &engine);
 
 	// Check for errors
 	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"));
 
 	if (caption.empty()) {
-		PlainGameDescriptor game = metaEngine.findGame(ConfMan.get("gameid").c_str());
+		PlainGameDescriptor game = metaEngineDetection.findGame(ConfMan.get("gameid").c_str());
 		if (game.description) {
 			caption = game.description;
 		}
@@ -292,7 +292,7 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
 #endif // USE_TRANSLATION
 
 	// 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();
 	for (uint i = 0; i < gameKeymaps.size(); i++) {
 		keymapper->addGameKeymap(gameKeymaps[i]);
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index a19fdab49b..5094cd4103 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -455,7 +455,7 @@ public:
 	 *
 	 * The the engineID must match the one from MetaEngine.
 	 *
-	 * @see MetaEngineConnect::getName().
+	 * @see MetaEngine::getName().
 	 */
 	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.
 	 *
-	 * 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.
-	 * 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.
 	 *
 	 * An example of how this is implemented can be found in the Wintermute Engine.
diff --git a/engines/metaengine.cpp b/engines/metaengine.cpp
index 8be6bcd962..6f4984aa18 100644
--- a/engines/metaengine.cpp
+++ b/engines/metaengine.cpp
@@ -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 {
diff --git a/engines/metaengine.h b/engines/metaengine.h
index a32210b695..c0ff716985 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -117,8 +117,7 @@ struct ExtendedSavegameHeader {
  *
  * Every engine "plugin" provides a hook to get an instance of a MetaEngineDetection
  * subclass for that "engine plugin". For example, SCUMM provides ScummMetaEngineDetection.
- * This is then in turn used by the frontend code to detect games,
- * and other useful functionality. 
+ * This is then in turn used by the frontend code to detect games, and other useful functionality.
  *
  * 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
- * similar to meta engines.
+ * A MetaEngine is another factory for Engine instances, and is very similar to MetaEngineDetection.
  *
  * 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
@@ -213,12 +211,12 @@ public:
 	/**
 	 * 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.
 	 *
-	 * For example, ScummMetaEngine inherits MetaEngine and provides a engineID of "Scumm".
-	 * ScummMetaEngineConnect inherits MetaEngineConnect and provides the name "Scumm".
-	 * This way, an Engine can be easily matched with a MetaEngine.
+	 * For example, ScummMetaEngineDetection inherits MetaEngineDetection and provides a
+	 * engineID of "scumm". ScummMetaEngine inherits MetaEngine and provides the name
+	 * "Scumm". This way, an Engine can be easily matched with a MetaEngine.
 	 */
 	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
 	 * 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 specifies a custom dialog when a game is running uses a MetaEngineConnect.
+	 * 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 MetaEngine.
 	 *
 	 * Engines are not supposed to have an Engine tab in the Edit Game dialog
 	 * can return nullptr.
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index 3974620a50..3104319fb1 100644
--- a/gui/editgamedialog.cpp
+++ b/gui/editgamedialog.cpp
@@ -185,9 +185,9 @@ EditGameDialog::EditGameDialog(const String &domain)
 	if (metaEnginePlugin) {
 		int tabId = tab->addTab(_("Engine"), "GameOptions_Engine");
 
-		const MetaEngineDetection &metaEngine = metaEnginePlugin->get<MetaEngineDetection>();
-		metaEngine.registerDefaultSettings(_domain);
-		_engineOptions = metaEngine.buildEngineOptionsWidgetStatic(tab, "GameOptions_Engine.Container", _domain);
+		const MetaEngineDetection &metaEngineDetection = metaEnginePlugin->get<MetaEngineDetection>();
+		metaEngineDetection.registerDefaultSettings(_domain);
+		_engineOptions = metaEngineDetection.buildEngineOptionsWidgetStatic(tab, "GameOptions_Engine.Container", _domain);
 
 		if (_engineOptions) {
 			_engineOptions->setParentDialog(this);
@@ -354,8 +354,8 @@ EditGameDialog::EditGameDialog(const String &domain)
 	// 9) The Achievements tab
 	//
 	if (enginePlugin) {
-		const MetaEngine &metaEngineConnect = enginePlugin->get<MetaEngine>();
-		Common::AchievementsInfo achievementsInfo = metaEngineConnect.getAchievementsInfo(domain);
+		const MetaEngine &metaEngine = enginePlugin->get<MetaEngine>();
+		Common::AchievementsInfo achievementsInfo = metaEngine.getAchievementsInfo(domain);
 		if (achievementsInfo.descriptions.size() > 0) {
 			tab->addTab(_("Achievements"), "GameOptions_Achievements");
 			addAchievementsControls(tab, "GameOptions_Achievements.", achievementsInfo);
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 865fff4695..3105c60461 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -495,9 +495,9 @@ void LauncherDialog::loadGame(int item) {
 	}
 
 	if (enginePlugin) {
-		const MetaEngine &metaEngineConnect = enginePlugin->get<MetaEngine>();
-		if (metaEngineConnect.hasFeature(MetaEngine::kSupportsListSaves) &&
-			metaEngineConnect.hasFeature(MetaEngine::kSupportsLoadingDuringStartup)) {
+		const MetaEngine &metaEngine = enginePlugin->get<MetaEngine>();
+		if (metaEngine.hasFeature(MetaEngine::kSupportsListSaves) &&
+			metaEngine.hasFeature(MetaEngine::kSupportsLoadingDuringStartup)) {
 			int slot = _loadDialog->runModalWithPluginAndTarget(enginePlugin, target);
 			if (slot >= 0) {
 				ConfMan.setActiveDomain(_domains[item]);




More information about the Scummvm-git-logs mailing list