diff options
author | theuni <theuni@svn> | 2010-11-19 07:09:20 +0000 |
---|---|---|
committer | theuni <theuni@svn> | 2010-11-19 07:09:20 +0000 |
commit | 9de85e99960e489a4b9209efb93fffd9d9540c75 (patch) | |
tree | 70a2bda33f29cb619dabfb70a0c088e52044f367 /tools/TexturePacker | |
parent | 7a074a9b2572af5616ed29a575969578e396b8a7 (diff) |
fixed: overly-aggressive TexturePacker dupecheck. Acked by JM.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@35327 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'tools/TexturePacker')
-rw-r--r-- | tools/TexturePacker/XBMCTex.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/TexturePacker/XBMCTex.cpp b/tools/TexturePacker/XBMCTex.cpp index 3b689cd743..94d0d807b2 100644 --- a/tools/TexturePacker/XBMCTex.cpp +++ b/tools/TexturePacker/XBMCTex.cpp @@ -325,17 +325,24 @@ static bool checkDupe(struct MD5Context* ctx, map<string,unsigned int>& hashes, vector<unsigned int>& dupes, unsigned int pos) { - char digest[17]; - MD5Final((unsigned char*)digest,ctx); + unsigned char digest[17]; + MD5Final(digest,ctx); digest[16] = 0; - map<string,unsigned int>::iterator it = hashes.find(digest); + char hex[33]; + sprintf(hex, "%02X%02X%02X%02X%02X%02X%02X%02X"\ + "%02X%02X%02X%02X%02X%02X%02X%02X", digest[0], digest[1], digest[2], + digest[3], digest[4], digest[5], digest[6], digest[7], digest[8], + digest[9], digest[10], digest[11], digest[12], digest[13], digest[14], + digest[15]); + hex[32] = 0; + map<string,unsigned int>::iterator it = hashes.find(hex); if (it != hashes.end()) { dupes[pos] = it->second; return true; } - hashes.insert(make_pair(digest,pos)); + hashes.insert(make_pair(hex,pos)); dupes[pos] = pos; return false; |