Fix some style nits in WorldRenderer.

This commit is contained in:
Paul Chote
2013-09-29 21:15:46 +13:00
parent 19e0c2a83f
commit 5f0bb4b6c2

View File

@@ -155,21 +155,21 @@ namespace OpenRA.Graphics
var pos = ScreenPxPosition(a.CenterPosition);
var bounds = a.Bounds.Value;
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 tl = pos + new float2(bounds.Left, bounds.Top);
var tr = pos + new float2(bounds.Right, bounds.Top);
var bl = pos + new float2(bounds.Left, bounds.Bottom);
var br = pos + new float2(bounds.Right, bounds.Bottom);
var wlr = Game.Renderer.WorldLineRenderer;
wlr.DrawLine(xy, xy + new float2(4, 0), c, c);
wlr.DrawLine(xy, xy + new float2(0, 4), c, c);
wlr.DrawLine(Xy, Xy + new float2(-4, 0), c, c);
wlr.DrawLine(Xy, Xy + new float2(0, 4), c, c);
wlr.DrawLine(tl, tl + new float2(4, 0), c, c);
wlr.DrawLine(tl, tl + new float2(0, 4), c, c);
wlr.DrawLine(tr, tr + new float2(-4, 0), c, c);
wlr.DrawLine(tr, tr + new float2(0, 4), c, c);
wlr.DrawLine(xY, xY + new float2(4, 0), c, c);
wlr.DrawLine(xY, xY + new float2(0, -4), c, c);
wlr.DrawLine(XY, XY + new float2(-4, 0), c, c);
wlr.DrawLine(XY, XY + new float2(0, -4), c, c);
wlr.DrawLine(bl, bl + new float2(4, 0), c, c);
wlr.DrawLine(bl, bl + new float2(0, -4), c, c);
wlr.DrawLine(br, br + new float2(-4, 0), c, c);
wlr.DrawLine(br, br + new float2(0, -4), c, c);
}
public void DrawRollover(Actor unit)
@@ -192,7 +192,8 @@ namespace OpenRA.Graphics
public void DrawRangeCircleWithContrast(Color fg, float2 location, float range, Color bg, int offset)
{
if (offset > 0) {
if (offset > 0)
{
DrawRangeCircle(bg, location, range + (float)offset / Game.CellSize);
DrawRangeCircle(bg, location, range - (float)offset / Game.CellSize);
}
@@ -234,7 +235,10 @@ namespace OpenRA.Graphics
return new int2((int)Math.Round(px[0]), (int)Math.Round(px[1] - px[2]));
}
public float ScreenZPosition(WPos pos, int zOffset) { return (pos.Y + pos.Z + zOffset)*Game.CellSize/1024f; }
public float ScreenZPosition(WPos pos, int offset)
{
return (pos.Y + pos.Z + offset) * Game.CellSize / 1024f;
}
public WPos Position(int2 screenPx)
{