summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2008-08-30 23:15:11 +0000
committerhrydgard <hrydgard@gmail.com>2008-08-30 23:15:11 +0000
commite5deb10714b2486caa42dcdcd9733487c9083821 (patch)
tree07e41fd2a3ecdbe965528b829101dd50c18fc063 /Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp
parent20d0c537812e32b71ca3b4dda52b516b71459869 (diff)
bugfix the texcache bugfixes :P
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@395 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp
index 5868b90b1b..f2ba9d9fd5 100644
--- a/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp
+++ b/Source/Plugins/Plugin_VideoDX9/Src/TextureCache.cpp
@@ -24,9 +24,12 @@ void TextureCache::TCacheEntry::Destroy()
{
if (texture)
texture->Release();
- u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr + hashoffset*4);
- if (*ptr == hash)
- *ptr = oldpixel;
+ texture = 0;
+ if (!isRenderTarget) {
+ u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr + hashoffset*4);
+ if (*ptr == hash)
+ *ptr = oldpixel;
+ }
}
void TextureCache::Init()
@@ -38,10 +41,10 @@ void TextureCache::Init()
void TextureCache::Invalidate()
{
TexCache::iterator iter = textures.begin();
- for (;iter!=textures.end();iter++)
+ for (; iter != textures.end(); iter++)
iter->second.Destroy();
textures.clear();
- TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable,g_Config.bTexFmtOverlayCenter);
+ TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable, g_Config.bTexFmtOverlayCenter);
}
void TextureCache::Shutdown()
@@ -54,9 +57,9 @@ void TextureCache::Shutdown()
void TextureCache::Cleanup()
{
- TexCache::iterator iter=textures.begin();
+ TexCache::iterator iter=textures.begin();
- while(iter!=textures.end())
+ while(iter != textures.end())
{
if (frameCount>20+iter->second.frameCount)
{
@@ -65,13 +68,13 @@ void TextureCache::Cleanup()
iter->second.Destroy();
iter = textures.erase(iter);
}
- else
- {
- iter++;
- }
+ else
+ {
+ iter++;
+ }
}
- else
- {
+ else
+ {
iter++;
}
}