diff options
author | Paul Gilbert | 2018-10-18 07:34:39 -0700 |
---|---|---|
committer | Paul Gilbert | 2018-12-08 19:05:59 -0800 |
commit | 74080143da579b2db0521ec204a172719c096bc5 (patch) | |
tree | d07f6e2a7af78d741f1e879934cb2690e7a29dd9 | |
parent | 5f626f7a6abbcc2ec18cc50df1ce5ba705f967cd (diff) | |
download | scummvm-rg350-74080143da579b2db0521ec204a172719c096bc5.tar.gz scummvm-rg350-74080143da579b2db0521ec204a172719c096bc5.tar.bz2 scummvm-rg350-74080143da579b2db0521ec204a172719c096bc5.zip |
GLK: Detect presence of game file in detectGames
-rw-r--r-- | engines/gargoyle/detection.cpp | 19 | ||||
-rw-r--r-- | engines/gargoyle/gargoyle.cpp | 5 |
2 files changed, 14 insertions, 10 deletions
diff --git a/engines/gargoyle/detection.cpp b/engines/gargoyle/detection.cpp index b7a32a780a..63ada3e5dd 100644 --- a/engines/gargoyle/detection.cpp +++ b/engines/gargoyle/detection.cpp @@ -68,6 +68,7 @@ static const PlainGameDescriptor gargoyleGames[] = { }; #include "common/config-manager.h" +#include "common/file.h" #include "gargoyle/detection_tables.h" #include "gargoyle/scott/detection.h" #include "gargoyle/scott/scott.h" @@ -158,15 +159,19 @@ ADDetectedGames GargoyleMetaEngine::detectGame(const Common::FSNode &parent, con ADDetectedGames detectedGames; static char gameId[100]; strcpy(gameId, ConfMan.get("gameid").c_str()); + Common::String filename = ConfMan.get("filename"); - gameDescription.desc.gameId = gameId; - gameDescription.desc.language = language; - gameDescription.desc.platform = platform; - gameDescription.desc.extra = extra.c_str(); - gameDescription.filename = ConfMan.get("filename"); + if (parent.getChild(filename).exists()) { + gameDescription.desc.gameId = gameId; + gameDescription.desc.language = language; + gameDescription.desc.platform = platform; + gameDescription.desc.extra = extra.c_str(); + gameDescription.filename = filename; + + ADDetectedGame dg((ADGameDescription *)&gameDescription); + detectedGames.push_back(dg); + } - ADDetectedGame dg((ADGameDescription *)&gameDescription); - detectedGames.push_back(dg); return detectedGames; } diff --git a/engines/gargoyle/gargoyle.cpp b/engines/gargoyle/gargoyle.cpp index 561f14ae01..5d3d53c7d5 100644 --- a/engines/gargoyle/gargoyle.cpp +++ b/engines/gargoyle/gargoyle.cpp @@ -56,9 +56,8 @@ Common::Error GargoyleEngine::run() { initialize(); Common::File f; - if (!f.open(getFilename())) - error("Could not open game file"); - runGame(&f); + if (f.open(getFilename())) + runGame(&f); return Common::kNoError; } |