mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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
This commit is contained in:
@ -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);
|
||||
|
@ -77,8 +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 seed=0);
|
||||
u32 TexDecoder_GetTlutHash(const u16 *src, int len);
|
||||
|
||||
void TexDecoder_SetTexFmtOverlayOptions(bool enable, bool center);
|
||||
|
||||
|
Reference in New Issue
Block a user