diff options
| author | degasus <wickmarkus@web.de> | 2015-01-14 21:25:33 +0100 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2015-01-21 21:22:55 +0100 |
| commit | ee9d05d67f4d8d2c1f754c0b40f7f54cfbd8d4fd (patch) | |
| tree | 339eac25c1a843251d02478ee86934c969949f0b /Source/Core/VideoCommon/HiresTextures.cpp | |
| parent | a353ead3cb489e404ab747b06eab37c7c4b35a08 (diff) | |
CustomTexture: Use another file name with wildcards
Diffstat (limited to 'Source/Core/VideoCommon/HiresTextures.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/HiresTextures.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp index ec678f8c50..bf76ad0dc0 100644 --- a/Source/Core/VideoCommon/HiresTextures.cpp +++ b/Source/Core/VideoCommon/HiresTextures.cpp @@ -80,7 +80,7 @@ void HiresTexture::Init(const std::string& gameCode) } } -std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, const u8* tlut, size_t tlut_size, u32 width, u32 height, int format) +std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, const u8* tlut, size_t tlut_size, u32 width, u32 height, int format, bool dump) { // checking for min/max on paletted textures u32 min = 0xffff; @@ -119,14 +119,16 @@ std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, co } u64 tex_hash = GetHashHiresTexture(texture, (int)texture_size); - u64 tlut_hash = 0; - u64 hash = tex_hash; - if (tlut_size) - { - tlut_hash = GetHashHiresTexture(tlut, (int)tlut_size); - hash ^= tlut_hash; - } - return StringFromFormat("%s_%08x_%i", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), (u32)hash, (u16)format); + u64 tlut_hash = tlut_size ? GetHashHiresTexture(tlut, (int)tlut_size) : 0; + + std::string basename = StringFromFormat("tex1_%dx%d_%016lx", width, height, tex_hash); + std::string tlutname = tlut_size ? StringFromFormat("_%016lx", tlut_hash) : ""; + std::string formatname = StringFromFormat("_%d", format); + + if (!dump && textureMap.find(basename + "_*" + formatname) != textureMap.end()) + return basename + "_*" + formatname; + + return basename + tlutname + formatname; } HiresTexture* HiresTexture::Search(const u8* texture, size_t texture_size, const u8* tlut, size_t tlut_size, u32 width, u32 height, int format) |
