From ba67a87c75a0e43b4f7a0877bb3fceaa07a770c9 Mon Sep 17 00:00:00 2001 From: spherallic Date: Thu, 15 Jun 2023 12:25:46 +0200 Subject: [PATCH] Optimize SRB2 NiGHTS/zoom tube/polyobject rendering (Text labels are removed because of performance issues) --- Source/Core/GZBuilder/Data/LinksCollector.cs | 203 +++++++++++++++ Source/Core/Rendering/IRenderer2D.cs | 3 +- Source/Core/Rendering/Renderer2D.cs | 243 +----------------- Source/Plugins/3DFloorMode/DrawSlopesMode.cs | 1 + Source/Plugins/3DFloorMode/SlopeMode.cs | 1 + Source/Plugins/3DFloorMode/ThreeDFloorMode.cs | 1 + .../BuilderModes/ClassicModes/BridgeMode.cs | 1 + .../ClassicModes/DragLinedefsMode.cs | 2 + .../ClassicModes/DragSectorsMode.cs | 2 + .../ClassicModes/DragThingsMode.cs | 1 + .../ClassicModes/DragVerticesMode.cs | 2 + .../ClassicModes/DrawGeometryMode.cs | 1 + .../ClassicModes/EditSelectionMode.cs | 3 +- .../ClassicModes/ErrorCheckMode.cs | 1 + .../ClassicModes/FindReplaceMode.cs | 3 +- .../ClassicModes/FlatAlignMode.cs | 1 + .../BuilderModes/ClassicModes/LinedefsMode.cs | 1 + .../ClassicModes/MakeSectorMode.cs | 1 + .../BuilderModes/ClassicModes/SectorsMode.cs | 1 + .../BuilderModes/ClassicModes/ThingsMode.cs | 5 +- .../BuilderModes/ClassicModes/VerticesMode.cs | 1 + .../StairSectorBuilderMode.cs | 1 + 22 files changed, 236 insertions(+), 243 deletions(-) diff --git a/Source/Core/GZBuilder/Data/LinksCollector.cs b/Source/Core/GZBuilder/Data/LinksCollector.cs index 4c1586ff..06912f7a 100755 --- a/Source/Core/GZBuilder/Data/LinksCollector.cs +++ b/Source/Core/GZBuilder/Data/LinksCollector.cs @@ -7,6 +7,8 @@ using CodeImp.DoomBuilder.Map; using CodeImp.DoomBuilder.Geometry; using CodeImp.DoomBuilder.Rendering; using CodeImp.DoomBuilder.VisualModes; +using System.Drawing; +using System.Linq; #endregion @@ -828,6 +830,207 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data return circles; } + public static List GetSRB2Lines() + { + List eventlines = new List(); + //List textlabels = new List(); + + if (!(General.Settings.SRB2RenderNiGHTS || General.Settings.SRB2RenderZoomTubes || General.Settings.SRB2RenderPolyobjects)) + return eventlines; + + List axes = new List(); + List axistransferlines = new List(); + List waypoints = new List(); + List polyanchors = new List(); + List polyspawns = new List(); + List firstlines = new List(); + + // Collect relevant things + foreach (Thing t in General.Map.Map.Things) + { + if (General.Settings.SRB2RenderNiGHTS && t.Type == 1700) + axes.Add(t); + else if (General.Settings.SRB2RenderNiGHTS && t.Type == 1702) + axistransferlines.Add(t); + else if (General.Settings.SRB2RenderZoomTubes && t.Type == 753) + waypoints.Add(t); + else if (General.Settings.SRB2RenderPolyobjects && t.Type == 760) + polyanchors.Add(t); + else if (General.Settings.SRB2RenderPolyobjects && (t.Type == 761 || t.Type == 762)) + polyspawns.Add(t); + } + + // Sort by axis number and mare number. + axistransferlines = axistransferlines.OrderBy(x => x.Args[0]).ThenBy(x => x.Args[1]).ToList(); + + // Sort waypoints by order and sequence number. + waypoints = waypoints.OrderBy(x => x.Args[0]).ThenBy(x => x.Args[1]).ToList(); + + // Sort polyobject stuff by "angle"/tag + polyanchors.Sort((x, y) => x.Tag.CompareTo(y.Tag)); + polyspawns.Sort((x, y) => x.Tag.CompareTo(y.Tag)); + + // Collect relevant lines + if (General.Settings.SRB2RenderPolyobjects) + { + foreach (Linedef l in General.Map.Map.Linedefs) + { + if (l.Action == 20) firstlines.Add(l); + } + + //Sort polyobject first lines by tag + firstlines.Sort((x, y) => x.Args[0].CompareTo(y.Args[0])); + } + + //Render (zoom tube) waypoint sequences. + if (General.Settings.SRB2RenderZoomTubes) + { + int i = 0; + int size = waypoints.Count; + int seqStart = 0; + while (i < size) + { + int iNext = i + 1; + if (waypoints[i].Args[1] == 0) // start of a new sequence? + { + seqStart = i; + //TextLabel l = new TextLabel(); + //l.Text = waypoints[i].Args[0].ToString(); + //l.Location = waypoints[i].Position; + //l.Color = PixelColor.FromColor(Color.FromArgb(255, 0, 255, 192)); + //l.TransformCoords = true; + //textlabels.Add(l); + } + + if (iNext < size) + { + // draw line between this waypoint and the next + if (waypoints[iNext].Args[1] == waypoints[i].Args[1] + 1) + eventlines.Add(new Line3D(waypoints[i].Position, waypoints[iNext].Position, PixelColor.FromColor(Color.FromArgb(255, 0, 255, 192)))); + + // mark duplicate waypoints + else if (waypoints[iNext].Args[1] == waypoints[i].Args[1]) + { + eventlines.AddRange(MakeCircleLines(waypoints[i].Position, PixelColor.FromColor(Color.Red), 32, CIRCLE_SIDES)); + eventlines.AddRange(MakeCircleLines(waypoints[iNext].Position, PixelColor.FromColor(Color.Red), 32, CIRCLE_SIDES)); + } + + // mark inaccessible waypoints + else if (i > 0 && waypoints[i].Args[1] - waypoints[i - 1].Args[1] > 1) + eventlines.AddRange(MakeCircleLines(waypoints[i].Position, PixelColor.FromColor(Color.Red), 32, CIRCLE_SIDES)); + + // draw different line between last and first waypoint of this sequence + else if (waypoints[i].Args[0] == waypoints[seqStart].Args[0] && waypoints[iNext].Args[0] > waypoints[i].Args[0]) + eventlines.Add(new Line3D(waypoints[i].Position, waypoints[seqStart].Position, PixelColor.FromColor(Color.FromArgb(255, 0, 192, 255)))); + } + i = iNext; + } + } + + //Render axis transfer lines. + if (General.Settings.SRB2RenderNiGHTS) + { + int i = 0; + int size = axistransferlines.Count; + while (i < size - 1) + { + int iNext = i; + while (iNext < size - 1 && axistransferlines[++iNext].Args[1] <= axistransferlines[i].Args[1]) ; + + if (iNext < size && axistransferlines[iNext].Args[1] == axistransferlines[i].Args[1] + 1) + { + int mare = axistransferlines[i].Args[0]; + eventlines.Add(new Line3D(axistransferlines[i].Position, axistransferlines[iNext].Position, General.Colors.GetNiGHTSColor(mare))); + /* Start looking for partners for the one beyond iNext. */ + i = iNext + 1; + } + else + { + /* No partner, so start looking for partners for iNext. */ + i = iNext; + } + } + //Render axes. + foreach (Thing axis in axes) + { + int mare = axis.Args[0]; + eventlines.AddRange(MakeCircleLines(axis.Position, General.Colors.GetNiGHTSColor(mare), axis.Args[2], CIRCLE_SIDES * 2)); + } + } + + if (General.Settings.SRB2RenderPolyobjects) + { + int i = 0, j = 0, k = 0; + Sector s = null; + while (i < polyanchors.Count && j < polyspawns.Count && k < firstlines.Count) + { + while (j + 1 < polyspawns.Count && polyanchors[i].Tag > polyspawns[j].Tag) j++; + while (k + 1 < firstlines.Count && polyanchors[i].Tag > firstlines[k].Args[0]) k++; + + if (polyanchors[i].Tag == firstlines[k].Args[0]) + s = firstlines[k].Back.Sector; + else + s = null; + + if (polyanchors[i].Tag == polyspawns[j].Tag && s != null) + { + while (j + 1 < polyspawns.Count && polyspawns[j].Tag == polyspawns[j + 1].Tag) + { + //TextLabel l = new TextLabel(); + //l.Text = polyspawns[j].Tag.ToString(); + //l.Location = polyspawns[j].Position; + //l.Color = PixelColor.FromColor(Color.Red); + //l.TransformCoords = true; + //textlabels.Add(l); + j++; + } + + double xdiff = polyanchors[i].Position.x - polyspawns[j].Position.x; + double ydiff = polyanchors[i].Position.y - polyspawns[j].Position.y; + + foreach (Sidedef side in s.Sidedefs) + { + Vector2D start = side.Line.Start.Position; + Vector2D end = side.Line.End.Position; + start.x -= xdiff; + start.y -= ydiff; + end.x -= xdiff; + end.y -= ydiff; + eventlines.Add(new Line3D(start, end, PixelColor.FromColor(Color.FromArgb(255, 128, 255, 0)), false)); + } + + //TextLabel ls = new TextLabel(); + //ls.Text = polyspawns[j].Tag.ToString(); + //ls.Location = polyspawns[j].Position; + //ls.Color = PixelColor.FromColor(Color.FromArgb(255, 128, 255, 0)); + //ls.TransformCoords = true; + //textlabels.Add(ls); + + //TextLabel la = new TextLabel(); + //la.Text = polyanchors[j].Tag.ToString(); + //la.Location = polyanchors[j].Position; + //la.Color = PixelColor.FromColor(Color.FromArgb(255, 255, 192, 0)); + //la.TransformCoords = true; + //textlabels.Add(la); + } + else + { + //TextLabel l = new TextLabel(); + //l.Text = polyanchors[j].Tag.ToString(); + //l.Location = polyanchors[j].Position; + //l.Color = PixelColor.FromColor(Color.Red); + //l.TransformCoords = true; + //textlabels.Add(l); + } + + i++; + } + } + + //General.Map.Renderer2D.RenderText(textlabels); + return eventlines; + } + #endregion #region ================== Utility diff --git a/Source/Core/Rendering/IRenderer2D.cs b/Source/Core/Rendering/IRenderer2D.cs index 0e475a83..b6117c99 100755 --- a/Source/Core/Rendering/IRenderer2D.cs +++ b/Source/Core/Rendering/IRenderer2D.cs @@ -69,12 +69,13 @@ namespace CodeImp.DoomBuilder.Rendering void PlotVerticesSet(ICollection vertices, bool checkMode = true); void RenderThing(Thing t, PixelColor c, float alpha); void RenderThingSet(ICollection things, float alpha); + void RenderSRB2Extras(); void RenderRectangle(RectangleF rect, float bordersize, PixelColor c, bool transformrect); void RenderRectangleFilled(RectangleF rect, PixelColor c, bool transformrect); void RenderRectangleFilled(RectangleF rect, PixelColor c, bool transformrect, ImageData texture); void RenderLine(Vector2D start, Vector2D end, float thickness, PixelColor c, bool transformcoords); void RenderArrows(ICollection line); //mxd - void RenderArrows(ICollection line, bool transformcoords); //mxd + void RenderArrows(ICollection line, bool transformcoords, bool sizecheck); //mxd void RenderText(TextLabel text); //mxd, DB2 compatibility void RenderText(ITextLabel text); //mxd void RenderText(IList labels); //mxd diff --git a/Source/Core/Rendering/Renderer2D.cs b/Source/Core/Rendering/Renderer2D.cs index 47700d76..4324bf9c 100755 --- a/Source/Core/Rendering/Renderer2D.cs +++ b/Source/Core/Rendering/Renderer2D.cs @@ -112,17 +112,6 @@ namespace CodeImp.DoomBuilder.Rendering // Presentation private Presentation present; - // SRB2 stuff - private List axes; - private List axistransferlines; - private List waypoints; - private List polyanchors; - private List polyspawns; - private List firstlines; - - private TextLabel spawnlabel; - private TextLabel anchorlabel; - #endregion #region ================== Properties @@ -163,24 +152,6 @@ namespace CodeImp.DoomBuilder.Rendering // Create rendertargets CreateRendertargets(); - anchorlabel = new TextLabel() // create sequence ID label - { - Text = "0", - AlignX = TextAlignmentX.Center, - AlignY = TextAlignmentY.Middle, - Color = PixelColor.FromColor(Color.FromArgb(255, 255, 192, 0)), - TransformCoords = true - }; - - spawnlabel = new TextLabel() // create sequence ID label - { - Text = "0", - AlignX = TextAlignmentX.Center, - AlignY = TextAlignmentY.Middle, - Color = PixelColor.FromColor(Color.FromArgb(255, 128, 255, 0)), - TransformCoords = true - }; - // We have no destructor GC.SuppressFinalize(this); } @@ -1594,7 +1565,7 @@ namespace CodeImp.DoomBuilder.Rendering } //mxd. Render thing boxes - RenderArrows(bboxes, false); + RenderArrows(bboxes, false, true); } } @@ -1615,194 +1586,7 @@ namespace CodeImp.DoomBuilder.Rendering public void RenderSRB2Extras() { - if (!(General.Settings.SRB2RenderNiGHTS || General.Settings.SRB2RenderZoomTubes || General.Settings.SRB2RenderPolyobjects)) return; - - axes = new List(); - axistransferlines = new List(); - waypoints = new List(); - polyanchors = new List(); - polyspawns = new List(); - firstlines = new List(); - - // Collect relevant things - foreach (Thing t in General.Map.Map.Things) - { - if (General.Settings.SRB2RenderNiGHTS && t.Type == 1700) - axes.Add(t); - else if (General.Settings.SRB2RenderNiGHTS && t.Type == 1702) - axistransferlines.Add(t); - else if (General.Settings.SRB2RenderZoomTubes && t.Type == 753) - waypoints.Add(t); - else if (General.Settings.SRB2RenderPolyobjects && t.Type == 760) - polyanchors.Add(t); - else if (General.Settings.SRB2RenderPolyobjects && (t.Type == 761 || t.Type == 762)) - polyspawns.Add(t); - } - - // Sort waypoints by order and sequence number. - waypoints = waypoints.OrderBy(x => x.Args[0]).ThenBy(x => x.Args[1]).ToList(); - - // Sort polyobject stuff by "angle"/tag - polyanchors.Sort((x, y) => x.Tag.CompareTo(y.Tag)); - polyspawns.Sort((x, y) => x.Tag.CompareTo(y.Tag)); - - // Sort by axis number and mare number. - axistransferlines = axistransferlines.OrderBy(x => x.Args[0]).ThenBy(x => x.Args[1]).ToList(); - - // Collect relevant lines - if (General.Settings.SRB2RenderPolyobjects) - { - foreach (Linedef l in General.Map.Map.Linedefs) - { - if (l.Action == 20) firstlines.Add(l); - } - - //Sort polyobject first lines by tag - firstlines.Sort((x, y) => x.Args[0].CompareTo(y.Args[0])); - } - - //Render (zoom tube) waypoint sequences. - if (General.Settings.SRB2RenderZoomTubes) - { - int i = 0; - int size = waypoints.Count; - int seqStart = 0; - ITextLabel[] sequencelabels = new ITextLabel[256]; - while (i < size) - { - int iNext = i + 1; - if (waypoints[i].Args[1] == 0) // start of a new sequence? - { - seqStart = i; - sequencelabels[waypoints[i].Args[0]] = new TextLabel() // create sequence ID label - { - Text = waypoints[i].Args[0].ToString(), - AlignX = TextAlignmentX.Center, - AlignY = TextAlignmentY.Middle, - Color = PixelColor.FromColor(Color.FromArgb(255, 0, 255, 192)), - TransformCoords = true, - Location = waypoints[i].Position - }; - } - - if (iNext < size) - { - // draw line between this waypoint and the next - if (waypoints[iNext].Args[1] == waypoints[i].Args[1] + 1) - RenderLine(waypoints[i].Position, waypoints[iNext].Position, 1.5f, PixelColor.FromColor(Color.FromArgb(255, 0, 255, 192)), true); - - // mark duplicate waypoints - else if (waypoints[iNext].Args[1] == waypoints[i].Args[1]) - { - RenderCircle(waypoints[i].Position, 32f, 1f, PixelColor.FromColor(Color.Red), true); - RenderCircle(waypoints[iNext].Position, 32f, 1f, PixelColor.FromColor(Color.Red), true); - } - - // mark inaccessible waypoints - else if (i > 0 && waypoints[i].Args[1] - waypoints[i - 1].Args[1] > 1) - RenderCircle(waypoints[i].Position, 32f, 1f, PixelColor.FromColor(Color.Red), true); - - // draw different line between last and first waypoint of this sequence - else if (waypoints[i].Args[0] == waypoints[seqStart].Args[0] && waypoints[iNext].Args[0] > waypoints[i].Args[0]) - RenderLine(waypoints[i].Position, waypoints[seqStart].Position, 0.75f, PixelColor.FromColor(Color.FromArgb(255, 0, 192, 255)), true); - } - i = iNext; - } - - for (i = 0; i < 256; i++) - if (sequencelabels[i] != null) RenderText(sequencelabels[i]); - } - - //Render axis transfer lines. - if (General.Settings.SRB2RenderNiGHTS) - { - int i = 0; - int size = axistransferlines.Count; - while (i < size - 1) - { - int iNext = i; - while (iNext < size - 1 && axistransferlines[++iNext].Args[1] <= axistransferlines[i].Args[1]) ; - - if (iNext < size && axistransferlines[iNext].Args[1] == axistransferlines[i].Args[1] + 1) - { - int mare = axistransferlines[i].Args[0]; - 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; - } - else - { - /* No partner, so start looking for partners for iNext. */ - i = iNext; - } - } - //Render axes. - foreach (Thing axis in axes) - { - int mare = axis.Args[0]; - RenderCircle(axis.Position, axis.Args[2], 1f, General.Colors.GetNiGHTSColor(mare), true); - } - } - - if (General.Settings.SRB2RenderPolyobjects) - { - int i = 0, j = 0, k = 0; - Sector s = null; - while (i < polyanchors.Count && j < polyspawns.Count && k < firstlines.Count) - { - while (j + 1 < polyspawns.Count && polyanchors[i].Tag > polyspawns[j].Tag) j++; - while (k + 1 < firstlines.Count && polyanchors[i].Tag > firstlines[k].Args[0]) k++; - - if (polyanchors[i].Tag == firstlines[k].Args[0]) - s = firstlines[k].Back.Sector; - else - s = null; - - if (polyanchors[i].Tag == polyspawns[j].Tag && s != null) - { - while (j + 1 < polyspawns.Count && polyspawns[j].Tag == polyspawns[j + 1].Tag) - { - // Mark redundant spawnpoints - spawnlabel.Text = polyspawns[j].Tag.ToString(); - spawnlabel.Location = polyspawns[j].Position; - spawnlabel.Color = PixelColor.FromColor(Color.Red); - RenderText((ITextLabel)spawnlabel); - j++; - } - - double xdiff = polyanchors[i].Position.x - polyspawns[j].Position.x; - double ydiff = polyanchors[i].Position.y - polyspawns[j].Position.y; - - foreach (Sidedef side in s.Sidedefs) - { - Vector2D start = side.Line.Start.Position; - Vector2D end = side.Line.End.Position; - start.x -= xdiff; - start.y -= ydiff; - end.x -= xdiff; - end.y -= ydiff; - RenderLine(start, end, 1.0f, PixelColor.FromColor(Color.FromArgb(255, 128, 255, 0)), true); - } - anchorlabel.Color = PixelColor.FromColor(Color.FromArgb(255, 255, 192, 0)); - spawnlabel.Color = PixelColor.FromColor(Color.FromArgb(255, 128, 255, 0)); - - spawnlabel.Text = polyspawns[j].Tag.ToString(); - spawnlabel.Location = polyspawns[j].Position; - RenderText((ITextLabel)spawnlabel); - } - else - { - // Mark unused polyobject anchors - anchorlabel.Color = PixelColor.FromColor(Color.Red); - } - - anchorlabel.Text = polyanchors[i].Tag.ToString(); - anchorlabel.Location = polyanchors[i].Position; - RenderText((ITextLabel)anchorlabel); - - i++; - } - } + RenderArrows(LinksCollector.GetSRB2Lines(), true, false); } #endregion @@ -2108,8 +1892,8 @@ namespace CodeImp.DoomBuilder.Rendering } //mxd - public void RenderArrows(ICollection lines) { RenderArrows(lines, true); } - public void RenderArrows(ICollection lines, bool transformcoords) + public void RenderArrows(ICollection lines) { RenderArrows(lines, true, true); } + public void RenderArrows(ICollection lines, bool transformcoords, bool sizecheck) { if(lines.Count == 0) return; int pointscount = 0; @@ -2130,7 +1914,7 @@ namespace CodeImp.DoomBuilder.Rendering float miny = (float)Math.Min(line.Start2D.y, line.End2D.y); // Too small / not on screen? - if(((line.End2D - line.Start2D).GetLengthSq() < MINIMUM_SPRITE_RADIUS) || ((maxx <= 0.0f) || (minx >= windowsize.Width) || (maxy <= 0.0f) || (miny >= windowsize.Height))) + if(((line.End2D - line.Start2D).GetLengthSq() < MINIMUM_SPRITE_RADIUS && sizecheck) || ((maxx <= 0.0f && sizecheck) || (minx >= windowsize.Width) || (maxy <= 0.0f && sizecheck) || (miny >= windowsize.Height))) { line.SkipRendering = true; } @@ -2496,23 +2280,6 @@ namespace CodeImp.DoomBuilder.Rendering } } - // This renders a circle with given color - public void RenderCircle(Vector2D center, float radius, float thickness, PixelColor c, bool transformcoords) - { - int CIRCLE_PRECISION = 128; - Vector2D[] points = new Vector2D[CIRCLE_PRECISION]; - for (int i = 0; i < CIRCLE_PRECISION; i++) - { - float fAngle = i * 2 * (float)Math.PI / CIRCLE_PRECISION; - points[i].x = center.x + ((float)Math.Cos(fAngle) * radius); - points[i].y = center.y + ((float)Math.Sin(fAngle) * radius); - } - for (int i = 0; i < CIRCLE_PRECISION; i++) - { - RenderLine(points[i], points[(i + 1) % CIRCLE_PRECISION], thickness, c, transformcoords); - } - } - #endregion } } diff --git a/Source/Plugins/3DFloorMode/DrawSlopesMode.cs b/Source/Plugins/3DFloorMode/DrawSlopesMode.cs index 49afc98a..6a7b5808 100644 --- a/Source/Plugins/3DFloorMode/DrawSlopesMode.cs +++ b/Source/Plugins/3DFloorMode/DrawSlopesMode.cs @@ -786,6 +786,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode if (renderer.StartThings(true)) { renderer.RenderThingSet(General.Map.Map.Things, 1.0f); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/3DFloorMode/SlopeMode.cs b/Source/Plugins/3DFloorMode/SlopeMode.cs index 817537a4..72346c03 100644 --- a/Source/Plugins/3DFloorMode/SlopeMode.cs +++ b/Source/Plugins/3DFloorMode/SlopeMode.cs @@ -210,6 +210,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode { renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA); renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, 1.0f); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/3DFloorMode/ThreeDFloorMode.cs b/Source/Plugins/3DFloorMode/ThreeDFloorMode.cs index 0a4de1d7..823d5302 100644 --- a/Source/Plugins/3DFloorMode/ThreeDFloorMode.cs +++ b/Source/Plugins/3DFloorMode/ThreeDFloorMode.cs @@ -840,6 +840,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode { renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, Presentation.THINGS_HIDDEN_ALPHA); renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, 1.0f); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/BridgeMode.cs b/Source/Plugins/BuilderModes/ClassicModes/BridgeMode.cs index 221305a7..e34d8dbb 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/BridgeMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/BridgeMode.cs @@ -373,6 +373,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.ClassicModes if(renderer.StartThings(true)) { renderer.RenderThingSet(General.Map.Map.Things, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/DragLinedefsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/DragLinedefsMode.cs index 56d4ee24..c0f8101e 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/DragLinedefsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/DragLinedefsMode.cs @@ -113,6 +113,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(renderer.StartThings(true)) { renderer.RenderThingSet(General.Map.Map.Things, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } } @@ -154,6 +155,7 @@ namespace CodeImp.DoomBuilder.BuilderModes renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha); renderer.RenderThingSet(unselectedthings, General.Settings.ActiveThingsAlpha); renderer.RenderThingSet(selectedthings, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/DragSectorsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/DragSectorsMode.cs index 67e3126b..16e6c590 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/DragSectorsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/DragSectorsMode.cs @@ -120,6 +120,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(renderer.StartThings(true)) { renderer.RenderThingSet(General.Map.Map.Things, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } } @@ -154,6 +155,7 @@ namespace CodeImp.DoomBuilder.BuilderModes renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha); renderer.RenderThingSet(unselectedthings, General.Settings.ActiveThingsAlpha); renderer.RenderThingSet(selectedthings, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/DragThingsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/DragThingsMode.cs index 6d160141..4d52edc4 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/DragThingsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/DragThingsMode.cs @@ -320,6 +320,7 @@ namespace CodeImp.DoomBuilder.BuilderModes renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha); renderer.RenderThingSet(unmovingthings, General.Settings.ActiveThingsAlpha); renderer.RenderThingSet(dragthings, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); // Draw the dragged item highlighted // This is important to know, because this item is used diff --git a/Source/Plugins/BuilderModes/ClassicModes/DragVerticesMode.cs b/Source/Plugins/BuilderModes/ClassicModes/DragVerticesMode.cs index a550f1ac..a35dc9c3 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/DragVerticesMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/DragVerticesMode.cs @@ -106,6 +106,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(renderer.StartThings(true)) { renderer.RenderThingSet(General.Map.Map.Things, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } } @@ -139,6 +140,7 @@ namespace CodeImp.DoomBuilder.BuilderModes renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha); renderer.RenderThingSet(unselectedthings, General.Settings.ActiveThingsAlpha); renderer.RenderThingSet(selectedthings, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/DrawGeometryMode.cs b/Source/Plugins/BuilderModes/ClassicModes/DrawGeometryMode.cs index a3ab3a12..6a769d91 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/DrawGeometryMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/DrawGeometryMode.cs @@ -900,6 +900,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(renderer.StartThings(true)) { renderer.RenderThingSet(General.Map.Map.Things, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs b/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs index acc89cf9..8ba7f85a 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs @@ -1962,7 +1962,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha); renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.ActiveThingsAlpha); - if(highlighted is Thing) renderer.RenderThing((Thing)highlighted, General.Colors.Highlight, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); + if (highlighted is Thing) renderer.RenderThing((Thing)highlighted, General.Colors.Highlight, General.Settings.ActiveThingsAlpha); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/ErrorCheckMode.cs b/Source/Plugins/BuilderModes/ClassicModes/ErrorCheckMode.cs index 13b06d4d..5e1ef6f4 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/ErrorCheckMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/ErrorCheckMode.cs @@ -137,6 +137,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(renderer.StartThings(true)) { renderer.RenderThingSet(General.Map.Map.Things, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); //foreach(ErrorResult result in selection) result.RenderThingsSelection(renderer); //mxd renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/FindReplaceMode.cs b/Source/Plugins/BuilderModes/ClassicModes/FindReplaceMode.cs index 5b1bbd56..28717ef0 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/FindReplaceMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/FindReplaceMode.cs @@ -142,7 +142,8 @@ namespace CodeImp.DoomBuilder.BuilderModes if(renderer.StartThings(true)) { renderer.RenderThingSet(General.Map.Map.Things, General.Settings.ActiveThingsAlpha); - if(BuilderPlug.Me.FindReplaceForm.Finder != null) + renderer.RenderSRB2Extras(); + if (BuilderPlug.Me.FindReplaceForm.Finder != null) BuilderPlug.Me.FindReplaceForm.Finder.RenderThingsSelection(renderer, selection); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/FlatAlignMode.cs b/Source/Plugins/BuilderModes/ClassicModes/FlatAlignMode.cs index 84cfca74..00a445d3 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/FlatAlignMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/FlatAlignMode.cs @@ -877,6 +877,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha); renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs index d2691091..b447a3dc 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs @@ -701,6 +701,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha); renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/MakeSectorMode.cs b/Source/Plugins/BuilderModes/ClassicModes/MakeSectorMode.cs index 0130faf4..70cda7e8 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/MakeSectorMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/MakeSectorMode.cs @@ -344,6 +344,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha); renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs index 4441b5d2..1c294ccc 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs @@ -952,6 +952,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha); renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs index f534b739..c54d2c22 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/ThingsMode.cs @@ -249,8 +249,9 @@ namespace CodeImp.DoomBuilder.BuilderModes float alpha = (General.Settings.FixedThingsScale ? Presentation.THINGS_ALPHA : General.Settings.ActiveThingsAlpha); //mxd renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha); renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, alpha); - - if(highlighted != null && !highlighted.IsDisposed) + renderer.RenderSRB2Extras(); + + if (highlighted != null && !highlighted.IsDisposed) { renderer.RenderThing(highlighted, General.Colors.Highlight, alpha); highlightasso.Render(); diff --git a/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs b/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs index c3fe5f0a..d40207a7 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs @@ -183,6 +183,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { renderer.RenderThingSet(General.Map.ThingsFilter.HiddenThings, General.Settings.HiddenThingsAlpha); renderer.RenderThingSet(General.Map.ThingsFilter.VisibleThings, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); } diff --git a/Source/Plugins/StairSectorBuilder/StairSectorBuilderMode.cs b/Source/Plugins/StairSectorBuilder/StairSectorBuilderMode.cs index eba439eb..3e4f98e4 100755 --- a/Source/Plugins/StairSectorBuilder/StairSectorBuilderMode.cs +++ b/Source/Plugins/StairSectorBuilder/StairSectorBuilderMode.cs @@ -1481,6 +1481,7 @@ namespace CodeImp.DoomBuilder.StairSectorBuilderMode if(renderer.StartThings(true)) { renderer.RenderThingSet(General.Map.Map.Things, General.Settings.ActiveThingsAlpha); + renderer.RenderSRB2Extras(); renderer.Finish(); }