Remove obsolete WorldRenderer.DrawRangeCircle.
This commit is contained in:
@@ -21,10 +21,6 @@ namespace OpenRA.Graphics
|
|||||||
public static readonly Func<IRenderable, int> RenderableScreenZPositionComparisonKey =
|
public static readonly Func<IRenderable, int> RenderableScreenZPositionComparisonKey =
|
||||||
r => ZPosition(r.Pos, r.ZOffset);
|
r => ZPosition(r.Pos, r.ZOffset);
|
||||||
|
|
||||||
const int RangeCircleSegments = 32;
|
|
||||||
static readonly int[][] RangeCircleStartRotations = Exts.MakeArray(RangeCircleSegments, i => WRot.FromFacing(8 * i).AsMatrix());
|
|
||||||
static readonly int[][] RangeCircleEndRotations = Exts.MakeArray(RangeCircleSegments, i => WRot.FromFacing(8 * i + 6).AsMatrix());
|
|
||||||
|
|
||||||
public readonly Size TileSize;
|
public readonly Size TileSize;
|
||||||
public readonly World World;
|
public readonly World World;
|
||||||
public readonly Theater Theater;
|
public readonly Theater Theater;
|
||||||
@@ -214,17 +210,6 @@ namespace OpenRA.Graphics
|
|||||||
new SelectionBarsRenderable(unit, true, true).Render(this);
|
new SelectionBarsRenderable(unit, true, true).Render(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawRangeCircle(WPos pos, WDist range, Color c)
|
|
||||||
{
|
|
||||||
var offset = new WVec(range.Length, 0, 0);
|
|
||||||
for (var i = 0; i < RangeCircleSegments; i++)
|
|
||||||
{
|
|
||||||
var pa = pos + offset.Rotate(RangeCircleStartRotations[i]);
|
|
||||||
var pb = pos + offset.Rotate(RangeCircleEndRotations[i]);
|
|
||||||
Game.Renderer.WorldLineRenderer.DrawLine(ScreenPosition(pa), ScreenPosition(pb), c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DrawTargetMarker(Color c, float2 location)
|
public void DrawTargetMarker(Color c, float2 location)
|
||||||
{
|
{
|
||||||
var tl = new float2(-1 / Viewport.Zoom, -1 / Viewport.Zoom);
|
var tl = new float2(-1 / Viewport.Zoom, -1 / Viewport.Zoom);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using System;
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Mods.Common.Effects;
|
using OpenRA.Mods.Common.Effects;
|
||||||
|
using OpenRA.Mods.Common.Graphics;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
|
||||||
namespace OpenRA.Mods.Common.Traits
|
namespace OpenRA.Mods.Common.Traits
|
||||||
@@ -48,7 +49,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (healthInfo != null)
|
if (healthInfo != null)
|
||||||
wr.DrawRangeCircle(self.CenterPosition, healthInfo.Radius, Color.Red);
|
RangeCircleRenderable.DrawRangeCircle(wr, self.CenterPosition, healthInfo.Radius,
|
||||||
|
1, Color.Red, 0, Color.Red);
|
||||||
|
|
||||||
var wlr = Game.Renderer.WorldLineRenderer;
|
var wlr = Game.Renderer.WorldLineRenderer;
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
|
using OpenRA.Mods.Common.Graphics;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
|
||||||
namespace OpenRA.Mods.Common.Traits
|
namespace OpenRA.Mods.Common.Traits
|
||||||
@@ -66,7 +67,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var alpha = 255.0f * i.Time / info.DisplayDuration;
|
var alpha = 255.0f * i.Time / info.DisplayDuration;
|
||||||
var rangeStep = alpha / i.Range.Length;
|
var rangeStep = alpha / i.Range.Length;
|
||||||
|
|
||||||
wr.DrawRangeCircle(i.CenterPosition, i.OuterRange, Color.FromArgb((int)alpha, i.Color));
|
RangeCircleRenderable.DrawRangeCircle(wr, i.CenterPosition, i.OuterRange,
|
||||||
|
1, Color.FromArgb((int)alpha, i.Color), 0, i.Color);
|
||||||
|
|
||||||
foreach (var r in i.Range)
|
foreach (var r in i.Range)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user