From 7c992d6598743fce09e6666f2c9a0f550ac5e870 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 11 Jun 2011 17:52:32 +0200 Subject: DETECTOR: Merge ADParams into AdvancedMetaEngine --- engines/advancedDetector.cpp | 89 +++++++++++++++++++------------------- engines/advancedDetector.h | 76 ++++++++++++++------------------ engines/agi/detection.cpp | 4 +- engines/agos/detection.cpp | 8 ++-- engines/cine/detection.cpp | 6 +-- engines/cruise/detection.cpp | 4 +- engines/draci/detection.cpp | 2 +- engines/drascula/detection.cpp | 4 +- engines/gob/detection.cpp | 8 ++-- engines/groovie/detection.cpp | 6 +-- engines/kyra/detection.cpp | 6 +-- engines/lastexpress/detection.cpp | 4 +- engines/lure/detection.cpp | 8 ++-- engines/m4/detection.cpp | 8 ++-- engines/made/detection.cpp | 2 +- engines/mohawk/detection.cpp | 8 ++-- engines/parallaction/detection.cpp | 2 +- engines/saga/detection.cpp | 4 +- engines/sci/detection.cpp | 2 +- engines/sword25/detection.cpp | 6 +-- engines/teenagent/detection.cpp | 2 +- engines/testbed/detection.cpp | 4 +- engines/tinsel/detection.cpp | 10 +---- engines/toon/detection.cpp | 8 ++-- engines/touche/detection.cpp | 12 ++--- engines/tsage/detection.cpp | 6 +-- engines/tucker/detection.cpp | 4 +- 27 files changed, 143 insertions(+), 160 deletions(-) (limited to 'engines') diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index b0a304aad9..5a4c493bf7 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -34,12 +34,12 @@ #include "engines/advancedDetector.h" void AdvancedMetaEngine::upgradeTargetIfNecessary() const { - if (params.obsoleteList == 0) + if (_obsoleteList == 0) return; Common::String gameid = ConfMan.get("gameid"); - for (const ADObsoleteGameID *o = params.obsoleteList; o->from; ++o) { + for (const ADObsoleteGameID *o = _obsoleteList; o->from; ++o) { if (gameid.equalsIgnoreCase(o->from)) { gameid = o->to; ConfMan.set("gameid", gameid); @@ -65,11 +65,11 @@ namespace AdvancedDetector { GameDescriptor findGameID( const char *gameid, - const PlainGameDescriptor *gameDescriptors, + const PlainGameDescriptor *gameids, const ADObsoleteGameID *obsoleteList ) { // First search the list of supported gameids for a match. - const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, gameDescriptors); + const PlainGameDescriptor *g = findPlainGameDescriptor(gameid, gameids); if (g) return GameDescriptor(*g); @@ -79,7 +79,7 @@ GameDescriptor findGameID( const ADObsoleteGameID *o = obsoleteList; while (o->from) { if (0 == scumm_stricmp(gameid, o->from)) { - g = findPlainGameDescriptor(o->to, gameDescriptors); + g = findPlainGameDescriptor(o->to, gameids); if (g && g->description) return GameDescriptor(gameid, "Obsolete game ID (" + Common::String(g->description) + ")"); else @@ -146,9 +146,9 @@ static Common::String generatePreferredTarget(const Common::String &id, const AD } void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const { - if (params.singleid != NULL) { + if (_singleid != NULL) { desc["preferredtarget"] = desc["gameid"]; - desc["gameid"] = params.singleid; + desc["gameid"] = _singleid; } if (!desc.contains("preferredtarget")) @@ -156,10 +156,10 @@ void AdvancedMetaEngine::updateGameDescriptor(GameDescriptor &desc, const ADGame desc["preferredtarget"] = generatePreferredTarget(desc["preferredtarget"], realDesc); - if (params.flags & kADFlagUseExtraAsHint) + if (_flags & kADFlagUseExtraAsHint) desc["extra"] = realDesc->extra; - desc.setGUIOptions(realDesc->guioptions | params.guioptions); + desc.setGUIOptions(realDesc->guioptions | _guioptions); desc.appendGUIOptions(getGameGUIOptionsDescriptionLanguage(realDesc->language)); if (realDesc->flags & ADGF_ADDENGLISH) @@ -200,14 +200,14 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const { // Use fallback detector if there were no matches by other means const ADGameDescription *fallbackDesc = fallbackDetect(fslist); if (fallbackDesc != 0) { - GameDescriptor desc(toGameDescriptor(*fallbackDesc, params.gameDescriptors)); + GameDescriptor desc(toGameDescriptor(*fallbackDesc, _gameids)); updateGameDescriptor(desc, fallbackDesc); detectedGames.push_back(desc); } } else { // Otherwise use the found matches for (uint i = 0; i < matches.size(); i++) { - GameDescriptor desc(toGameDescriptor(*matches[i], params.gameDescriptors)); + GameDescriptor desc(toGameDescriptor(*matches[i], _gameids)); updateGameDescriptor(desc, matches[i]); detectedGames.push_back(desc); } @@ -229,7 +229,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) language = Common::parseLanguage(ConfMan.get("language")); if (ConfMan.hasKey("platform")) platform = Common::parsePlatform(ConfMan.get("platform")); - if (params.flags & kADFlagUseExtraAsHint) + if (_flags & kADFlagUseExtraAsHint) if (ConfMan.hasKey("extra")) extra = ConfMan.get("extra"); @@ -266,7 +266,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) if (cleanupPirated(matches)) return Common::kNoGameDataFoundError; - if (params.singleid == NULL) { + if (_singleid == NULL) { for (uint i = 0; i < matches.size(); i++) { if (matches[i]->gameid == gameid) { agdDesc = matches[i]; @@ -283,7 +283,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) if (agdDesc != 0) { // Seems we found a fallback match. But first perform a basic // sanity check: the gameid must match. - if (params.singleid == NULL && agdDesc->gameid != gameid) + if (_singleid == NULL && agdDesc->gameid != gameid) agdDesc = 0; } } @@ -297,10 +297,10 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) if (agdDesc->flags & ADGF_ADDENGLISH) lang += " " + getGameGUIOptionsDescriptionLanguage(Common::EN_ANY); - Common::updateGameGUIOptions(agdDesc->guioptions | params.guioptions, lang); + Common::updateGameGUIOptions(agdDesc->guioptions | _guioptions, lang); - debug(2, "Running %s", toGameDescriptor(*agdDesc, params.gameDescriptors).description().c_str()); + debug(2, "Running %s", toGameDescriptor(*agdDesc, _gameids).description().c_str()); if (!createInstance(syst, engine, agdDesc)) return Common::kNoGameDataFoundError; else @@ -345,11 +345,11 @@ void AdvancedMetaEngine::composeFileHashMap(const Common::FSList &fslist, FileMa if (file->isDirectory()) { Common::FSList files; - if (!params.directoryGlobs) + if (!_directoryGlobs) continue; bool matched = false; - for (const char * const *glob = params.directoryGlobs; *glob; glob++) + for (const char * const *glob = _directoryGlobs; *glob; glob++) if (file->getName().matchString(*glob, true)) { matched = true; break; @@ -388,11 +388,11 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm debug(3, "Starting detection in dir '%s'", parent.getPath().c_str()); // First we compose a hashmap of all files in fslist. - composeFileHashMap(fslist, allFiles, (params.depth == 0 ? 1 : params.depth)); + composeFileHashMap(fslist, allFiles, (_maxScanDepth == 0 ? 1 : _maxScanDepth)); // Check which files are included in some ADGameDescription *and* present // in fslist. Compute MD5s and file sizes for these files. - for (descPtr = params.descs; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += params.descItemSize) { + for (descPtr = _gameDescriptors; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += _descItemSize) { g = (const ADGameDescription *)descPtr; for (fileDesc = g->filesDescriptions; fileDesc->fileName; fileDesc++) { @@ -409,7 +409,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm Common::MacResManager macResMan; if (macResMan.open(parent, fname)) { - tmp.md5 = macResMan.computeResForkMD5AsString(params.md5Bytes); + tmp.md5 = macResMan.computeResForkMD5AsString(_md5Bytes); tmp.size = macResMan.getResForkDataSize(); debug(3, "> '%s': '%s'", fname.c_str(), tmp.md5.c_str()); filesSizeMD5[fname] = tmp; @@ -422,7 +422,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm if (testFile.open(allFiles[fname])) { tmp.size = (int32)testFile.size(); - tmp.md5 = Common::computeStreamMD5AsString(testFile, params.md5Bytes); + tmp.md5 = Common::computeStreamMD5AsString(testFile, _md5Bytes); } else { tmp.size = -1; } @@ -440,7 +440,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm // MD5 based matching uint i; - for (i = 0, descPtr = params.descs; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += params.descItemSize, ++i) { + for (i = 0, descPtr = _gameDescriptors; ((const ADGameDescription *)descPtr)->gameid != 0; descPtr += _descItemSize, ++i) { g = (const ADGameDescription *)descPtr; bool fileMissing = false; @@ -452,7 +452,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm continue; } - if ((params.flags & kADFlagUseExtraAsHint) && !extra.empty() && g->extra != extra) + if ((_flags & kADFlagUseExtraAsHint) && !extra.empty() && g->extra != extra) continue; bool allFilesPresent = true; @@ -525,7 +525,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSList &fslist, Comm } // Filename based fallback - if (params.fileBasedFallback != 0) + if (_fileBasedFallback != 0) matched = detectGameFilebased(allFiles); } @@ -539,7 +539,7 @@ ADGameDescList AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) int maxNumMatchedFiles = 0; const ADGameDescription *matchedDesc = 0; - for (ptr = params.fileBasedFallback; ptr->desc; ++ptr) { + for (ptr = _fileBasedFallback; ptr->desc; ++ptr) { const ADGameDescription *agdesc = (const ADGameDescription *)ptr->desc; int numMatchedFiles = 0; bool fileMissing = false; @@ -570,7 +570,7 @@ ADGameDescList AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) if (matchedDesc) { // We got a match matched.push_back(matchedDesc); - if (params.flags & kADFlagPrintWarningOnFileBasedFallback) { + if (_flags & kADFlagPrintWarningOnFileBasedFallback) { Common::String report = Common::String::format(_("Your game version has been detected using " "filename matching as a variant of %s."), matchedDesc->gameid); report += "\n"; @@ -586,38 +586,37 @@ ADGameDescList AdvancedMetaEngine::detectGameFilebased(const FileMap &allFiles) } GameList AdvancedMetaEngine::getSupportedGames() const { - if (params.singleid != NULL) { + if (_singleid != NULL) { GameList gl; - const PlainGameDescriptor *g = params.gameDescriptors; + const PlainGameDescriptor *g = _gameids; while (g->gameid) { - if (0 == scumm_stricmp(params.singleid, g->gameid)) { + if (0 == scumm_stricmp(_singleid, g->gameid)) { gl.push_back(GameDescriptor(g->gameid, g->description)); return gl; } g++; } - error("Engine %s doesn't have its singleid specified in ids list", params.singleid); + error("Engine %s doesn't have its singleid specified in ids list", _singleid); } - return GameList(params.gameDescriptors); + return GameList(_gameids); } GameDescriptor AdvancedMetaEngine::findGame(const char *gameid) const { - return AdvancedDetector::findGameID(gameid, params.gameDescriptors, params.obsoleteList); + return AdvancedDetector::findGameID(gameid, _gameids, _obsoleteList); } -AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameDescriptors) { - params.descs = (const byte *)descs; - params.descItemSize = descItemSize; - params.md5Bytes = 5000; - params.gameDescriptors = gameDescriptors; - params.obsoleteList = NULL; - params.singleid = NULL; - params.fileBasedFallback = NULL; - params.flags = 0; - params.guioptions = Common::GUIO_NONE; - params.depth = 1; - params.directoryGlobs = NULL; +AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameids) + : _gameDescriptors((const byte *)descs), _descItemSize(descItemSize), _gameids(gameids) { + + _md5Bytes = 5000; + _obsoleteList = NULL; + _singleid = NULL; + _fileBasedFallback = NULL; + _flags = 0; + _guioptions = Common::GUIO_NONE; + _maxScanDepth = 1; + _directoryGlobs = NULL; } diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index e5922bea4a..8eb215ef18 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -118,26 +118,40 @@ enum ADFlags { kADFlagUseExtraAsHint = (1 << 2) }; + +namespace AdvancedDetector { + /** - * A structure containing all parameters for the AdvancedDetector. - * Typically, an engine will have a single instance of this which is - * used by its AdvancedMetaEngine subclass as a parameter to the - * primary AdvancedMetaEngine constructor. + * Scan through the game descriptors specified in params and search for + * 'gameid' in there. If a match is found, returns a GameDescriptor + * with gameid and description set. */ -struct ADParams { +GameDescriptor findGameID( + const char *gameid, + const PlainGameDescriptor *gameids, + const ADObsoleteGameID *obsoleteList = 0 + ); + +} // End of namespace AdvancedDetector + +/** + * A MetaEngine implementation based around the advanced detector code. + */ +class AdvancedMetaEngine : public MetaEngine { +protected: /** * Pointer to an array of objects which are either ADGameDescription * or superset structures (i.e. start with an ADGameDescription member. * The list is terminated by an entry with a gameid equal to 0 * (see AD_TABLE_END_MARKER). */ - const byte *descs; + const byte *_gameDescriptors; /** * The size of a single entry of the above descs array. Always * must be >= sizeof(ADGameDescription). */ - uint descItemSize; + uint _descItemSize; /** * The number of bytes to compute MD5 sum for. The AdvancedDetector @@ -147,27 +161,27 @@ struct ADParams { * Typically this will be set to something between 5 and 50 kilobyte, * but arbitrary non-zero values are possible. */ - uint md5Bytes; + uint _md5Bytes; /** * A list of all gameids (and their corresponding descriptions) supported * by this engine. */ - const PlainGameDescriptor *gameDescriptors; + const PlainGameDescriptor *_gameids; /** * Structure for autoupgrading obsolete targets (optional). * * @todo Properly explain this. */ - const ADObsoleteGameID *obsoleteList; + const ADObsoleteGameID *_obsoleteList; /** * Name of single gameid (optional). * * @todo Properly explain this -- what does it do? */ - const char *singleid; + const char *_singleid; /** * List of files for file-based fallback detection (optional). @@ -177,63 +191,39 @@ struct ADParams { * * @todo Properly explain this */ - const ADFileBasedFallback *fileBasedFallback; + const ADFileBasedFallback *_fileBasedFallback; /** * A bitmask of flags which can be used to configure the behavior * of the AdvancedDetector. Refer to ADFlags for a list of flags * that can be ORed together and passed here. */ - uint32 flags; + uint32 _flags; /** * A bitmask of game GUI options which will be added to each * entry in addition to per-game options. Refer to GameGUIOption * enum for the list. */ - uint32 guioptions; + uint32 _guioptions; /** - * Maximum depth of directories to look up + * Maximum depth of directories to look up. * If set to 0, the depth is 1 level */ - uint32 depth; + uint32 _maxScanDepth; /** * Case-insensitive list of directory globs which could be used for - * going deeper int directory structure. + * going deeper into the directory structure. * @see String::matchString() method for format description. * * @note Last item must be 0 */ - const char * const *directoryGlobs; -}; + const char * const *_directoryGlobs; - -namespace AdvancedDetector { - -/** - * Scan through the game descriptors specified in params and search for - * 'gameid' in there. If a match is found, returns a GameDescriptor - * with gameid and description set. - */ -GameDescriptor findGameID( - const char *gameid, - const PlainGameDescriptor *gameDescriptors, - const ADObsoleteGameID *obsoleteList = 0 - ); - -} // End of namespace AdvancedDetector - -/** - * A MetaEngine implementation based around the advanced detector code. - */ -class AdvancedMetaEngine : public MetaEngine { -protected: - ADParams params; public: - AdvancedMetaEngine(const ADParams &dp) : params(dp) {} - AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameDescriptors); + AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameids); /** * Returns list of targets supported by the engine. diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index b0e055edcc..427ffef1ad 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -137,8 +137,8 @@ class AgiMetaEngine : public AdvancedMetaEngine { public: AgiMetaEngine() : AdvancedMetaEngine(Agi::gameDescriptions, sizeof(Agi::AGIGameDescription), agiGames) { - params.singleid = "agi"; - params.guioptions = Common::GUIO_NOSPEECH; + _singleid = "agi"; + _guioptions = Common::GUIO_NOSPEECH; } virtual const char *getName() const { diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index dbd1743304..06606e71b3 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -92,10 +92,10 @@ using namespace AGOS; class AgosMetaEngine : public AdvancedMetaEngine { public: AgosMetaEngine() : AdvancedMetaEngine(AGOS::gameDescriptions, sizeof(AGOS::AGOSGameDescription), agosGames) { - params.obsoleteList = obsoleteGameIDsTable; - params.guioptions = Common::GUIO_NOLAUNCHLOAD; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _obsoleteList = obsoleteGameIDsTable; + _guioptions = Common::GUIO_NOLAUNCHLOAD; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 89c81c2599..691acea2b3 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -63,9 +63,9 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { class CineMetaEngine : public AdvancedMetaEngine { public: CineMetaEngine() : AdvancedMetaEngine(Cine::gameDescriptions, sizeof(Cine::CINEGameDescription), cineGames) { - params.obsoleteList = obsoleteGameIDsTable; - params.singleid = "cine"; - params.guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; + _obsoleteList = obsoleteGameIDsTable; + _singleid = "cine"; + _guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; } virtual const char *getName() const { diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index f6f8db4f3a..5be2fdeeea 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -220,8 +220,8 @@ static const CRUISEGameDescription gameDescriptions[] = { class CruiseMetaEngine : public AdvancedMetaEngine { public: CruiseMetaEngine() : AdvancedMetaEngine(Cruise::gameDescriptions, sizeof(Cruise::CRUISEGameDescription), cruiseGames) { - params.singleid = "cruise"; - params.guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; + _singleid = "cruise"; + _guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; } virtual const char *getName() const { diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index cf0413ffa9..b7e83e1edb 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -86,7 +86,7 @@ const ADGameDescription gameDescriptions[] = { class DraciMetaEngine : public AdvancedMetaEngine { public: DraciMetaEngine() : AdvancedMetaEngine(Draci::gameDescriptions, sizeof(ADGameDescription), draciGames) { - params.singleid = "draci"; + _singleid = "draci"; } virtual const char *getName() const { diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index 9494bfa66b..2249a49e4d 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -269,8 +269,8 @@ static const DrasculaGameDescription gameDescriptions[] = { class DrasculaMetaEngine : public AdvancedMetaEngine { public: DrasculaMetaEngine() : AdvancedMetaEngine(Drascula::gameDescriptions, sizeof(Drascula::DrasculaGameDescription), drasculaGames) { - params.singleid = "drascula"; - params.guioptions = Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD; + _singleid = "drascula"; + _guioptions = Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD; } virtual const char *getName() const { diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index 2ecd6b741e..e30380a5a5 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -89,10 +89,10 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { class GobMetaEngine : public AdvancedMetaEngine { public: GobMetaEngine() : AdvancedMetaEngine(Gob::gameDescriptions, sizeof(Gob::GOBGameDescription), gobGames) { - params.obsoleteList = obsoleteGameIDsTable; - params.singleid = "gob"; - params.fileBasedFallback = Gob::fileBased; - params.guioptions = Common::GUIO_NOLAUNCHLOAD; + _obsoleteList = obsoleteGameIDsTable; + _singleid = "gob"; + _fileBasedFallback = Gob::fileBased; + _guioptions = Common::GUIO_NOLAUNCHLOAD; } virtual const char *getName() const { diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index 62ee65d74a..cb0f2296fb 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -205,9 +205,9 @@ static const GroovieGameDescription gameDescriptions[] = { class GroovieMetaEngine : public AdvancedMetaEngine { public: GroovieMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(GroovieGameDescription), groovieGames) { - params.singleid = "groovie"; - params.flags = kADFlagUseExtraAsHint; - params.guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; + _singleid = "groovie"; + _flags = kADFlagUseExtraAsHint; + _guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; } const char *getName() const { diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 6589c2b45b..a6af584fb8 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -52,9 +52,9 @@ const char * const directoryGlobs[] = { class KyraMetaEngine : public AdvancedMetaEngine { public: KyraMetaEngine() : AdvancedMetaEngine(adGameDescs, sizeof(KYRAGameDescription), gameList) { - params.md5Bytes = 1024 * 1024; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _md5Bytes = 1024 * 1024; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } const char *getName() const { return "Kyra"; diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp index bf575b63f8..369d815543 100644 --- a/engines/lastexpress/detection.cpp +++ b/engines/lastexpress/detection.cpp @@ -181,8 +181,8 @@ static const ADGameDescription gameDescriptions[] = { class LastExpressMetaEngine : public AdvancedMetaEngine { public: LastExpressMetaEngine() : AdvancedMetaEngine(gameDescriptions, sizeof(ADGameDescription), lastExpressGames) { - params.singleid = "lastexpress"; - params.guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; + _singleid = "lastexpress"; + _guioptions = Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX; } const char *getName() const { diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index 83ede92569..397d965396 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -178,10 +178,10 @@ static const LureGameDescription gameDescriptions[] = { class LureMetaEngine : public AdvancedMetaEngine { public: LureMetaEngine() : AdvancedMetaEngine(Lure::gameDescriptions, sizeof(Lure::LureGameDescription), lureGames) { - params.md5Bytes = 1024; - params.singleid = "lure"; - params.flags = kADFlagUseExtraAsHint; - params.guioptions = Common::GUIO_NOSPEECH; + _md5Bytes = 1024; + _singleid = "lure"; + _flags = kADFlagUseExtraAsHint; + _guioptions = Common::GUIO_NOSPEECH; } virtual const char *getName() const { diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp index bab17d9e1d..02ed967777 100644 --- a/engines/m4/detection.cpp +++ b/engines/m4/detection.cpp @@ -387,10 +387,10 @@ static const char *directoryGlobs[] = { class M4MetaEngine : public AdvancedMetaEngine { public: M4MetaEngine() : AdvancedMetaEngine(M4::gameDescriptions, sizeof(M4::M4GameDescription), m4Games) { - params.singleid = "m4"; - params.guioptions = Common::GUIO_NOMIDI; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _singleid = "m4"; + _guioptions = Common::GUIO_NOMIDI; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp index a0576a458e..fcbee9cb32 100644 --- a/engines/made/detection.cpp +++ b/engines/made/detection.cpp @@ -528,7 +528,7 @@ static MadeGameDescription g_fallbackDesc = { class MadeMetaEngine : public AdvancedMetaEngine { public: MadeMetaEngine() : AdvancedMetaEngine(Made::gameDescriptions, sizeof(Made::MadeGameDescription), madeGames) { - params.singleid = "made"; + _singleid = "made"; } virtual const char *getName() const { diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index a7442729d2..e6f60e3cb5 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -161,10 +161,10 @@ static const char *directoryGlobs[] = { class MohawkMetaEngine : public AdvancedMetaEngine { public: MohawkMetaEngine() : AdvancedMetaEngine(Mohawk::gameDescriptions, sizeof(Mohawk::MohawkGameDescription), mohawkGames) { - params.singleid = "mohawk"; - params.fileBasedFallback = Mohawk::fileBased; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _singleid = "mohawk"; + _fileBasedFallback = Mohawk::fileBased; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { return "Mohawk"; diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 09f6fa5e2e..d0610f7a29 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -223,7 +223,7 @@ static const PARALLACTIONGameDescription gameDescriptions[] = { class ParallactionMetaEngine : public AdvancedMetaEngine { public: ParallactionMetaEngine() : AdvancedMetaEngine(Parallaction::gameDescriptions, sizeof(Parallaction::PARALLACTIONGameDescription), parallactionGames) { - params.guioptions = Common::GUIO_NOLAUNCHLOAD; + _guioptions = Common::GUIO_NOLAUNCHLOAD; } virtual const char *getName() const { diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index ece90855b7..2bfa04c30a 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -104,8 +104,8 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = { class SagaMetaEngine : public AdvancedMetaEngine { public: SagaMetaEngine() : AdvancedMetaEngine(Saga::gameDescriptions, sizeof(Saga::SAGAGameDescription), sagaGames) { - params.obsoleteList = obsoleteGameIDsTable; - params.singleid = "saga"; + _obsoleteList = obsoleteGameIDsTable; + _singleid = "saga"; } virtual const char *getName() const { diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index 302ba13247..8d53ce9937 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -374,7 +374,7 @@ static char s_fallbackGameIdBuf[256]; class SciMetaEngine : public AdvancedMetaEngine { public: SciMetaEngine() : AdvancedMetaEngine(Sci::SciGameDescriptions, sizeof(ADGameDescription), s_sciGameTitles) { - params.singleid = "sci"; + _singleid = "sci"; } virtual const char *getName() const { diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp index c704b3e833..b2f5795663 100644 --- a/engines/sword25/detection.cpp +++ b/engines/sword25/detection.cpp @@ -44,9 +44,9 @@ static const char *directoryGlobs[] = { class Sword25MetaEngine : public AdvancedMetaEngine { public: Sword25MetaEngine() : AdvancedMetaEngine(Sword25::gameDescriptions, sizeof(ADGameDescription), sword25Game) { - params.guioptions = Common::GUIO_NOMIDI; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _guioptions = Common::GUIO_NOMIDI; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { return "Sword25"; diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index b684560bc7..b965e616f1 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -86,7 +86,7 @@ enum { class TeenAgentMetaEngine : public AdvancedMetaEngine { public: TeenAgentMetaEngine() : AdvancedMetaEngine(teenAgentGameDescriptions, sizeof(ADGameDescription), teenAgentGames) { - params.singleid = "teenagent"; + _singleid = "teenagent"; } virtual const char *getName() const { diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp index 2c3d5b43c5..b869bb8ebb 100644 --- a/engines/testbed/detection.cpp +++ b/engines/testbed/detection.cpp @@ -48,8 +48,8 @@ static const ADGameDescription testbedDescriptions[] = { class TestbedMetaEngine : public AdvancedMetaEngine { public: TestbedMetaEngine() : AdvancedMetaEngine(testbedDescriptions, sizeof(ADGameDescription), testbed_setting) { - params.md5Bytes = 512; - params.singleid = "testbed"; + _md5Bytes = 512; + _singleid = "testbed"; } virtual const char *getName() const { diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index 59a567bc63..6a221da0eb 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -77,7 +77,7 @@ static const PlainGameDescriptor tinselGames[] = { class TinselMetaEngine : public AdvancedMetaEngine { public: TinselMetaEngine() : AdvancedMetaEngine(Tinsel::gameDescriptions, sizeof(Tinsel::TinselGameDescription), tinselGames) { - params.singleid = "tinsel"; + _singleid = "tinsel"; } virtual const char *getName() const { @@ -242,7 +242,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & if (testFile.open(allFiles[fname])) { tmp.size = (int32)testFile.size(); - tmp.md5 = computeStreamMD5AsString(testFile, params.md5Bytes); + tmp.md5 = computeStreamMD5AsString(testFile, _md5Bytes); } else { tmp.size = -1; } @@ -262,11 +262,6 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & bool fileMissing = false; - if ((params.flags & kADFlagUseExtraAsHint) && !extra.empty() && g->desc.extra != extra) - continue; - - bool allFilesPresent = true; - // Try to match all files for this game for (fileDesc = g->desc.filesDescriptions; fileDesc->fileName; fileDesc++) { // Get the next filename, stripping off any '1' suffix character @@ -284,7 +279,6 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & if (!filesSizeMD5.contains(tstr)) { fileMissing = true; - allFilesPresent = false; break; } diff --git a/engines/toon/detection.cpp b/engines/toon/detection.cpp index 8ddfcd4fed..e72c61ac68 100644 --- a/engines/toon/detection.cpp +++ b/engines/toon/detection.cpp @@ -120,10 +120,10 @@ static const char * const directoryGlobs[] = { class ToonMetaEngine : public AdvancedMetaEngine { public: ToonMetaEngine() : AdvancedMetaEngine(Toon::gameDescriptions, sizeof(ADGameDescription), toonGames) { - params.singleid = "toon"; - params.fileBasedFallback = Toon::fileBasedFallback; - params.depth = 3; - params.directoryGlobs = directoryGlobs; + _singleid = "toon"; + _fileBasedFallback = Toon::fileBasedFallback; + _maxScanDepth = 3; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { return "Toon"; diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index 3e324b5685..d1dde96f59 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -129,12 +129,12 @@ static const char *directoryGlobs[] = { class ToucheMetaEngine : public AdvancedMetaEngine { public: ToucheMetaEngine() : AdvancedMetaEngine(Touche::gameDescriptions, sizeof(ADGameDescription), toucheGames) { - params.md5Bytes = 4096; - params.singleid = "touche"; - params.fileBasedFallback = Touche::fileBasedFallback; - params.flags = kADFlagPrintWarningOnFileBasedFallback; - params.depth = 2; - params.directoryGlobs = directoryGlobs; + _md5Bytes = 4096; + _singleid = "touche"; + _fileBasedFallback = Touche::fileBasedFallback; + _flags = kADFlagPrintWarningOnFileBasedFallback; + _maxScanDepth = 2; + _directoryGlobs = directoryGlobs; } virtual const char *getName() const { return "Touche"; diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index e9e80312b9..aaa9030a04 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -73,9 +73,9 @@ enum { class TSageMetaEngine : public AdvancedMetaEngine { public: TSageMetaEngine() : AdvancedMetaEngine(tSage::gameDescriptions, sizeof(tSage::tSageGameDescription), tSageGameTitles) { - params.md5Bytes = 5000; - params.singleid = "tsage"; - params.guioptions = Common::GUIO_NOSPEECH; + _md5Bytes = 5000; + _singleid = "tsage"; + _guioptions = Common::GUIO_NOSPEECH; } virtual const char *getName() const { diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index 3eb3973371..d7d829e1da 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -115,8 +115,8 @@ static const ADGameDescription tuckerDemoGameDescription = { class TuckerMetaEngine : public AdvancedMetaEngine { public: TuckerMetaEngine() : AdvancedMetaEngine(tuckerGameDescriptions, sizeof(ADGameDescription), tuckerGames) { - params.md5Bytes = 512; - params.singleid = "tucker"; + _md5Bytes = 512; + _singleid = "tucker"; } virtual const char *getName() const { -- cgit v1.2.3