/**\brief Draws the current sprites */ void SpriteManager::Draw( Coordinate focus ) { list<Sprite *>::iterator i; list<Sprite*> *onscreen; float r = (Video::GetHalfHeight() < Video::GetHalfWidth() ? Video::GetHalfWidth() : Video::GetHalfHeight()) *V_SQRT2; onscreen = GetSpritesNear( focus, r, DRAW_ORDER_ALL); onscreen->sort(compareSpritePtrs); for( i = onscreen->begin(); i != onscreen->end(); ++i ) { (*i)->Draw(); } delete onscreen; }
/**\brief Draws the current sprites */ void SpriteManager::Draw() { if( OPTION(int,"options/development/debug-quadtree") ) GetQuadrant( Camera::Instance()->GetFocusCoordinate() )->Draw( GetQuadrantCenter( Camera::Instance()->GetFocusCoordinate() ) ); list<Sprite *>::iterator i; list<Sprite*> *onscreen; float r = (Video::GetHalfHeight() < Video::GetHalfWidth() ? Video::GetHalfWidth() : Video::GetHalfHeight()) *V_SQRT2; onscreen = GetSpritesNear( Camera::Instance()->GetFocusCoordinate(), r, DRAW_ORDER_ALL); onscreen->sort(compareSpritePtrs); for( i = onscreen->begin(); i != onscreen->end(); ++i ) { (*i)->Draw(); } delete onscreen; }