diff options
author | Johannes Schickel | 2009-11-21 03:51:18 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-11-21 03:51:18 +0000 |
commit | 641d55b1255a1a56b987895babb275e1c561c67f (patch) | |
tree | ba4eadf10289ea495fa3dbfb765d19b02f2a6989 | |
parent | 0b8bc495aeb2bf497b7e4e37e7fe451a616e6681 (diff) | |
download | scummvm-rg350-641d55b1255a1a56b987895babb275e1c561c67f.tar.gz scummvm-rg350-641d55b1255a1a56b987895babb275e1c561c67f.tar.bz2 scummvm-rg350-641d55b1255a1a56b987895babb275e1c561c67f.zip |
Speed up extraction by only adding matching providers to search list.
svn-id: r46037
-rw-r--r-- | tools/create_kyradat/create_kyradat.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp index e78c83f8f6..d280166829 100644 --- a/tools/create_kyradat/create_kyradat.cpp +++ b/tools/create_kyradat/create_kyradat.cpp @@ -1231,6 +1231,9 @@ bool process(PAKFile &out, const Game *g, const byte *data, const uint32 size) { return true; } +// Uncomment this to get various debug information about the detection table entries. +//#define DEBUG_EXTRACTION_TABLES + bool setupSearch(const Game *g, const int *needList, Search &search, SearchMap &searchData) { for (const int *entry = needList; *entry != -1; ++entry) { ExtractEntryList providers = getProvidersForId(*entry); @@ -1240,9 +1243,16 @@ bool setupSearch(const Game *g, const int *needList, Search &search, SearchMap & return false; } else { for (ExtractEntryList::const_iterator i = providers.begin(); i != providers.end(); ++i) { - // We'll add all providers here... - search.addData(i->hint); - searchData.insert(SearchMapEntry(*entry, *i)); + // Only add generic or partly matching providers here. +#ifndef DEBUG_EXTRACTION_TABLES + if ((i->lang == UNK_LANG || i->lang == g->lang[0] || i->lang == g->lang[1] || i->lang == g->lang[2]) && + (i->platform == kPlatformUnknown || (i->platform == g->platform))) { +#endif + search.addData(i->hint); + searchData.insert(SearchMapEntry(*entry, *i)); +#ifndef DEBUG_EXTRACTION_TABLES + } +#endif } } } @@ -1379,6 +1389,11 @@ bool getExtractionData(const Game *g, Search &search, ExtractMap &map) { continue; } +#ifdef DEBUG_EXTRACTION_TABLES + if (((*bestMatch)->second.desc.platform != kPlatformUnknown && (*bestMatch)->second.desc.platform != g->platform)) + printf("%s: %.8X %.8X %d %d\n", getIdString(*entry), (*bestMatch)->second.desc.hint.size, (*bestMatch)->second.desc.hint.byteSum, (*bestMatch)->second.desc.lang, (*bestMatch)->second.desc.platform); +#endif + map.insert(**bestMatch); } } else { @@ -1390,6 +1405,11 @@ bool getExtractionData(const Game *g, Search &search, ExtractMap &map) { continue; } +#ifdef DEBUG_EXTRACTION_TABLES + if (((*bestMatch)->second.desc.platform != kPlatformUnknown && (*bestMatch)->second.desc.platform != g->platform)) + printf("%s: %.8X %.8X %d %d\n", getIdString(*entry), (*bestMatch)->second.desc.hint.size, (*bestMatch)->second.desc.hint.byteSum, (*bestMatch)->second.desc.lang, (*bestMatch)->second.desc.platform); +#endif + map.insert(**bestMatch); } } |