summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/HiresTextures.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-04-03 00:26:40 -0400
committerLioncash <mathew1800@gmail.com>2018-04-03 12:42:05 -0400
commit74aff4d9efe9a20e6bdbda8ad47158ef98267175 (patch)
treeecd402fdcf37c1160562b8864ce20bbf253d905a /Source/Core/VideoCommon/HiresTextures.cpp
parent4331f8048954928c04305068a824c3d0c241411c (diff)
HiresTexture: Correct texture hashes
Fixes a regression introduced in 2da8d98b2f94a33e337d37dc7153e5ba445961f3
Diffstat (limited to 'Source/Core/VideoCommon/HiresTextures.cpp')
-rw-r--r--Source/Core/VideoCommon/HiresTextures.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp
index c74b4e617d..26afccbaa9 100644
--- a/Source/Core/VideoCommon/HiresTextures.cpp
+++ b/Source/Core/VideoCommon/HiresTextures.cpp
@@ -12,7 +12,6 @@
#include <mutex>
#include <string>
#include <thread>
-#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
@@ -232,21 +231,29 @@ std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, co
{
const u32 low_nibble = texture[i] & 0xf;
const u32 high_nibble = texture[i] >> 4;
- std::tie(min, max) = std::minmax({min, max, low_nibble, high_nibble});
+
+ min = std::min({min, low_nibble, high_nibble});
+ max = std::max({max, low_nibble, high_nibble});
}
break;
case 256 * 2:
{
- const auto minmax = std::minmax_element(texture, texture + texture_size);
- min = *minmax.first;
- max = *minmax.second;
+ for (size_t i = 0; i < texture_size; i++)
+ {
+ const u32 texture_byte = texture[i];
+
+ min = std::min(min, texture_byte);
+ max = std::max(max, texture_byte);
+ }
break;
}
case 16384 * 2:
for (size_t i = 0; i < texture_size; i += sizeof(u16))
{
const u32 texture_halfword = Common::swap16(texture[i]) & 0x3fff;
- std::tie(min, max) = std::minmax({min, max, texture_halfword});
+
+ min = std::min(min, texture_halfword);
+ max = std::max(max, texture_halfword);
}
break;
}