From bed43f712b0dd554024fbefd640cc7b22e2a0a8f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 19 Apr 2003 23:37:50 +0000 Subject: [PATCH] This looks like what this was supposed to be. With "if( !m_bDelayedDelete || !t->m_bCacheThis )", if !m_bDelayedDelete, when we preload banners we'll load the texture and then immediately free it. This way, we always keep banners around, even if !m_bDelayedDelete. I'm adding another option to tweak the banner caching. I like the smoother banner changes, but I don't care for the very slow opening of groups. I'm not sure how to handle memory usage. I have about 14 megs of banners. In order to load them all, you just have to open each group once, and 14 megs of PNG is a lot of memory uncompressed. Ideal would be to cache the compressed version, but that'd be a bit of work. I'll add precache-all-at-load, precache-group and no-precache options for now. --- stepmania/src/RageTextureManager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stepmania/src/RageTextureManager.cpp b/stepmania/src/RageTextureManager.cpp index e7a4967375..4e14a30bf3 100644 --- a/stepmania/src/RageTextureManager.cpp +++ b/stepmania/src/RageTextureManager.cpp @@ -113,7 +113,11 @@ void RageTextureManager::UnloadTexture( RageTexture *t ) */ if( t->IsAMovie() ) bDeleteThis = true; - if( !m_bDelayedDelete || !t->m_bCacheThis ) + + /* If m_bDelayedDelete, keep all textures around until we GC. If m_bCacheThis, + * keep this individual texture, even if m_bDelayedDelete is off. (Would + * "m_bDelayedDelete" be clearer as "m_bCacheAll"?) */ + if( !m_bDelayedDelete && !t->m_bCacheThis ) bDeleteThis = true; if( bDeleteThis )