fixed #26 etc
This commit is contained in:
@@ -53,6 +53,24 @@ namespace OpenRa.Game.Graphics
|
||||
spriteRenderer.DrawSprite(image.First, loc,
|
||||
(owner != null) ? owner.Palette : 0);
|
||||
}
|
||||
}
|
||||
|
||||
void DrawSpriteList(RectangleF rect,
|
||||
IEnumerable<Tuple<Sprite, float2, int>> images)
|
||||
{
|
||||
foreach (var image in images)
|
||||
{
|
||||
var loc = image.b;
|
||||
|
||||
if (loc.X > rect.Right || loc.X < rect.Left
|
||||
- image.a.bounds.Width)
|
||||
continue;
|
||||
if (loc.Y > rect.Bottom || loc.Y < rect.Top
|
||||
- image.a.bounds.Height)
|
||||
continue;
|
||||
|
||||
spriteRenderer.DrawSprite(image.a, loc, image.c);
|
||||
}
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
@@ -71,7 +89,7 @@ namespace OpenRa.Game.Graphics
|
||||
DrawSpriteList(a.self.Owner, rect, a.RenderRoof(a.self)); /* RUDE HACK */
|
||||
|
||||
foreach (IEffect e in Game.world.Effects)
|
||||
DrawSpriteList(e.Owner, rect, e.Render());
|
||||
DrawSpriteList(rect, e.Render());
|
||||
|
||||
uiOverlay.Draw();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user