diff options
author | Max Horn | 2008-09-30 12:38:44 +0000 |
---|---|---|
committer | Max Horn | 2008-09-30 12:38:44 +0000 |
commit | ae8c0857b9dcaf16065482c47cd4e5d0873585bc (patch) | |
tree | 2fcf20473d77d73d21e356a531b196ff6af57d3e /common | |
parent | 50396dda70076f37801066a23c6ab37ecd6c3975 (diff) | |
download | scummvm-rg350-ae8c0857b9dcaf16065482c47cd4e5d0873585bc.tar.gz scummvm-rg350-ae8c0857b9dcaf16065482c47cd4e5d0873585bc.tar.bz2 scummvm-rg350-ae8c0857b9dcaf16065482c47cd4e5d0873585bc.zip |
AdvancedDetector: Do not (ab)use paths to keep track of files, rather, use FSNodes -- partial (?) fix for bug #2137680
svn-id: r34702
Diffstat (limited to 'common')
-rw-r--r-- | common/advancedDetector.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp index 1b0db4755a..b0a8001587 100644 --- a/common/advancedDetector.cpp +++ b/common/advancedDetector.cpp @@ -290,6 +290,7 @@ PluginError AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) c typedef HashMap<String, bool, IgnoreCase_Hash, IgnoreCase_EqualTo> StringSet; typedef HashMap<String, int32, IgnoreCase_Hash, IgnoreCase_EqualTo> IntMap; +typedef HashMap<String, FilesystemNode, IgnoreCase_Hash, IgnoreCase_EqualTo> FileMap; static void reportUnknown(const StringMap &filesMD5, const IntMap &filesSize) { // TODO: This message should be cleaned up / made more specific. @@ -307,10 +308,10 @@ static void reportUnknown(const StringMap &filesMD5, const IntMap &filesSize) { printf("\n"); } -static ADGameDescList detectGameFilebased(const StringMap &allFiles, const Common::ADParams ¶ms); +static ADGameDescList detectGameFilebased(const FileMap &allFiles, const Common::ADParams ¶ms); static ADGameDescList detectGame(const FSList &fslist, const Common::ADParams ¶ms, Language language, Platform platform, const Common::String extra) { - StringMap allFiles; + FileMap allFiles; StringSet detectFiles; StringMap filesMD5; @@ -334,7 +335,7 @@ static ADGameDescList detectGame(const FSList &fslist, const Common::ADParams &p if (tstr.lastChar() == '.') tstr.deleteLastChar(); - allFiles[tstr] = file->getPath(); // Record the presence of this file + allFiles[tstr] = *file; // Record the presence of this file } // Compute the set of files for which we need MD5s for. I.e. files which are @@ -356,7 +357,7 @@ static ADGameDescList detectGame(const FSList &fslist, const Common::ADParams &p debug(3, "+ %s", fname.c_str()); char md5str[32+1]; - if (!md5_file_string(allFiles[fname].c_str(), md5str, params.md5Bytes)) + if (!md5_file_string(allFiles[fname], md5str, params.md5Bytes)) continue; filesMD5[fname] = md5str; @@ -464,7 +465,7 @@ static ADGameDescList detectGame(const FSList &fslist, const Common::ADParams &p * the maximal number of matching files. In case of a tie, the entry * coming first in the list is chosen. */ -static ADGameDescList detectGameFilebased(const StringMap &allFiles, const Common::ADParams ¶ms) { +static ADGameDescList detectGameFilebased(const FileMap &allFiles, const Common::ADParams ¶ms) { const ADFileBasedFallback *ptr; const char* const* filenames; |