Fix same texcache bug on DX side

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@394 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2008-08-30 23:06:40 +00:00
parent db303de0db
commit 20d0c53781

View File

@ -24,6 +24,9 @@ void TextureCache::TCacheEntry::Destroy()
{ {
if (texture) if (texture)
texture->Release(); texture->Release();
u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr + hashoffset*4);
if (*ptr == hash)
*ptr = oldpixel;
} }
void TextureCache::Init() void TextureCache::Init()
@ -59,9 +62,6 @@ void TextureCache::Cleanup()
{ {
if (!iter->second.isRenderTarget) 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->second.Destroy();
iter = textures.erase(iter); iter = textures.erase(iter);
} }