From 5c490950691430c1d4352e13b6ce6e918049c73c Mon Sep 17 00:00:00 2001 From: hrydgard Date: Wed, 26 Nov 2008 00:00:23 +0000 Subject: [PATCH] Oops, broke the original texture cache :p fixed. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1299 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp | 11 ++++++++--- Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp index bb46262cd4..cd212226a1 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp @@ -223,9 +223,13 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width if (iter != textures.end()) { TCacheEntry &entry = iter->second; - if (entry.isRenderTarget || - (TexDecoder_GetSafeTextureHash(ptr, expandedWidth, height, format) == entry.hash && - palhash == entry.paletteHash)) { + u32 hash_value; + if (g_Config.bSafeTextureCache) + hash_value = TexDecoder_GetSafeTextureHash(ptr, expandedWidth, height, format); + else + hash_value = ((u32 *)ptr)[entry.hashoffset]; + + if (entry.isRenderTarget || (hash_value == entry.hash && palhash == entry.paletteHash)) { entry.frameCount = frameCount; //glEnable(entry.isNonPow2?GL_TEXTURE_RECTANGLE_ARB:GL_TEXTURE_2D); glBindTexture(entry.isNonPow2 ? GL_TEXTURE_RECTANGLE_ARB:GL_TEXTURE_2D, entry.texture); @@ -261,6 +265,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width //Make an entry in the table TCacheEntry& entry = textures[address]; + entry.hashoffset = 0; entry.paletteHash = palhash; entry.oldpixel = ((u32 *)ptr)[entry.hashoffset]; if (g_Config.bSafeTextureCache) { diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp index 604c5c047f..80ea83121c 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexLoader.cpp @@ -144,7 +144,6 @@ void VertexLoader::CompileVertexTranslator() u8 *old_code_ptr = GetWritableCodePtr(); SetCodePtr(m_compiledCode); ABI_EmitPrologue(4); - // Start loop here const u8 *loop_start = GetCodePtr();