Пример #1
0
FontManager::~FontManager()
{
	FontCache* fc;
	while( !Cached.empty() )
	{
		fc = Cached.back();
		Cached.pop_back();
		RemoveCached( fc );
	}
}
Пример #2
0
void ImageManager::Clear()
{
	ImageCache* fc;
	while( !Cached.empty() )
	{
		fc = Cached.front();
		Cached.erase( Cached.begin() );
		RemoveCached( fc );
	}
}
Пример #3
0
ImageManager::~ImageManager()
{
	ImageCache* fc;
	while( !Cached.empty() )
	{
		fc = Cached.back();
		Cached.pop_back();
		RemoveCached( fc );
	}
}
Пример #4
0
/**
 * 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 + "]");
	}
}
Пример #5
0
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 );
			}
		}
	}
}
Пример #6
0
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 );
			}
		}
	}
}