Use RgbaColorRenderer in TargetLineRenderable.

This commit is contained in:
Paul Chote
2015-12-10 16:31:37 +00:00
parent bb0a7bdaf5
commit 03a48a7a41

View File

@@ -43,11 +43,12 @@ namespace OpenRA.Graphics
if (!waypoints.Any())
return;
var iz = 1 / wr.Viewport.Zoom;
var first = wr.ScreenPxPosition(waypoints.First());
var a = first;
foreach (var b in waypoints.Skip(1).Select(pos => wr.ScreenPxPosition(pos)))
{
Game.Renderer.WorldLineRenderer.DrawLine(a, b, color);
Game.Renderer.WorldRgbaColorRenderer.DrawLine(a, b, iz, color);
DrawTargetMarker(wr, color, b);
a = b;
}
@@ -55,22 +56,15 @@ namespace OpenRA.Graphics
DrawTargetMarker(wr, color, first);
}
public static void DrawTargetMarker(WorldRenderer wr, Color c, float2 location)
public static void DrawTargetMarker(WorldRenderer wr, Color color, float2 location)
{
var miz = -1 / wr.Viewport.Zoom;
var tl = new float2(miz, miz);
var br = -tl;
var bl = new float2(tl.X, br.Y);
var tr = new float2(br.X, tl.Y);
var wlr = Game.Renderer.WorldLineRenderer;
wlr.DrawLine(location + tl, location + tr, c);
wlr.DrawLine(location + tr, location + br, c);
wlr.DrawLine(location + br, location + bl, c);
wlr.DrawLine(location + bl, location + tl, c);
var iz = 1 / wr.Viewport.Zoom;
var offset = new float2(iz, iz);
var tl = location - offset;
var br = location + offset;
Game.Renderer.WorldRgbaColorRenderer.FillRect(tl, br, color);
}
public void RenderDebugGeometry(WorldRenderer wr) { }
public Rectangle ScreenBounds(WorldRenderer wr) { return Rectangle.Empty; }
}