Replace dynamic Actor.Bounds with the (unchanging) relative rect.

This commit is contained in:
Paul Chote
2013-09-21 17:15:46 +12:00
parent 3f8d75a1ac
commit ad44610e5a
6 changed files with 77 additions and 78 deletions

View File

@@ -150,14 +150,15 @@ namespace OpenRA.Graphics
Game.Renderer.Flush();
}
public void DrawSelectionBox(Actor selectedUnit, Color c)
public void DrawSelectionBox(Actor a, Color c)
{
var bounds = selectedUnit.Bounds.Value;
var pos = ScreenPxPosition(a.CenterPosition);
var bounds = a.Bounds.Value;
var xy = new float2(bounds.Left, bounds.Top);
var Xy = new float2(bounds.Right, bounds.Top);
var xY = new float2(bounds.Left, bounds.Bottom);
var XY = new float2(bounds.Right, bounds.Bottom);
var xy = pos + new float2(bounds.Left, bounds.Top);
var Xy = pos + new float2(bounds.Right, bounds.Top);
var xY = pos + new float2(bounds.Left, bounds.Bottom);
var XY = pos + new float2(bounds.Right, bounds.Bottom);
var wlr = Game.Renderer.WorldLineRenderer;
wlr.DrawLine(xy, xy + new float2(4, 0), c, c);