DIRECTOR: Switch detection to full paths and modify lzone-win for using it

This commit is contained in:
Eugene Sandulenko 2021-11-30 23:48:09 +01:00
parent 0f3e1bfeb6
commit 85e8f765c1
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
5 changed files with 9 additions and 3 deletions

View File

@ -77,6 +77,7 @@ public:
DirectorMetaEngineDetection() : AdvancedMetaEngineDetection(Director::gameDescriptions, sizeof(Director::DirectorGameDescription), directorGames) {
_maxScanDepth = 5;
_directoryGlobs = Director::directoryGlobs;
_matchFullPaths = true;
// initialize customTarget hashmap here
for (int i = 0; customTargetList[i].name != nullptr; i++)

View File

@ -27,7 +27,6 @@ namespace Director {
const char *directoryGlobs[] = {
"install",
"l_zone",
"win_data", // L-ZONE
"data",
"gadget", // Gadget

View File

@ -1867,7 +1867,7 @@ static const DirectorGameDescription gameDescriptions[] = {
MACGAME1("lzone", "", "L-ZONE", "f5277c53bacd27936158dd3867e587e2", 392484, 300),
MACGAME1("lzone", "v2", "L-ZONE", "276bee761e48a6fd709df77d5c2f60dd", 395088, 310),
GENGAME1_("lzone", "", "L-ZONE", "9f0bb7ec7720e4f680ee3aa3d22c1c9d", 384968, Common::EN_ANY, Common::kPlatformMacintoshII, ADGF_MACRESFORK, 300),
WINGAME1t("lzone", "", "L_ZONE.EXE", "079429bfc54a1df8e7b4d379aefa0b59", 370009, 300),
WINGAME1t("lzone", "", "L_ZONE/L_ZONE.EXE", "079429bfc54a1df8e7b4d379aefa0b59", 370009, 300),
#undef SUPPORT_STATUS
#define SUPPORT_STATUS ADGF_UNSTABLE

View File

@ -253,7 +253,7 @@ Common::String DirectorEngine::getEXEName() const {
if (startMovie.startMovie.size() > 0)
return startMovie.startMovie;
return Common::punycode_decodefilename(_gameDescription->desc.filesDescriptions[0].fileName);
return Common::punycode_decodefilename(Common::lastPathComponent(_gameDescription->desc.filesDescriptions[0].fileName, '/'));
}
void DirectorEngine::parseOptions() {

View File

@ -73,6 +73,12 @@ public:
};
Common::Error DirectorMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
Common::StringArray dirs = AdvancedMetaEngineDetection::getPathsFromEntry(desc);
Common::FSNode gameDataDir = Common::FSNode(ConfMan.get("path"));
for (auto dir = dirs.begin(); dir != dirs.end(); ++dir)
SearchMan.addSubDirectoryMatching(gameDataDir, *dir);
*engine = new Director::DirectorEngine(syst, (const Director::DirectorGameDescription *)desc);
return Common::kNoError;
}