mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 04:33:09 +00:00
ENGINES: Allow engines to decide if unknown variants can be run
This commit is contained in:
parent
e3d254d963
commit
0622c9f8fb
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user