mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
bugfix the texcache bugfixes :P
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@395 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -24,9 +24,12 @@ void TextureCache::TCacheEntry::Destroy()
|
|||||||
{
|
{
|
||||||
if (texture)
|
if (texture)
|
||||||
texture->Release();
|
texture->Release();
|
||||||
u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr + hashoffset*4);
|
texture = 0;
|
||||||
if (*ptr == hash)
|
if (!isRenderTarget) {
|
||||||
*ptr = oldpixel;
|
u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr + hashoffset*4);
|
||||||
|
if (*ptr == hash)
|
||||||
|
*ptr = oldpixel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureCache::Init()
|
void TextureCache::Init()
|
||||||
@ -38,10 +41,10 @@ void TextureCache::Init()
|
|||||||
void TextureCache::Invalidate()
|
void TextureCache::Invalidate()
|
||||||
{
|
{
|
||||||
TexCache::iterator iter = textures.begin();
|
TexCache::iterator iter = textures.begin();
|
||||||
for (;iter!=textures.end();iter++)
|
for (; iter != textures.end(); iter++)
|
||||||
iter->second.Destroy();
|
iter->second.Destroy();
|
||||||
textures.clear();
|
textures.clear();
|
||||||
TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable,g_Config.bTexFmtOverlayCenter);
|
TexDecoder_SetTexFmtOverlayOptions(g_Config.bTexFmtOverlayEnable, g_Config.bTexFmtOverlayCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureCache::Shutdown()
|
void TextureCache::Shutdown()
|
||||||
@ -54,9 +57,9 @@ void TextureCache::Shutdown()
|
|||||||
|
|
||||||
void TextureCache::Cleanup()
|
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)
|
if (frameCount>20+iter->second.frameCount)
|
||||||
{
|
{
|
||||||
@ -65,13 +68,13 @@ void TextureCache::Cleanup()
|
|||||||
iter->second.Destroy();
|
iter->second.Destroy();
|
||||||
iter = textures.erase(iter);
|
iter = textures.erase(iter);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,9 +82,11 @@ void TextureMngr::TCacheEntry::SetTextureParameters(TexMode0& newmode)
|
|||||||
void TextureMngr::TCacheEntry::Destroy()
|
void TextureMngr::TCacheEntry::Destroy()
|
||||||
{
|
{
|
||||||
glDeleteTextures(1, &texture);
|
glDeleteTextures(1, &texture);
|
||||||
u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr + hashoffset*4);
|
if (!isRenderTarget) {
|
||||||
if (*ptr == hash)
|
u32 *ptr = (u32*)g_VideoInitialize.pGetMemoryPointer(addr + hashoffset*4);
|
||||||
*ptr = oldpixel;
|
if (*ptr == hash)
|
||||||
|
*ptr = oldpixel;
|
||||||
|
}
|
||||||
texture = 0;
|
texture = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user