[Scummvm-git-logs] scummvm master -> 59f403510eeaa5cb6cc2dc6b68d0ba091de85226

criezy criezy at scummvm.org
Wed Apr 21 22:11:31 UTC 2021


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

Summary:
0622c9f8fb ENGINES: Allow engines to decide if unknown variants can be run
59f403510e AGS: Allow running unknown variants of AGS games


Commit: 0622c9f8fbae18043d0b2262cfe5cb6bacc746df
    https://github.com/scummvm/scummvm/commit/0622c9f8fbae18043d0b2262cfe5cb6bacc746df
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-04-21T23:11:28+01:00

Commit Message:
ENGINES: Allow engines to decide if unknown variants can be run

Changed paths:
    engines/advancedDetector.cpp
    engines/advancedDetector.h


diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index d570b2655d..e129597823 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -241,8 +241,7 @@ DetectedGames AdvancedMetaEngineDetection::detectGames(const Common::FSList &fsl
 	for (uint i = 0; i < matches.size(); i++) {
 		DetectedGame game = toDetectedGame(matches[i]);
 
-		if (game.hasUnknownFiles) {
-			// Non fallback games with unknown files cannot be added/launched
+		if (game.hasUnknownFiles && !canPlayUnknownVariants()) {
 			game.canBeAdded = false;
 		}
 
@@ -251,7 +250,7 @@ DetectedGames AdvancedMetaEngineDetection::detectGames(const Common::FSList &fsl
 
 	bool foundKnownGames = false;
 	for (uint i = 0; i < detectedGames.size(); i++) {
-		foundKnownGames |= detectedGames[i].canBeAdded;
+		foundKnownGames |= !detectedGames[i].hasUnknownFiles;
 	}
 
 	if (!foundKnownGames) {
@@ -344,7 +343,7 @@ Common::Error AdvancedMetaEngineDetection::createInstance(OSystem *syst, Engine
 
 	ADDetectedGame agdDesc;
 	for (uint i = 0; i < matches.size(); i++) {
-		if (matches[i].desc->gameId == gameid && !matches[i].hasUnknownFiles) {
+		if (matches[i].desc->gameId == gameid && (!matches[i].hasUnknownFiles || canPlayUnknownVariants())) {
 			agdDesc = matches[i];
 			break;
 		}
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index 7832779f2c..31af9cd690 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -402,6 +402,12 @@ protected:
 	 */
 	virtual ADDetectedGames detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const;
 
+	/**
+	 * @return True if variant of a game with unknown files can be played with the engine and false otherwise.
+	 * By default this is false.
+	 */
+	virtual bool canPlayUnknownVariants() const { return false; }
+
 	/**
 	 * Iterate over all @ref ADFileBasedFallback records inside @p fileBasedFallback
 	 * and return the record (or rather, the ADGameDescription


Commit: 59f403510eeaa5cb6cc2dc6b68d0ba091de85226
    https://github.com/scummvm/scummvm/commit/59f403510eeaa5cb6cc2dc6b68d0ba091de85226
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-04-21T23:11:28+01:00

Commit Message:
AGS: Allow running unknown variants of AGS games

Changed paths:
    engines/ags/detection.h


diff --git a/engines/ags/detection.h b/engines/ags/detection.h
index 63d72d9c14..bcdc4e0c5d 100644
--- a/engines/ags/detection.h
+++ b/engines/ags/detection.h
@@ -72,6 +72,10 @@ public:
 	DetectedGames detectGames(const Common::FSList &fslist) const override;
 
 	ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const override;
+
+	bool canPlayUnknownVariants() const override {
+		return true;
+	}
 	
 	GUI::OptionsContainerWidget *buildEngineOptionsWidgetStatic(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const override;
 };




More information about the Scummvm-git-logs mailing list