DIRECTOR: Expose subdirectory list from detection

Clean up `director.cpp` by iterating over an exposed subdirectory
list from `detection.cpp`, rather than maintain similar data in two
places.
This commit is contained in:
trembyle 2021-06-09 10:26:14 -04:00 committed by Eugene Sandulenko
parent 9f3e3bc734
commit bb84be66c9
3 changed files with 95 additions and 73 deletions

View File

@ -31,77 +31,85 @@
#include "director/detection_tables.h"
static const char *directoryGlobs[] = {
"install",
"l_zone",
"win_data", // L-ZONE
"data",
"gadget", // Gadget
"vnc", // Virtual Nightclub
"program", // Arc Media products
"demodata", // Edmark demos
"media", // Gundam
"mvm", // Master of the Elements
"module_1",
"module_2", // Takeru
"simpsons", // Simpsons Cartoon Studio
"dane", // Polish Kontyngent '99 catalog
"datas", // O!KAY! subscription from Domino Verlag
"daten", // Bibi Blocksberg games (German)
"source", // Grand Prix 2006 directory
"data_k",
"data_1",
"data_2", // JumpStart World
"numbers", // JumpStart Learning Games
"files", // Babar
"swanlake", // Barbie Swan Lake
"assets", // Barbie Nail Designer
"fjpc", // Forestia Jr
"movies", // Mulle Meck (Gary Gadget) series
"demos", // Headbone samplers
"blender", // Blender CD-ROM magazines
"mausejagd mit ton", // Mäusejagd mit Ton (GGMD German)
"muizen in \'t hotel, geluid", // GGMD Dutch
"macos9",
"macosx", // Sethi 3
"kripos",
"strisser",
"polis",
"poliisi", // Polis
"fusion macintosh folder", // Fusion
"oslo", // Oslo's Tools & Gadgets
"stuff", // Abrapalabra
"tooned", // Stay Tooned
"disney",
"sampler",
"hd",
"demo",
"setup",
"buzz1g",
"us", // Disney Interactive Learning
"sam rupert", // Who Killed Sam Rupert?
"pcinst", // Gus and the CyberBuds series
"p2data",
"p2media",
"start",
"annat", // Pettson & Findus
"fct", // Felix the Cat
"95instal", // Fisher-Price Little People
"01", // Doing it in C++
"fsetup", // My First Reading Words (Eureka)
"english",
"deutsch",
"francais", // Rename from Français
"italiano",
"virtual tourism paris (e)",
"virtual tourism paris (d)",
"virtual tourism paris (f)",
"virtual tourism paris (i)", // Virtual Tourism Paris
"please copy to hd. G3", // Rename from HDにコピーして下さい。G3
"_files_", // The Gate
"popup", // Pop Up Computer
0
};
namespace Director {
const char *directoryGlobs[] = {
"install",
"l_zone",
"win_data", // L-ZONE
"data",
"gadget", // Gadget
"vnc",
"vnc2", // Virtual Nightclub
"program", // Arc Media products
"demodata", // Edmark demos
"media", // Gundam
"mvm", // Master of the Elements
"module_1",
"module_2", // Takeru
"simpsons", // Simpsons Cartoon Studio
"dane", // Polish Kontyngent '99 catalog
"datas", // O!KAY! subscription from Domino Verlag
"daten", // Bibi Blocksberg games (German)
"source", // Grand Prix 2006 directory
"data_k",
"data_1",
"data_2", // JumpStart World
"numbers", // JumpStart Learning Games
"files", // Babar
"swanlake", // Barbie Swan Lake
"assets", // Barbie Nail Designer
"fjpc", // Forestia Jr
"movies", // Mulle Meck (Gary Gadget) series
"demos", // Headbone samplers
"blender", // Blender CD-ROM magazines
"mausejagd mit ton", // Mäusejagd mit Ton (GGMD German)
"muizen in \'t hotel, geluid", // GGMD Dutch
"macos9",
"macosx", // Sethi 3
"kripos",
"strisser",
"polis",
"poliisi", // Polis
"fusion macintosh folder", // Fusion
"oslo", // Oslo's Tools & Gadgets
"stuff", // Abrapalabra
"tooned", // Stay Tooned
"disney",
"sampler",
"hd",
"demo",
"setup",
"buzz1g",
"us", // Disney Interactive Learning
"sam rupert", // Who Killed Sam Rupert?
"pcinst", // Gus and the CyberBuds series
"p2data",
"p2media",
"start",
"annat", // Pettson & Findus
"fct", // Felix the Cat
"95instal", // Fisher-Price Little People
"01", // Doing it in C++
"fsetup", // My First Reading Words (Eureka)
"english",
"deutsch",
"francais", // Rename from Français
"italiano",
"virtual tourism paris (e)",
"virtual tourism paris (d)",
"virtual tourism paris (f)",
"virtual tourism paris (i)", // Virtual Tourism Paris
"please copy to hd. G3", // Rename from HDにコピーして下さい。G3
"_files_", // The Gate
"popup", // Pop Up Computer
"tokimeki memorial typing", // Rename from ときめきメモリアルタイピング
"program files", // Tokimeki Memorial Typing
"alpha", // Interactive Alphabet
"technik",
"exe1", // Glasklar Technology Interactive
0
};
}
static const DebugChannelDef debugFlagList[] = {
{Director::kDebugCompile, "compile", "Lingo Compilation"},
@ -128,7 +136,7 @@ class DirectorMetaEngineDetection : public AdvancedMetaEngineDetection {
public:
DirectorMetaEngineDetection() : AdvancedMetaEngineDetection(Director::gameDescriptions, sizeof(Director::DirectorGameDescription), directorGames) {
_maxScanDepth = 5;
_directoryGlobs = directoryGlobs;
_directoryGlobs = Director::directoryGlobs;
}
const char *getEngineId() const override {

View File

@ -40,6 +40,8 @@ struct DirectorGameDescription {
uint16 version;
};
extern const char *directoryGlobs[];
} // End of namespace Director
#endif // DIRECTOR_DETECTION_H

View File

@ -34,6 +34,7 @@
#include "director/sound.h"
#include "director/window.h"
#include "director/lingo/lingo.h"
#include "director/detection.h"
namespace Director {
@ -77,6 +78,12 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
// Meet Mediaband could have up to 5 levels of directories
SearchMan.addDirectory(_gameDataDir.getPath(), _gameDataDir, 0, 5);
for (uint i = 0; Director::directoryGlobs[i]; i++) {
Common::String directoryGlob = directoryGlobs[i];
SearchMan.addSubDirectoryMatching(_gameDataDir, directoryGlob);
}
/*
SearchMan.addSubDirectoryMatching(_gameDataDir, "data");
SearchMan.addSubDirectoryMatching(_gameDataDir, "install");
SearchMan.addSubDirectoryMatching(_gameDataDir, "main"); // Meet Mediaband
@ -130,7 +137,12 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
SearchMan.addSubDirectoryMatching(_gameDataDir, "please copy to hd. g3"); // Rename from HDにコピーして下さい。G3
SearchMan.addSubDirectoryMatching(_gameDataDir, "_files_"); // The Gate
SearchMan.addSubDirectoryMatching(_gameDataDir, "popup"); // Pop Up Computer
SearchMan.addSubDirectoryMatching(_gameDataDir, "tokimeki memorial typing"); // Rename from ときめきメモリアルタイピング
SearchMan.addSubDirectoryMatching(_gameDataDir, "popup"); // Tokimeki Memorial Typing
SearchMan.addSubDirectoryMatching(_gameDataDir, "alpha"); // Interactive Alphabet
SearchMan.addSubDirectoryMatching(_gameDataDir, "technik");
SearchMan.addSubDirectoryMatching(_gameDataDir, "exe1", 0, 2); // Glasklar Technology Interactive
*/
_colorDepth = 8; // 256-color
_machineType = 9; // Macintosh IIci
_playbackPaused = false;