summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2008-08-30 22:55:09 +0000
committerhrydgard <hrydgard@gmail.com>2008-08-30 22:55:09 +0000
commitdb303de0dbd2aeba347b1d23de27d16c581f7a50 (patch)
treebeead222567c338082f51e117d5cdac537413cf9 /Source
parent432084ebe781a4e5e814fa569edc5aca28e63679 (diff)
Fix texture cache bug in OpenGL plugin
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@393 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp
index 23547096b7..5aea8eab86 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp
@@ -82,6 +82,9 @@ void TextureMngr::TCacheEntry::SetTextureParameters(TexMode0& newmode)
void TextureMngr::TCacheEntry::Destroy()
{
glDeleteTextures(1, &texture);
+ u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr + hashoffset*4);
+ if (*ptr == hash)
+ *ptr = oldpixel;
texture = 0;
}
@@ -123,12 +126,9 @@ void TextureMngr::Cleanup()
{
TexCache::iterator iter = textures.begin();
- while(iter!=textures.end()) {
+ while(iter != textures.end()) {
if (frameCount > 20 + iter->second.frameCount) {
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();
#ifdef _WIN32
iter = textures.erase(iter);