summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoCommon/Src/TextureDecoder.cpp6
-rw-r--r--Source/Core/VideoCommon/Src/TextureDecoder.h3
2 files changed, 6 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp
index df46fabeb7..a1654a72ca 100644
--- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp
+++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp
@@ -62,10 +62,12 @@ int TexDecoder_GetTextureSizeInBytes(int width, int height, int format)
return (width * height * TexDecoder_GetTexelSizeInNibbles(format)) / 2;
}
-u32 TexDecoder_GetSafeTextureHash(const u8 *src, int width, int height, int texformat)
+u32 TexDecoder_GetSafeTextureHash(const u8 *src, int width, int height, int texformat, u32 seed)
{
int sz = TexDecoder_GetTextureSizeInBytes(width, height, texformat);
- u32 hash = 0x1337c0de;
+
+ u32 hash = seed ? seed : 0x1337c0de;
+
if (sz < 2048) {
for (int i = 0; i < sz / 4; i += 13) {
hash = _rotl(hash, 17) ^ ((u32 *)src)[i];
diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.h b/Source/Core/VideoCommon/Src/TextureDecoder.h
index bac0cec7a1..2c0647f737 100644
--- a/Source/Core/VideoCommon/Src/TextureDecoder.h
+++ b/Source/Core/VideoCommon/Src/TextureDecoder.h
@@ -77,7 +77,8 @@ enum PC_TexFormat
PC_TexFormat TexDecoder_Decode(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt);
-u32 TexDecoder_GetSafeTextureHash(const u8 *src, int width, int height, int texformat);
+//u32 TexDecoder_GetSafeTextureHash(const u8 *src, int width, int height, int texformat);
+u32 TexDecoder_GetSafeTextureHash(const u8 *src, int width, int height, int texformat, u32 seed=0);
void TexDecoder_SetTexFmtOverlayOptions(bool enable, bool center);