diff options
| author | memberTwo.mb2 <memberTwo.mb2@gmail.com> | 2008-12-04 22:55:17 +0000 |
|---|---|---|
| committer | memberTwo.mb2 <memberTwo.mb2@gmail.com> | 2008-12-04 22:55:17 +0000 |
| commit | bc3a7bdce3c29cccca836259e1f50fe830a39ae7 (patch) | |
| tree | 7283cb12b1b56b179c134f031eee316542f42694 /Source/Core/VideoCommon/Src/TextureDecoder.cpp | |
| parent | 83e4bd2e5f8546817c23037dd12d9a1dfd0b4ff8 (diff) | |
Better tlut hash for fixing MPs font. Didn't notice any slowdown for now.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1402 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureDecoder.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/TextureDecoder.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index a1654a72ca..9f2b7c00bd 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -62,6 +62,15 @@ int TexDecoder_GetTextureSizeInBytes(int width, int height, int format) return (width * height * TexDecoder_GetTexelSizeInNibbles(format)) / 2;
}
+u32 TexDecoder_GetTlutHash(const u16 *src, int len)
+{
+ u32 hash = 0xbeefbabe;
+ for (int i = 0; i < len / 2; i += 2) {
+ hash = _rotl(hash, 17) ^ ((u32 *)src)[i];
+ }
+ return hash;
+}
+
u32 TexDecoder_GetSafeTextureHash(const u8 *src, int width, int height, int texformat, u32 seed)
{
int sz = TexDecoder_GetTextureSizeInBytes(width, height, texformat);
|
