Don't zoom UI lines when pixel doubling.

This commit is contained in:
Paul Chote
2013-10-14 23:42:45 +13:00
parent 44dd801f16
commit 84bb78060f
5 changed files with 22 additions and 16 deletions

View File

@@ -58,9 +58,13 @@ namespace OpenRA.Graphics
public void Render(WorldRenderer wr)
{
// Need at least 4 points to smooth the contrail over
if (length - skip < 4 )
if (length - skip < 4)
return;
var wlr = Game.Renderer.WorldLineRenderer;
var oldWidth = wlr.LineWidth;
wlr.LineWidth = wr.Viewport.Zoom;
// Start of the first line segment is the tail of the list - don't smooth it.
var curPos = trail[idx(next - skip - 1)];
var curCell = curPos.ToCPos();
@@ -73,12 +77,14 @@ namespace OpenRA.Graphics
var nextColor = Exts.ColorLerp(i * 1f / (length - 4), color, Color.Transparent);
if (!world.FogObscures(curCell) && !world.FogObscures(nextCell))
Game.Renderer.WorldLineRenderer.DrawLine(wr.ScreenPosition(curPos), wr.ScreenPosition(nextPos), curColor, nextColor);
wlr.DrawLine(wr.ScreenPosition(curPos), wr.ScreenPosition(nextPos), curColor, nextColor);
curPos = nextPos;
curCell = nextCell;
curColor = nextColor;
}
wlr.LineWidth = oldWidth;
}
public void RenderDebugGeometry(WorldRenderer wr) {}