From 653cd8013a64b37488af6cef72be3414e5d0ebc4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 30 Jun 2005 22:08:29 +0000 Subject: [PATCH] remove TEX_PERMANENT --- stepmania/src/RageTextureID.h | 2 +- stepmania/src/RageTextureManager.cpp | 25 ++++++------------------- stepmania/src/RageTextureManager.h | 1 - 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/stepmania/src/RageTextureID.h b/stepmania/src/RageTextureID.h index 7aa49c3c2a..b84617d04f 100644 --- a/stepmania/src/RageTextureID.h +++ b/stepmania/src/RageTextureID.h @@ -55,7 +55,7 @@ struct RageTextureID * 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 different policy. */ - enum TexPolicy { TEX_PERMANENT, TEX_CACHED, TEX_VOLATILE, TEX_DEFAULT } Policy; + enum TexPolicy { TEX_CACHED, TEX_VOLATILE, TEX_DEFAULT } Policy; void Init(); diff --git a/stepmania/src/RageTextureManager.cpp b/stepmania/src/RageTextureManager.cpp index 726d3f6a87..8a8adee09e 100644 --- a/stepmania/src/RageTextureManager.cpp +++ b/stepmania/src/RageTextureManager.cpp @@ -20,14 +20,12 @@ * player could actually view all banners long enough to transition to them * 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 PERMANENT, CACHED, VOLATILE, DEFAULT. Textures that - * are loaded DEFAULT can be changed to VOLATILE and CACHED; VOLATILE textures can only - * be changed to CACHED. CACHED flags are normally set explicitly on a per-texture - * basis. VOLATILE flags are set for all banners, but banners which are explicitly - * set to CACHED should stay CACHED. Finally, all textures, when they're finally used, - * are loaded as NORMAL, and that should never override. + * 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 + * to CACHED. CACHED flags are normally set explicitly on a per-texture basis. VOLATILE + * flags are set for all banners, but banners which are explicitly 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" @@ -160,13 +158,6 @@ void RageTextureManager::VolatileTexture( RageTextureID ID ) 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 ) { if( t == NULL ) @@ -178,8 +169,6 @@ void RageTextureManager::UnloadTexture( RageTexture *t ) if( t->m_iRefCount ) return; /* Can't unload textures that are still referenced. */ - if( t->GetPolicy() == RageTextureID::TEX_PERMANENT ) - return; /* Never unload TEX_PERMANENT textures. */ bool bDeleteThis = false; /* Always unload movies, so we don't waste time decoding. */ @@ -232,8 +221,6 @@ void RageTextureManager::GarbageCollect( GCType type ) if( t->m_iRefCount ) continue; /* Can't unload textures that are still referenced. */ - if( t->GetPolicy() == RageTextureID::TEX_PERMANENT ) - return; /* Never unload TEX_PERMANENT textures. */ bool bDeleteThis = false; if( type==screen_changed ) diff --git a/stepmania/src/RageTextureManager.h b/stepmania/src/RageTextureManager.h index adc5e0e424..dadfdbe4f0 100644 --- a/stepmania/src/RageTextureManager.h +++ b/stepmania/src/RageTextureManager.h @@ -60,7 +60,6 @@ public: void RegisterTexture( RageTextureID ID, RageTexture *p ); void CacheTexture( RageTextureID ID ); void VolatileTexture( RageTextureID ID ); - void PermanentTexture( RageTextureID ID ); void UnloadTexture( RageTexture *t ); void ReloadAll();