From 4a325d466d1478a5d7803aae7d20eea2d7628d17 Mon Sep 17 00:00:00 2001 From: magumagu9 Date: Thu, 15 Jan 2009 05:24:47 +0000 Subject: [PATCH] Attempt to refix the issue solved by r1872 without the performance impact on the safe texture cache. This is kind of messy, but it seems to work. (I have a feeling there's something strange going on, but I'm not sure how to go about investigating it.) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1873 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp index 6957476634..3f59502c4e 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp @@ -246,7 +246,10 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width bool skip_texture_create = false; - TexCache::iterator iter = textures.find(address); + TexCache::iterator iter = textures.find(g_Config.bSafeTextureCache ? hash_value : address); + + if (g_Config.bSafeTextureCache && iter == textures.end()) + iter = textures.find(address); if (iter != textures.end()) { TCacheEntry &entry = iter->second; @@ -287,7 +290,7 @@ TextureMngr::TCacheEntry* TextureMngr::Load(int texstage, u32 address, int width PC_TexFormat dfmt = TexDecoder_Decode(temp, ptr, expandedWidth, height, format, tlutaddr, tlutfmt); //Make an entry in the table - TCacheEntry& entry = textures[ address ]; + TCacheEntry& entry = textures[ g_Config.bSafeTextureCache ? hash_value : address ]; entry.hashoffset = 0; entry.paletteHash = hashseed;