Add labels for zoom tube waypoint sequence IDs and an indicator for duplicate waypoints.

This commit is contained in:
sphere 2021-02-26 13:04:24 +01:00
parent b59f8fef63
commit 469f56e6fc

View file

@ -1460,20 +1460,39 @@ namespace CodeImp.DoomBuilder.Rendering
int i = 0;
int size = waypoints.Count;
int seqStart = 0;
TextLabel[] sequencelabels = new TextLabel[256];
while (i < size - 1)
{
int iNext = i + 1;
if (waypoints[i].AngleDoom % 256 == 0)
if (waypoints[i].AngleDoom % 256 == 0) // start of a new sequence?
{
seqStart = i;
sequencelabels[waypoints[i].AngleDoom / 256] = new TextLabel(3) // create sequence ID label
{
Text = (waypoints[i].AngleDoom / 256).ToString(),
AlignX = TextAlignmentX.Center,
AlignY = TextAlignmentY.Middle,
Color = General.Colors.WaypointColor,
Backcolor = General.Colors.Background,
Scale = 16f,
TransformCoords = true,
Rectangle = new RectangleF(waypoints[i].Position.x, waypoints[i].Position.y, 0.0f, 0.0f)
};
}
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);
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);
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);
i = iNext;
}
//Render axis transfer lines.
i = 0;
for (i = 0; i < 256; i++)
if (sequencelabels[i] != null) RenderText(sequencelabels[i]);
//Render axis transfer lines.
i = 0;
size = axistransferlines.Count;
while (i < size - 1)
{