[Scummvm-git-logs] scummvm master -> 39eddcde049553cc14aa21ca8cef6fe9b69e76a4

lephilousophe noreply at scummvm.org
Wed Jul 30 11:35:58 UTC 2025


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

Summary:
39eddcde04 ENGINES: Pass FSDirectory by reference instead of copying it


Commit: 39eddcde049553cc14aa21ca8cef6fe9b69e76a4
    https://github.com/scummvm/scummvm/commit/39eddcde049553cc14aa21ca8cef6fe9b69e76a4
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-07-30T13:35:00+02:00

Commit Message:
ENGINES: Pass FSDirectory by reference instead of copying it

Changed paths:
    engines/engine.cpp
    engines/engine.h
    engines/gob/gob.h
    engines/gob/metaengine.cpp


diff --git a/engines/engine.cpp b/engines/engine.cpp
index bbdf6ee203e..851e2ce880e 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -1142,11 +1142,11 @@ bool Engine::gameTypeHasAddOns() const {
 	return false;
 }
 
-bool Engine::dirCanBeGameAddOn(Common::FSDirectory) const {
+bool Engine::dirCanBeGameAddOn(const Common::FSDirectory &) const {
 	return true;
 }
 
-bool Engine::dirMustBeGameAddOn(Common::FSDirectory) const {
+bool Engine::dirMustBeGameAddOn(const Common::FSDirectory &) const {
 	return false;
 }
 
diff --git a/engines/engine.h b/engines/engine.h
index 33af4c26e26..bc48eb4e6a5 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -700,12 +700,12 @@ public:
 	/**
 	 * To discard some directories we know have no chance to be add-ons
 	 */
-	virtual bool dirCanBeGameAddOn(Common::FSDirectory dir) const;
+	virtual bool dirCanBeGameAddOn(const Common::FSDirectory &dir) const;
 
 	/**
 	 * To display a warning if a directory likely to be an add-on does not match anything
 	 */
-	virtual bool dirMustBeGameAddOn(Common::FSDirectory dir) const;
+	virtual bool dirMustBeGameAddOn(const Common::FSDirectory &dir) const;
 
 	/**
 	 * Update the add-ons targets associated with a base game (silently, unless some unsupported version is detected).
diff --git a/engines/gob/gob.h b/engines/gob/gob.h
index 36fbe992a15..a6e0b2e80e7 100644
--- a/engines/gob/gob.h
+++ b/engines/gob/gob.h
@@ -263,8 +263,8 @@ public:
 
 	GameType getGameType(const char *gameId) const;
 	bool gameTypeHasAddOns() const override;
-	bool dirCanBeGameAddOn(Common::FSDirectory dir) const override;
-	bool dirMustBeGameAddOn(Common::FSDirectory dir) const override;
+	bool dirCanBeGameAddOn(const Common::FSDirectory &dir) const override;
+	bool dirMustBeGameAddOn(const Common::FSDirectory &dir) const override;
 
 	/**
 	 * Used to obtain the game version as a fallback
diff --git a/engines/gob/metaengine.cpp b/engines/gob/metaengine.cpp
index f6dafb8f954..7fe879a6abc 100644
--- a/engines/gob/metaengine.cpp
+++ b/engines/gob/metaengine.cpp
@@ -114,7 +114,7 @@ bool GobEngine::gameTypeHasAddOns() const {
 
 
 // Accelerator, to discard some directories we know have no chance to be add-ons
-bool GobEngine::dirCanBeGameAddOn(Common::FSDirectory dir) const {
+bool GobEngine::dirCanBeGameAddOn(const Common::FSDirectory &dir) const {
 	if (getGameType() == kGameTypeAdibou2)
 		return dir.hasFile("intro_ap.stk");
 
@@ -122,7 +122,7 @@ bool GobEngine::dirCanBeGameAddOn(Common::FSDirectory dir) const {
 }
 
 // To display a warning if a directory likely to be an add-on does not match anything
-bool GobEngine::dirMustBeGameAddOn(Common::FSDirectory dir) const {
+bool GobEngine::dirMustBeGameAddOn(const Common::FSDirectory &dir) const {
 	if (getGameType() == kGameTypeAdibou2)
 		return dir.hasFile("intro_ap.stk");
 




More information about the Scummvm-git-logs mailing list