Fix capitalization.
This commit is contained in:
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
this.zOffset = zOffset;
|
||||
}
|
||||
|
||||
public WPos Pos { get { return trail[idx(next - 1)]; } }
|
||||
public WPos Pos { get { return trail[Index(next - 1)]; } }
|
||||
public float Scale { get { return 1f; } }
|
||||
public PaletteReference Palette { get { return null; } }
|
||||
public int ZOffset { get { return zOffset; } }
|
||||
@@ -67,13 +67,13 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
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 curPos = trail[Index(next - skip - 1)];
|
||||
var curCell = wr.world.Map.CellContaining(curPos);
|
||||
var curColor = color;
|
||||
for (var i = 0; i < length - skip - 4; i++)
|
||||
{
|
||||
var j = next - skip - i - 2;
|
||||
var nextPos = Average(trail[idx(j)], trail[idx(j - 1)], trail[idx(j - 2)], trail[idx(j - 3)]);
|
||||
var nextPos = Average(trail[Index(j)], trail[Index(j - 1)], trail[Index(j - 2)], trail[Index(j - 3)]);
|
||||
var nextCell = wr.world.Map.CellContaining(nextPos);
|
||||
var nextColor = Exts.ColorLerp(i * 1f / (length - 4), color, Color.Transparent);
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
public void RenderDebugGeometry(WorldRenderer wr) { }
|
||||
|
||||
// Array index modulo length
|
||||
int idx(int i)
|
||||
int Index(int i)
|
||||
{
|
||||
var j = i % trail.Length;
|
||||
return j < 0 ? j + trail.Length : j;
|
||||
@@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
public void Update(WPos pos)
|
||||
{
|
||||
trail[next] = pos;
|
||||
next = idx(next + 1);
|
||||
next = Index(next + 1);
|
||||
|
||||
if (length < trail.Length)
|
||||
length++;
|
||||
|
||||
@@ -87,13 +87,13 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
public IRenderable AsDecoration() { return this; }
|
||||
|
||||
// This will need generalizing once we support TS/RA2 terrain
|
||||
static readonly float[] groundNormal = new float[] { 0, 0, 1, 1 };
|
||||
static readonly float[] GroundNormal = new float[] { 0, 0, 1, 1 };
|
||||
public void BeforeRender(WorldRenderer wr)
|
||||
{
|
||||
var draw = voxels.Where(v => v.DisableFunc == null || !v.DisableFunc());
|
||||
|
||||
renderProxy = Game.Renderer.WorldVoxelRenderer.RenderAsync(
|
||||
wr, draw, camera, scale, groundNormal, lightSource,
|
||||
wr, draw, camera, scale, GroundNormal, lightSource,
|
||||
lightAmbientColor, lightDiffuseColor,
|
||||
palette, normalsPalette, shadowPalette);
|
||||
}
|
||||
@@ -154,15 +154,15 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
static readonly uint[] ix = new uint[] { 0, 0, 0, 0, 3, 3, 3, 3 };
|
||||
static readonly uint[] iy = new uint[] { 1, 1, 4, 4, 1, 1, 4, 4 };
|
||||
static readonly uint[] iz = new uint[] { 2, 5, 2, 5, 2, 5, 2, 5 };
|
||||
static readonly uint[] CornerXIndex = new uint[] { 0, 0, 0, 0, 3, 3, 3, 3 };
|
||||
static readonly uint[] CornerYIndex = new uint[] { 1, 1, 4, 4, 1, 1, 4, 4 };
|
||||
static readonly uint[] CornerZIndex = new uint[] { 2, 5, 2, 5, 2, 5, 2, 5 };
|
||||
static void DrawBoundsBox(float2 pxPos, float[] transform, float[] bounds, Color c)
|
||||
{
|
||||
var corners = new float2[8];
|
||||
for (var i = 0; i < 8; i++)
|
||||
{
|
||||
var vec = new float[] { bounds[ix[i]], bounds[iy[i]], bounds[iz[i]], 1 };
|
||||
var vec = new float[] { bounds[CornerXIndex[i]], bounds[CornerYIndex[i]], bounds[CornerZIndex[i]], 1 };
|
||||
var screen = Util.MatrixVectorMultiply(transform, vec);
|
||||
corners[i] = pxPos + new float2(screen[0], screen[1]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user