Extract DrawTargetMarker to WorldRenderer.

This commit is contained in:
Paul Chote
2013-10-14 23:31:17 +13:00
parent 839419635d
commit 483120ea20
4 changed files with 26 additions and 32 deletions

View File

@@ -200,6 +200,20 @@ namespace OpenRA.Graphics
wlr.LineWidth = oldWidth;
}
public void DrawTargetMarker(Color c, float2 location)
{
var tl = new float2(-1, -1);
var br = new float2(1, 1);
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, c);
wlr.DrawLine(location + tr, location + br, c, c);
wlr.DrawLine(location + br, location + bl, c, c);
wlr.DrawLine(location + bl, location + tl, c, c);
}
public void RefreshPalette()
{
palette.ApplyModifiers(world.WorldActor.TraitsImplementing<IPaletteModifier>());