remove TEX_PERMANENT

This commit is contained in:
Glenn Maynard
2005-06-30 22:08:29 +00:00
parent 7a4b97d61a
commit 653cd8013a
3 changed files with 7 additions and 21 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ struct RageTextureID
* Note that this property is not considered for ordering/equality. Loading * Note that this property is not considered for ordering/equality. Loading
* a texture with a different loading policy will reuse the same texture with * a texture with a different loading policy will reuse the same texture with
* a different policy. */ * a different policy. */
enum TexPolicy { TEX_PERMANENT, TEX_CACHED, TEX_VOLATILE, TEX_DEFAULT } Policy; enum TexPolicy { TEX_CACHED, TEX_VOLATILE, TEX_DEFAULT } Policy;
void Init(); void Init();
+6 -19
View File
@@ -20,14 +20,12 @@
* player could actually view all banners long enough to transition to them * player could actually view all banners long enough to transition to them
* all in the course of one song select screen. * all in the course of one song select screen.
* *
* Permanent: Never delete the texture. This is only used for BannerCache=2 mode. * Policy priority is in the order CACHED, VOLATILE, DEFAULT. Textures that are loaded
* * DEFAULT can be changed to VOLATILE and CACHED; VOLATILE textures can only be changed
* Policy priority is in the order PERMANENT, CACHED, VOLATILE, DEFAULT. Textures that * to CACHED. CACHED flags are normally set explicitly on a per-texture basis. VOLATILE
* are loaded DEFAULT can be changed to VOLATILE and CACHED; VOLATILE textures can only * flags are set for all banners, but banners which are explicitly set to CACHED should
* be changed to CACHED. CACHED flags are normally set explicitly on a per-texture * stay CACHED. Finally, all textures, when they're finally used, are loaded as NORMAL,
* basis. VOLATILE flags are set for all banners, but banners which are explicitly * and that should never override.
* set to CACHED should stay CACHED. Finally, all textures, when they're finally used,
* are loaded as NORMAL, and that should never override.
*/ */
#include "global.h" #include "global.h"
@@ -160,13 +158,6 @@ void RageTextureManager::VolatileTexture( RageTextureID ID )
UnloadTexture( pTexture ); UnloadTexture( pTexture );
} }
void RageTextureManager::PermanentTexture( RageTextureID ID )
{
RageTexture* pTexture = LoadTextureInternal( ID );
pTexture->GetPolicy() = min( pTexture->GetPolicy(), RageTextureID::TEX_PERMANENT );
UnloadTexture( pTexture );
}
void RageTextureManager::UnloadTexture( RageTexture *t ) void RageTextureManager::UnloadTexture( RageTexture *t )
{ {
if( t == NULL ) if( t == NULL )
@@ -178,8 +169,6 @@ void RageTextureManager::UnloadTexture( RageTexture *t )
if( t->m_iRefCount ) if( t->m_iRefCount )
return; /* Can't unload textures that are still referenced. */ return; /* Can't unload textures that are still referenced. */
if( t->GetPolicy() == RageTextureID::TEX_PERMANENT )
return; /* Never unload TEX_PERMANENT textures. */
bool bDeleteThis = false; bool bDeleteThis = false;
/* Always unload movies, so we don't waste time decoding. */ /* Always unload movies, so we don't waste time decoding. */
@@ -232,8 +221,6 @@ void RageTextureManager::GarbageCollect( GCType type )
if( t->m_iRefCount ) if( t->m_iRefCount )
continue; /* Can't unload textures that are still referenced. */ continue; /* Can't unload textures that are still referenced. */
if( t->GetPolicy() == RageTextureID::TEX_PERMANENT )
return; /* Never unload TEX_PERMANENT textures. */
bool bDeleteThis = false; bool bDeleteThis = false;
if( type==screen_changed ) if( type==screen_changed )
-1
View File
@@ -60,7 +60,6 @@ public:
void RegisterTexture( RageTextureID ID, RageTexture *p ); void RegisterTexture( RageTextureID ID, RageTexture *p );
void CacheTexture( RageTextureID ID ); void CacheTexture( RageTextureID ID );
void VolatileTexture( RageTextureID ID ); void VolatileTexture( RageTextureID ID );
void PermanentTexture( RageTextureID ID );
void UnloadTexture( RageTexture *t ); void UnloadTexture( RageTexture *t );
void ReloadAll(); void ReloadAll();