Add depth buffer support to debug overlays.
This commit is contained in:
@@ -112,13 +112,13 @@ namespace OpenRA.Mods.Common.HitShapes
|
||||
var c = Color.Yellow;
|
||||
RangeCircleRenderable.DrawRangeCircle(wr, a, Radius, 1, c, 0, c);
|
||||
RangeCircleRenderable.DrawRangeCircle(wr, b, Radius, 1, c, 0, c);
|
||||
wcr.DrawLine(new[] { wr.ScreenPosition(a - offset1), wr.ScreenPosition(b - offset1) }, 1, c);
|
||||
wcr.DrawLine(new[] { wr.ScreenPosition(a + offset1), wr.ScreenPosition(b + offset1) }, 1, c);
|
||||
wcr.DrawLine(new[] { wr.Screen3DPosition(a - offset1), wr.Screen3DPosition(b - offset1) }, 1, c);
|
||||
wcr.DrawLine(new[] { wr.Screen3DPosition(a + offset1), wr.Screen3DPosition(b + offset1) }, 1, c);
|
||||
|
||||
RangeCircleRenderable.DrawRangeCircle(wr, aa, Radius, 1, c, 0, c);
|
||||
RangeCircleRenderable.DrawRangeCircle(wr, bb, Radius, 1, c, 0, c);
|
||||
wcr.DrawLine(new[] { wr.ScreenPosition(aa - offset2), wr.ScreenPosition(bb - offset2) }, 1, c);
|
||||
wcr.DrawLine(new[] { wr.ScreenPosition(aa + offset2), wr.ScreenPosition(bb + offset2) }, 1, c);
|
||||
wcr.DrawLine(new[] { wr.Screen3DPosition(aa - offset2), wr.Screen3DPosition(bb - offset2) }, 1, c);
|
||||
wcr.DrawLine(new[] { wr.Screen3DPosition(aa + offset2), wr.Screen3DPosition(bb + offset2) }, 1, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,16 +129,16 @@ namespace OpenRA.Mods.Common.HitShapes
|
||||
var positions = targetablePositions.SelectMany(tp => tp.TargetablePositions(actor));
|
||||
foreach (var pos in positions)
|
||||
{
|
||||
var vertsTop = combatOverlayVertsTop.Select(v => wr.ScreenPosition(pos + v.Rotate(orientation)));
|
||||
var vertsBottom = combatOverlayVertsBottom.Select(v => wr.ScreenPosition(pos + v.Rotate(orientation)));
|
||||
var vertsTop = combatOverlayVertsTop.Select(v => wr.Screen3DPosition(pos + v.Rotate(orientation)));
|
||||
var vertsBottom = combatOverlayVertsBottom.Select(v => wr.Screen3DPosition(pos + v.Rotate(orientation)));
|
||||
wcr.DrawPolygon(vertsTop.ToArray(), 1, Color.Yellow);
|
||||
wcr.DrawPolygon(vertsBottom.ToArray(), 1, Color.Yellow);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var vertsTop = combatOverlayVertsTop.Select(v => wr.ScreenPosition(actorPos + v.Rotate(orientation)));
|
||||
var vertsBottom = combatOverlayVertsBottom.Select(v => wr.ScreenPosition(actorPos + v.Rotate(orientation)));
|
||||
var vertsTop = combatOverlayVertsTop.Select(v => wr.Screen3DPosition(actorPos + v.Rotate(orientation)));
|
||||
var vertsBottom = combatOverlayVertsBottom.Select(v => wr.Screen3DPosition(actorPos + v.Rotate(orientation)));
|
||||
wcr.DrawPolygon(vertsTop.ToArray(), 1, Color.Yellow);
|
||||
wcr.DrawPolygon(vertsBottom.ToArray(), 1, Color.Yellow);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user