From 20d0c537812e32b71ca3b4dda52b516b71459869 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Sat, 30 Aug 2008 23:06:40 +0000 Subject: [PATCH] Fix same texcache bug on DX side git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@394 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp index 71dd03b663..5868b90b1b 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp @@ -24,6 +24,9 @@ void TextureCache::TCacheEntry::Destroy() { if (texture) texture->Release(); + u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr + hashoffset*4); + if (*ptr == hash) + *ptr = oldpixel; } void TextureCache::Init() @@ -59,9 +62,6 @@ void TextureCache::Cleanup() { if (!iter->second.isRenderTarget) { - u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(iter->second.addr + iter->second.hashoffset*4); - if (*ptr == iter->second.hash) - *ptr = iter->second.oldpixel; iter->second.Destroy(); iter = textures.erase(iter); }