mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-16 14:50:17 +00:00
ENGINES: dealing with ADDetectedGameExtraInfo after we using fallback detection
This commit is contained in:
parent
7af3a3f84c
commit
8abdcf6600
@ -255,12 +255,26 @@ DetectedGames AdvancedMetaEngineDetection::detectGames(const Common::FSList &fsl
|
||||
|
||||
if (!foundKnownGames) {
|
||||
// Use fallback detector if there were no matches by other means
|
||||
ADDetectedGame fallbackDetectionResult = fallbackDetect(allFiles, fslist);
|
||||
ADDetectedGameExtraInfo *extraInfo = nullptr;
|
||||
ADDetectedGame fallbackDetectionResult = fallbackDetect(allFiles, fslist, &extraInfo);
|
||||
|
||||
if (fallbackDetectionResult.desc) {
|
||||
DetectedGame fallbackDetectedGame = toDetectedGame(fallbackDetectionResult);
|
||||
fallbackDetectedGame.preferredTarget += "-fallback";
|
||||
|
||||
// if we have extraInfo here
|
||||
if (extraInfo != nullptr) {
|
||||
// if we have specified game name or targetID, then we replace the original one
|
||||
// maybe we need to use generatePreferredTarget to generate it
|
||||
if (!extraInfo->gameName.empty())
|
||||
fallbackDetectedGame.description = extraInfo->gameName;
|
||||
if (!extraInfo->targetID.empty())
|
||||
fallbackDetectedGame.preferredTarget = extraInfo->targetID;
|
||||
|
||||
// then it's our duty to free it
|
||||
delete extraInfo;
|
||||
}
|
||||
|
||||
detectedGames.push_back(fallbackDetectedGame);
|
||||
}
|
||||
}
|
||||
|
@ -164,8 +164,8 @@ struct ADGameDescription {
|
||||
* struct which saved extra information for detected games
|
||||
*/
|
||||
struct ADDetectedGameExtraInfo {
|
||||
const char *gameName; /*!< Extra info which saved game name */
|
||||
const char *targetID; /*!< targetID which will be used on preferred target id */
|
||||
Common::String gameName; /*!< Extra info which saved game name */
|
||||
Common::String targetID; /*!< targetID which will be used on preferred target id */
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user