Enable hires textures even when texture dumping is enabled.

Remove some deprecated code.
This commit is contained in:
NeoBrainX 2012-05-28 11:37:14 +02:00
parent 8d30ac462a
commit 8bed27a3d1
5 changed files with 13 additions and 15 deletions

View File

@ -334,7 +334,7 @@ void GFXDebuggerPanel::OnClearScreenButton(wxCommandEvent& event)
void GFXDebuggerPanel::OnClearTextureCacheButton(wxCommandEvent& event) void GFXDebuggerPanel::OnClearTextureCacheButton(wxCommandEvent& event)
{ {
TextureCache::Invalidate(false); TextureCache::Invalidate();
} }
void GFXDebuggerPanel::OnClearVertexShaderCacheButton(wxCommandEvent& event) void GFXDebuggerPanel::OnClearVertexShaderCacheButton(wxCommandEvent& event)

View File

@ -203,7 +203,7 @@ void VideoBackendHardware::DoState(PointerWrap& p)
// Clear all caches that touch RAM // Clear all caches that touch RAM
// (? these don't appear to touch any emulation state that gets saved. moved to on load only.) // (? these don't appear to touch any emulation state that gets saved. moved to on load only.)
TextureCache::Invalidate(false); TextureCache::Invalidate();
VertexLoaderManager::MarkAllDirty(); VertexLoaderManager::MarkAllDirty();
} }
} }

View File

@ -61,28 +61,19 @@ TextureCache::TextureCache()
SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures); SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures);
} }
// TODO: Kill shutdown parameter... void TextureCache::Invalidate()
void TextureCache::Invalidate(bool shutdown)
{ {
TexCache::iterator TexCache::iterator
iter = textures.begin(), iter = textures.begin(),
tcend = textures.end(); tcend = textures.end();
for (; iter != tcend; ++iter) for (; iter != tcend; ++iter)
{
if (shutdown)
iter->second->addr = 0;
delete iter->second; delete iter->second;
}
textures.clear(); textures.clear();
if(g_ActiveConfig.bHiresTextures && !g_ActiveConfig.bDumpTextures)
HiresTextures::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures);
} }
TextureCache::~TextureCache() TextureCache::~TextureCache()
{ {
Invalidate(true);
if (temp) if (temp)
{ {
FreeAlignedMemory(temp); FreeAlignedMemory(temp);
@ -100,7 +91,14 @@ void TextureCache::OnConfigChanged(VideoConfig& config)
config.bTexFmtOverlayEnable != backup_config.s_texfmt_overlay || config.bTexFmtOverlayEnable != backup_config.s_texfmt_overlay ||
config.bTexFmtOverlayCenter != backup_config.s_texfmt_overlay_center || config.bTexFmtOverlayCenter != backup_config.s_texfmt_overlay_center ||
config.bHiresTextures != backup_config.s_hires_textures) config.bHiresTextures != backup_config.s_hires_textures)
g_texture_cache->Invalidate(false); {
g_texture_cache->Invalidate();
if(g_ActiveConfig.bHiresTextures)
HiresTextures::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures);
}
// TODO: Probably shouldn't clear all render targets here, just mark them dirty or something. // TODO: Probably shouldn't clear all render targets here, just mark them dirty or something.
if (config.bEFBCopyCacheEnable != backup_config.s_copy_cache_enable || // TODO: not sure if this is needed? if (config.bEFBCopyCacheEnable != backup_config.s_copy_cache_enable || // TODO: not sure if this is needed?

View File

@ -105,7 +105,7 @@ public:
static void OnConfigChanged(VideoConfig& config); static void OnConfigChanged(VideoConfig& config);
static void Cleanup(); static void Cleanup();
static void Invalidate(bool shutdown); static void Invalidate();
static void InvalidateRange(u32 start_address, u32 size); static void InvalidateRange(u32 start_address, u32 size);
static void MakeRangeDynamic(u32 start_address, u32 size); static void MakeRangeDynamic(u32 start_address, u32 size);
static void ClearRenderTargets(); // currently only used by OGL static void ClearRenderTargets(); // currently only used by OGL

View File

@ -237,7 +237,7 @@ void TeardownDeviceObjects()
D3D::dev->SetDepthStencilSurface(D3D::GetBackBufferDepthSurface()); D3D::dev->SetDepthStencilSurface(D3D::GetBackBufferDepthSurface());
delete g_framebuffer_manager; delete g_framebuffer_manager;
D3D::font.Shutdown(); D3D::font.Shutdown();
TextureCache::Invalidate(false); TextureCache::Invalidate();
VertexLoaderManager::Shutdown(); VertexLoaderManager::Shutdown();
VertexShaderCache::Shutdown(); VertexShaderCache::Shutdown();
PixelShaderCache::Shutdown(); PixelShaderCache::Shutdown();