MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / cleanupCache

Method cleanupCache

Engine/source/gfx/gfxTextureManager.cpp:230–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void GFXTextureManager::cleanupCache( U32 secondsToLive )
231{
232 PROFILE_SCOPE( GFXTextureManager_CleanupCache );
233
234 U32 killTime = Platform::getTime() - secondsToLive;
235
236 for ( U32 i=0; i < mToDelete.size(); )
237 {
238 GFXTextureObject *tex = mToDelete[i];
239
240 // If the texture was picked back up by a user
241 // then just remove it from the list.
242 if ( tex->getRefCount() != 0 )
243 {
244 mToDelete.erase_fast( i );
245 continue;
246 }
247
248 // If its time has expired delete it for real.
249 if ( tex->mDeleteTime <= killTime )
250 {
251 //Con::errorf( "Killed texture: %s", tex->mTextureLookupName.c_str() );
252 delete tex;
253 mToDelete.erase_fast( i );
254 continue;
255 }
256
257 i++;
258 }
259}
260
261GFXTextureObject *GFXTextureManager::_lookupTexture( const char *hashName, const GFXTextureProfile *profile )
262{

Callers 3

updateMethod · 0.80
~GFXDeviceMethod · 0.80
processTimeEventFunction · 0.80

Calls 3

erase_fastMethod · 0.80
sizeMethod · 0.45
getRefCountMethod · 0.45

Tested by

no test coverage detected