diff --git a/OpenRA.Game/Graphics/TargetLineRenderable.cs b/OpenRA.Game/Graphics/TargetLineRenderable.cs index 7d6c3647cf..8d4b81077b 100644 --- a/OpenRA.Game/Graphics/TargetLineRenderable.cs +++ b/OpenRA.Game/Graphics/TargetLineRenderable.cs @@ -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; } }