Adjust duplicate waypoint indicators and remove redundant casts.

This commit is contained in:
sphere 2021-02-26 16:31:09 +01:00
parent 469f56e6fc
commit 0cf3e0a29c

View file

@ -1480,11 +1480,14 @@ namespace CodeImp.DoomBuilder.Rendering
};
}
if (iNext < size && waypoints[iNext].AngleDoom == waypoints[i].AngleDoom + 1) // next waypoint of this sequence?
RenderLine((Vector2D)waypoints[i].Position, (Vector2D)waypoints[iNext].Position, 1.5f, General.Colors.WaypointColor, true);
RenderLine(waypoints[i].Position, waypoints[iNext].Position, 1.5f, General.Colors.WaypointColor, true);
else if (iNext < size && waypoints[iNext].AngleDoom == waypoints[i].AngleDoom) // mark duplicate waypoints
RenderCircle((Vector2D)waypoints[iNext].Position, 32f, 1f, PixelColor.FromColor(Color.Red), true);
{
RenderCircle(waypoints[i].Position, 32f, 1f, PixelColor.FromColor(Color.Red), true);
RenderCircle(waypoints[iNext].Position, 32f, 1f, PixelColor.FromColor(Color.Red), true);
}
else // draw different line between last and first waypoint of this sequence
RenderLine((Vector2D)waypoints[i].Position, (Vector2D)waypoints[seqStart].Position, 0.75f, General.Colors.WaypointLoopColor, true);
RenderLine(waypoints[i].Position, waypoints[seqStart].Position, 0.75f, General.Colors.WaypointLoopColor, true);
i = iNext;
}
@ -1502,7 +1505,7 @@ namespace CodeImp.DoomBuilder.Rendering
if (iNext < size && axistransferlines[iNext].GetFlagsValue() == axistransferlines[i].GetFlagsValue() + 1)
{
int mare = axistransferlines[i].Parameter;
RenderLine((Vector2D)axistransferlines[i].Position, (Vector2D)axistransferlines[iNext].Position, 1f, General.Colors.GetNiGHTSColor(mare), true);
RenderLine(axistransferlines[i].Position, axistransferlines[iNext].Position, 1f, General.Colors.GetNiGHTSColor(mare), true);
/* Start looking for partners for the one beyond iNext. */
i = iNext + 1;
}
@ -1516,7 +1519,7 @@ namespace CodeImp.DoomBuilder.Rendering
foreach (Thing axis in axes)
{
int mare = axis.Parameter;
RenderCircle((Vector2D)axis.Position, (float)(axis.AngleDoom & 0x3FFF), 1f, General.Colors.GetNiGHTSColor(mare), true);
RenderCircle(axis.Position, (float)(axis.AngleDoom & 0x3FFF), 1f, General.Colors.GetNiGHTSColor(mare), true);
}
}
#endregion