| 228 | } |
| 229 | |
| 230 | void 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 | |
| 261 | GFXTextureObject *GFXTextureManager::_lookupTexture( const char *hashName, const GFXTextureProfile *profile ) |
| 262 | { |
no test coverage detected