simplify, speed up f2
This commit is contained in:
@@ -266,6 +266,10 @@ void RageTextureManager::ReloadAll()
|
|||||||
{
|
{
|
||||||
TEXTUREMAN->DisableOddDimensionWarning();
|
TEXTUREMAN->DisableOddDimensionWarning();
|
||||||
|
|
||||||
|
/* Let's get rid of all unreferenced textures, so we don't reload a
|
||||||
|
* ton of cached data that we're not necessarily going to use. */
|
||||||
|
DoDelayedDelete();
|
||||||
|
|
||||||
for( std::map<RageTextureID, RageTexture*>::iterator i = m_mapPathToTexture.begin();
|
for( std::map<RageTextureID, RageTexture*>::iterator i = m_mapPathToTexture.begin();
|
||||||
i != m_mapPathToTexture.end(); ++i)
|
i != m_mapPathToTexture.end(); ++i)
|
||||||
{
|
{
|
||||||
@@ -289,28 +293,6 @@ void RageTextureManager::InvalidateTextures()
|
|||||||
RageTexture* pTexture = i->second;
|
RageTexture* pTexture = i->second;
|
||||||
pTexture->Invalidate();
|
pTexture->Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We're going to have to reload all loaded textures. Let's get rid
|
|
||||||
* of all unreferenced textures, so we don't reload a ton of cached
|
|
||||||
* data that we're not necessarily going to use.
|
|
||||||
*
|
|
||||||
* This must be done *after* we Invalidate above, to let the texture
|
|
||||||
* know its OpenGL texture number is invalid. If we don't do that,
|
|
||||||
* it'll try to free it. */
|
|
||||||
for( i = m_mapPathToTexture.begin();
|
|
||||||
i != m_mapPathToTexture.end(); )
|
|
||||||
{
|
|
||||||
std::map<RageTextureID, RageTexture*>::iterator j = i;
|
|
||||||
i++;
|
|
||||||
|
|
||||||
CString sPath = j->first.filename;
|
|
||||||
RageTexture* pTexture = j->second;
|
|
||||||
if( pTexture->m_iRefCount==0 )
|
|
||||||
{
|
|
||||||
SAFE_DELETE( pTexture ); // free the texture
|
|
||||||
m_mapPathToTexture.erase(j); // and remove the key in the map
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RageTextureManager::SetPrefs( int iTextureColorDepth, int iMovieColorDepth, bool bDelayedDelete, int iMaxTextureResolution )
|
bool RageTextureManager::SetPrefs( int iTextureColorDepth, int iMovieColorDepth, bool bDelayedDelete, int iMaxTextureResolution )
|
||||||
|
|||||||
Reference in New Issue
Block a user