FontManager::~FontManager() { FontCache* fc; while( !Cached.empty() ) { fc = Cached.back(); Cached.pop_back(); RemoveCached( fc ); } }
void ImageManager::Clear() { ImageCache* fc; while( !Cached.empty() ) { fc = Cached.front(); Cached.erase( Cached.begin() ); RemoveCached( fc ); } }
ImageManager::~ImageManager() { ImageCache* fc; while( !Cached.empty() ) { fc = Cached.back(); Cached.pop_back(); RemoveCached( fc ); } }
/** * disposes of a room, removing all references to the room in any of our lists */ void RoomManager::Dispose(RoomID roomID) { RoomRef room = Get(roomID); if (room) { log.Debug("[ROOM_MANAGER] Disposing room: " + roomID); RemoveCached(roomID); RemoveWatchedRoom(roomID); RemoveOccupiedRoom(roomID); RemoveObservedRoom(roomID); } else { log.Debug("[ROOM_MANAGER] disposeRoom() called for unknown room: [" + roomID + "]"); } }
void FontManager::Tidy() { FontCache* fc; if( !Cached.empty() ) { for( std::list<FontCache*>::reverse_iterator i = Cached.rbegin(); i != Cached.rend(); i++ ) { fc = (*i); if( al_get_time() - fc->LastAccess > CacheTime ) { Cached.remove( fc ); RemoveCached( fc ); } } } }
void ImageManager::Update() { ImageCache* fc; if( !Cached.empty() ) { for( int i = Cached.size() - 1; i >= 0; i-- ) { fc = Cached.at( i ); if( al_get_time() - fc->LastAccess > CacheTime ) { Cached.erase( Cached.begin() + i ); RemoveCached( fc ); } } } }