diff options
author | Max Horn | 2010-11-07 17:15:27 +0000 |
---|---|---|
committer | Max Horn | 2010-11-07 17:15:27 +0000 |
commit | c5598664cef2091036c60eb55dec0168f507cbc4 (patch) | |
tree | 84238087294defbe142bd3ab3ef232f8127a3700 /engines/tinsel | |
parent | 1cbab9885bc7af3ee758c4ca9ce61bb9cb3e5af9 (diff) | |
download | scummvm-rg350-c5598664cef2091036c60eb55dec0168f507cbc4.tar.gz scummvm-rg350-c5598664cef2091036c60eb55dec0168f507cbc4.tar.bz2 scummvm-rg350-c5598664cef2091036c60eb55dec0168f507cbc4.zip |
DETECTOR: Get rid of ADGF_KEEPMATCH
Also fix some typos, and minor tweaks
svn-id: r54118
Diffstat (limited to 'engines/tinsel')
-rw-r--r-- | engines/tinsel/detection.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index b32e742e6d..cbd0ba267b 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -212,8 +212,13 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & if (fslist.empty()) return NULL; + // TODO: The following code is essentially a slightly modified copy of the + // complete code of function detectGame() in engines/advancedDetector.cpp. + // That quite some hefty and undesirable code duplication. Its only purpose + // seems to be to treat filenames of the form "foo1.ext" as "foo.ext". + // It would be nice to avoid this code duplication. + // First we compose a hashmap of all files in fslist. - // Includes nifty stuff like removing trailing dots and ignoring case. for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { if (file->isDirectory()) { if (!scumm_stricmp(file->getName().c_str(), "dw2")) { @@ -337,12 +342,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & if (curFilesMatched > maxFilesMatched) { maxFilesMatched = curFilesMatched; - for (uint j = 0; j < matched.size();) { - if (matched[j]->flags & ADGF_KEEPMATCH) - ++j; - else - matched.remove_at(j); - } + matched.clear(); // Remove any prior, lower ranked matches. matched.push_back((const ADGameDescription *)g); } else if (curFilesMatched == maxFilesMatched) { matched.push_back((const ADGameDescription *)g); |