diff options
| author | JMC47 <JMC4789@gmail.com> | 2021-06-20 04:01:19 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-20 04:01:19 -0400 |
| commit | c788beecfc2946260e87ae11718608ad4e10d898 (patch) | |
| tree | 4bfea3bb81c50cacc72f38efc6f81b26702cde51 /Source/Core/VideoCommon/TextureInfo.cpp | |
| parent | 3e1a25ead050554add154efcc236e1f7a9d427e9 (diff) | |
| parent | df53a5f8809d1f9c21a2975a2fd6e98e9c7a8424 (diff) | |
Merge pull request #9711 from iwubcode/enhance-wildcard-support
VideoCommon: enhance wildcard support in hi res texture lookup
Diffstat (limited to 'Source/Core/VideoCommon/TextureInfo.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/TextureInfo.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/TextureInfo.cpp b/Source/Core/VideoCommon/TextureInfo.cpp index 09c5dee375..166b58497e 100644 --- a/Source/Core/VideoCommon/TextureInfo.cpp +++ b/Source/Core/VideoCommon/TextureInfo.cpp @@ -4,6 +4,7 @@ #include "VideoCommon/TextureInfo.h" +#include <fmt/format.h> #include <xxhash.h> #include "Common/Align.h" @@ -95,6 +96,11 @@ TextureInfo::TextureInfo(const u8* ptr, const u8* tlut_ptr, u32 address, } } +std::string TextureInfo::NameDetails::GetFullName() const +{ + return fmt::format("{}_{}{}_{}", base_name, texture_name, tlut_name, format_name); +} + TextureInfo::NameDetails TextureInfo::CalculateTextureName() { if (!m_ptr) @@ -151,10 +157,11 @@ TextureInfo::NameDetails TextureInfo::CalculateTextureName() const u64 tlut_hash = tlut_size ? XXH64(tlut, tlut_size, 0) : 0; NameDetails result; - result.base_name = fmt::format("{}{}x{}{}_{:016x}", format_prefix, m_raw_width, m_raw_height, - m_mipmaps_enabled ? "_m" : "", tex_hash); + result.base_name = fmt::format("{}{}x{}{}", format_prefix, m_raw_width, m_raw_height, + m_mipmaps_enabled ? "_m" : ""); + result.texture_name = fmt::format("{:016x}", tex_hash); result.tlut_name = tlut_size ? fmt::format("_{:016x}", tlut_hash) : ""; - result.format_name = fmt::format("_{}", static_cast<int>(m_texture_format)); + result.format_name = fmt::to_string(static_cast<int>(m_texture_format)); return result; } |
