Merge branch 'srb2-extras-rendering' into 'master'

Draw NiGHTS track, zoom tubes and polyobjects in classic modes

See merge request STJr/UltimateZoneBuilder!8
This commit is contained in:
sphere 2023-06-04 20:03:41 +00:00
commit 53086d6c22
13 changed files with 3246 additions and 82 deletions

View file

@ -906,6 +906,8 @@
<EmbeddedResource Include="Resources\MissingTexture3D.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\polycenter.png" />
<None Include="Resources\ZoomTube.png" />
<None Include="Resources\UZB16.png" />
<None Include="Resources\UZB_Splash.png" />
<None Include="Resources\UZB.ico" />
@ -1392,6 +1394,7 @@
<None Include="Resources\Angle6.png" />
<None Include="Resources\Angle7.png" />
<None Include="Resources\AboutBack.png" />
<None Include="Resources\axis1.png" />
<Content Include="Resources\ClassicRendering.png" />
<Content Include="Resources\DB2.ico" />
<None Include="Resources\GZDB2.ico" />

View file

@ -153,6 +153,11 @@ namespace CodeImp.DoomBuilder.Config
private bool flatShadeVertices;
private bool alwaysShowVertices;
// SRB2
private bool srb2rendernights;
private bool srb2renderzoomtubes;
private bool srb2renderpolyobjects;
// These are not stored in the configuration, only used at runtime
private int defaultbrightness;
private int defaultfloorheight;
@ -287,6 +292,11 @@ namespace CodeImp.DoomBuilder.Config
public bool AlwaysShowVertices { get { return alwaysShowVertices; } internal set { alwaysShowVertices = value; } }
//SRB2
public bool SRB2RenderNiGHTS { get { return srb2rendernights; } internal set { srb2rendernights = value; } }
public bool SRB2RenderZoomTubes { get { return srb2renderzoomtubes; } internal set { srb2renderzoomtubes = value; } }
public bool SRB2RenderPolyobjects { get { return srb2renderpolyobjects; } internal set { srb2renderpolyobjects = value; } }
//mxd. Left here for compatibility reasons...
public string DefaultTexture { get { return General.Map != null ? General.Map.Options.DefaultWallTexture : "-"; } set { if(General.Map != null) General.Map.Options.DefaultWallTexture = value; } }
public string DefaultFloorTexture { get { return General.Map != null ? General.Map.Options.DefaultFloorTexture : "-"; } set { if(General.Map != null) General.Map.Options.DefaultFloorTexture = value; } }
@ -428,6 +438,11 @@ namespace CodeImp.DoomBuilder.Config
alwaysShowVertices = cfg.ReadSetting("alwaysshowvertices", true);
flatShadeVertices = cfg.ReadSetting("flatshadevertices", false);
// SRB2
srb2rendernights = cfg.ReadSetting("srb2rendernights", true);
srb2renderpolyobjects = cfg.ReadSetting("srb2renderpolyobjects", true);
srb2renderzoomtubes = cfg.ReadSetting("srb2renderzoomtubes", true);
//mxd. Sector defaults
defaultceilheight = cfg.ReadSetting("defaultceilheight", 128);
defaultfloorheight = cfg.ReadSetting("defaultfloorheight", 0);
@ -573,6 +588,11 @@ namespace CodeImp.DoomBuilder.Config
cfg.WriteSetting("alwaysshowvertices", alwaysShowVertices);
cfg.WriteSetting("flatshadevertices", flatShadeVertices);
//SRB2
cfg.WriteSetting("srb2rendernights", srb2rendernights);
cfg.WriteSetting("srb2renderzoomtubes", srb2renderzoomtubes);
cfg.WriteSetting("srb2renderpolyobjects", srb2renderpolyobjects);
// Toasts
General.ToastManager.WriteSettings(cfg);

View file

@ -1010,6 +1010,16 @@ namespace CodeImp.DoomBuilder.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap NiGHTSAxis {
get {
object obj = ResourceManager.GetObject("NiGHTSAxis", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -1060,6 +1070,16 @@ namespace CodeImp.DoomBuilder.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Polyobject {
get {
object obj = ResourceManager.GetObject("Polyobject", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -1789,5 +1809,15 @@ namespace CodeImp.DoomBuilder.Properties {
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ZoomTube {
get {
object obj = ResourceManager.GetObject("ZoomTube", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View file

@ -637,4 +637,13 @@
<data name="UZB_Splash" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UZB_Splash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NiGHTSAxis" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\axis1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Polyobject" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\polycenter.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ZoomTube" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ZoomTube.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -338,6 +338,22 @@ namespace CodeImp.DoomBuilder.Rendering
}
}
public PixelColor GetNiGHTSColor(int mare)
{
switch (mare)
{
case 0: return PixelColor.FromColor(Color.FromArgb(255, 255, 224, 0));
case 1: return PixelColor.FromColor(Color.FromArgb(255, 255, 128, 16));
case 2: return PixelColor.FromColor(Color.FromArgb(255, 255, 0, 0));
case 3: return PixelColor.FromColor(Color.FromArgb(255, 255, 16, 224));
case 4: return PixelColor.FromColor(Color.FromArgb(255, 128, 0, 255));
case 5: return PixelColor.FromColor(Color.FromArgb(255, 0, 0, 255));
case 6: return PixelColor.FromColor(Color.FromArgb(255, 16, 224, 255));
case 7: return PixelColor.FromColor(Color.FromArgb(255, 0, 224, 0));
default: return PixelColor.FromColor(Color.Gray);
}
}
#endregion
}
}

View file

@ -27,6 +27,8 @@ using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.GZBuilder.Data; //mxd
using CodeImp.DoomBuilder.Config; //mxd
using CodeImp.DoomBuilder.GZBuilder;
using System.Linq;
#endregion
@ -110,6 +112,17 @@ namespace CodeImp.DoomBuilder.Rendering
// Presentation
private Presentation present;
// SRB2 stuff
private List<Thing> axes;
private List<Thing> axistransferlines;
private List<Thing> waypoints;
private List<Thing> polyanchors;
private List<Thing> polyspawns;
private List<Linedef> firstlines;
private TextLabel spawnlabel;
private TextLabel anchorlabel;
#endregion
#region ================== Properties
@ -150,6 +163,24 @@ 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);
}
@ -1579,6 +1610,199 @@ namespace CodeImp.DoomBuilder.Rendering
public void RenderThingSet(ICollection<Thing> things, float alpha)
{
RenderThingsBatch(things, alpha, false, new PixelColor());
RenderSRB2Extras();
}
public void RenderSRB2Extras()
{
if (!(General.Settings.SRB2RenderNiGHTS || General.Settings.SRB2RenderZoomTubes || General.Settings.SRB2RenderPolyobjects)) return;
axes = new List<Thing>();
axistransferlines = new List<Thing>();
waypoints = new List<Thing>();
polyanchors = new List<Thing>();
polyspawns = new List<Thing>();
firstlines = new List<Linedef>();
// 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.Sort((x, y) => (x.Args[1] | x.Args[0]).CompareTo(y.Args[1] | y.Args[0]));
// 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.Tag.CompareTo(y.Tag));
}
//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].Tag) k++;
if (polyanchors[i].Tag == firstlines[k].Tag)
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].AngleDoom.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++;
}
}
}
#endregion
@ -2272,6 +2496,23 @@ 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
}
}

View file

@ -1365,6 +1365,36 @@ gztoggleenhancedrendering
registertoast = true;
}
srb2togglenights
{
title = "Toggle NiGHTS axis rendering";
category = "view";
description = "When enabled, shows NiGHTS axis circles and transfer lines.";
allowkeys = true;
allowmouse = true;
allowscroll = false;
}
srb2togglezoomtubes
{
title = "Toggle zoom tube waypoint rendering";
category = "view";
description = "When enabled, shows zoom tube waypoint sequences.";
allowkeys = true;
allowmouse = true;
allowscroll = false;
}
srb2togglepolyobjects
{
title = "Toggle polyobject preview rendering";
category = "view";
description = "When enabled, shows polyobject previews.";
allowkeys = true;
allowmouse = true;
allowscroll = false;
}
//////////////////////////////
//GZDOOMBUILDER MENU ACTIONS//
//////////////////////////////

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

View file

@ -293,6 +293,14 @@ namespace CodeImp.DoomBuilder.Windows
this.itemaligngridtolinedef = new System.Windows.Forms.ToolStripMenuItem();
this.itemsetgridorigintovertex = new System.Windows.Forms.ToolStripMenuItem();
this.itemresetgrid = new System.Windows.Forms.ToolStripMenuItem();
this.buttontogglerendernights = new CodeImp.DoomBuilder.Controls.ToolStripActionButton();
this.buttontogglerenderzoomtubes = new CodeImp.DoomBuilder.Controls.ToolStripActionButton();
this.buttontogglerenderpolyobjects = new CodeImp.DoomBuilder.Controls.ToolStripActionButton();
this.itemtogglerendernights = new System.Windows.Forms.ToolStripMenuItem();
this.itemtogglerenderzoomtubes = new System.Windows.Forms.ToolStripMenuItem();
this.itemtogglerenderpolyobjects = new System.Windows.Forms.ToolStripMenuItem();
this.seperatorviewsrb2 = new System.Windows.Forms.ToolStripSeparator();
this.separatorsrb2 = new System.Windows.Forms.ToolStripSeparator();
toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
@ -792,6 +800,10 @@ namespace CodeImp.DoomBuilder.Windows
this.itemviewfloors,
this.itemviewceilings,
this.seperatorviewviews,
this.itemtogglerendernights,
this.itemtogglerenderzoomtubes,
this.itemtogglerenderpolyobjects,
this.seperatorviewsrb2,
this.itemfullbrightness,
this.itemtogglegrid,
this.itemtogglecomments,
@ -1387,6 +1399,10 @@ namespace CodeImp.DoomBuilder.Windows
this.buttonviewbrightness,
this.buttonviewfloors,
this.buttonviewceilings,
this.separatorsrb2,
this.buttontogglerendernights,
this.buttontogglerenderzoomtubes,
this.buttontogglerenderpolyobjects,
this.separatorgeomergemodes,
this.buttonmergegeoclassic,
this.buttonmergegeo,
@ -2858,6 +2874,83 @@ namespace CodeImp.DoomBuilder.Windows
this.itemdynamicgridsize.Text = "Dynamic Grid Size";
this.itemdynamicgridsize.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// buttontogglerendernights
//
this.buttontogglerendernights.CheckOnClick = true;
this.buttontogglerendernights.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.buttontogglerendernights.Image = global::CodeImp.DoomBuilder.Properties.Resources.NiGHTSAxis;
this.buttontogglerendernights.ImageTransparentColor = System.Drawing.Color.Magenta;
this.buttontogglerendernights.Name = "buttontogglerendernights";
this.buttontogglerendernights.Size = new System.Drawing.Size(23, 20);
this.buttontogglerendernights.Tag = "builder_srb2togglenights";
this.buttontogglerendernights.Text = "Render NiGHTS track";
this.buttontogglerendernights.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// buttontogglerenderzoomtubes
//
this.buttontogglerenderzoomtubes.CheckOnClick = true;
this.buttontogglerenderzoomtubes.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.buttontogglerenderzoomtubes.Image = global::CodeImp.DoomBuilder.Properties.Resources.ZoomTube;
this.buttontogglerenderzoomtubes.ImageTransparentColor = System.Drawing.Color.Magenta;
this.buttontogglerenderzoomtubes.Name = "buttontogglerenderzoomtubes";
this.buttontogglerenderzoomtubes.Size = new System.Drawing.Size(23, 20);
this.buttontogglerenderzoomtubes.Tag = "builder_srb2togglezoomtubes";
this.buttontogglerenderzoomtubes.Text = "Render zoom tube waypoints";
this.buttontogglerenderzoomtubes.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// buttontogglerenderpolyobjects
//
this.buttontogglerenderpolyobjects.CheckOnClick = true;
this.buttontogglerenderpolyobjects.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.buttontogglerenderpolyobjects.Image = global::CodeImp.DoomBuilder.Properties.Resources.Polyobject;
this.buttontogglerenderpolyobjects.ImageTransparentColor = System.Drawing.Color.Magenta;
this.buttontogglerenderpolyobjects.Name = "buttontogglerenderpolyobjects";
this.buttontogglerenderpolyobjects.Size = new System.Drawing.Size(23, 20);
this.buttontogglerenderpolyobjects.Tag = "builder_srb2togglepolyobjects";
this.buttontogglerenderpolyobjects.Text = "Render polyobjects";
this.buttontogglerenderpolyobjects.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// itemtogglerendernights
//
this.itemtogglerendernights.CheckOnClick = true;
this.itemtogglerendernights.Image = global::CodeImp.DoomBuilder.Properties.Resources.NiGHTSAxis;
this.itemtogglerendernights.Name = "itemtogglerendernights";
this.itemtogglerendernights.Size = new System.Drawing.Size(273, 22);
this.itemtogglerendernights.Tag = "builder_srb2rendernights";
this.itemtogglerendernights.Text = "Render NiGHTS track";
this.itemtogglerendernights.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// itemtogglerenderzoomtubes
//
this.itemtogglerenderzoomtubes.CheckOnClick = true;
this.itemtogglerenderzoomtubes.Image = global::CodeImp.DoomBuilder.Properties.Resources.ZoomTube;
this.itemtogglerenderzoomtubes.Name = "itemtogglerenderzoomtubes";
this.itemtogglerenderzoomtubes.Size = new System.Drawing.Size(273, 22);
this.itemtogglerenderzoomtubes.Tag = "builder_srb2renderzoomtubes";
this.itemtogglerenderzoomtubes.Text = "Render zoom tube waypoints";
this.itemtogglerenderzoomtubes.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// itemtogglerenderpolyobjects
//
this.itemtogglerenderpolyobjects.CheckOnClick = true;
this.itemtogglerenderpolyobjects.Image = global::CodeImp.DoomBuilder.Properties.Resources.Polyobject;
this.itemtogglerenderpolyobjects.Name = "itemtogglerenderpolyobjects";
this.itemtogglerenderpolyobjects.Size = new System.Drawing.Size(273, 22);
this.itemtogglerenderpolyobjects.Tag = "builder_srb2togglepolyobjects";
this.itemtogglerenderpolyobjects.Text = "Render polyobjects";
this.itemtogglerenderpolyobjects.Click += new System.EventHandler(this.InvokeTaggedAction);
//
// seperatorviewsrb2
//
this.seperatorviewsrb2.Name = "seperatorviewsrb2";
this.seperatorviewsrb2.Size = new System.Drawing.Size(212, 6);
//
// separatorsrb2
//
this.separatorsrb2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
this.separatorsrb2.Name = "separatorsrb2";
this.separatorsrb2.Size = new System.Drawing.Size(6, 25);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@ -3117,6 +3210,14 @@ namespace CodeImp.DoomBuilder.Windows
private System.Windows.Forms.ToolStripMenuItem itemtoggleclassicrendering;
private System.Windows.Forms.ToolStripMenuItem itemtoggleeventlines;
private System.Windows.Forms.ToolStripMenuItem itemtogglevisualverts;
private CodeImp.DoomBuilder.Controls.ToolStripActionButton buttontogglerendernights;
private CodeImp.DoomBuilder.Controls.ToolStripActionButton buttontogglerenderzoomtubes;
private CodeImp.DoomBuilder.Controls.ToolStripActionButton buttontogglerenderpolyobjects;
private System.Windows.Forms.ToolStripMenuItem itemtogglerendernights;
private System.Windows.Forms.ToolStripMenuItem itemtogglerenderzoomtubes;
private System.Windows.Forms.ToolStripMenuItem itemtogglerenderpolyobjects;
private System.Windows.Forms.ToolStripSeparator seperatorviewsrb2;
private System.Windows.Forms.ToolStripSeparator separatorsrb2;
private ToolStripMenuItem itemimport;
private ToolStripMenuItem itemexport;
private ToolStripSeparator separatorio;

View file

@ -2196,6 +2196,9 @@ namespace CodeImp.DoomBuilder.Windows
buttonautoclearsidetextures.Visible = General.Settings.ToolbarGeometry && maploaded; //mxd
buttontest.Visible = General.Settings.ToolbarTesting && maploaded;
buttontoggleclassicrendering.Visible = General.Settings.ToolbarViewModes && maploaded;
buttontogglerendernights.Visible = General.Settings.ToolbarViewModes && maploaded;
buttontogglerenderzoomtubes.Visible = General.Settings.ToolbarViewModes && maploaded;
buttontogglerenderpolyobjects.Visible = General.Settings.ToolbarViewModes && maploaded;
//mxd
modelrendermode.Visible = General.Settings.GZToolbarGZDoom && maploaded;
@ -2377,6 +2380,9 @@ namespace CodeImp.DoomBuilder.Windows
buttontoggleeventlines.Checked = General.Settings.GZShowEventLines;
buttontogglevisualvertices.Visible = General.Map.UDMF;
buttontogglevisualvertices.Checked = General.Settings.GZShowVisualVertices;
buttontogglerendernights.Checked = General.Settings.SRB2RenderNiGHTS;
buttontogglerenderzoomtubes.Checked = General.Settings.SRB2RenderZoomTubes;
buttontogglerenderpolyobjects.Checked = General.Settings.SRB2RenderPolyobjects;
}
}
@ -3222,9 +3228,12 @@ namespace CodeImp.DoomBuilder.Windows
itemtoggleeventlines.Checked = General.Settings.GZShowEventLines;
itemtogglevisualverts.Visible = (General.Map != null && General.Map.UDMF);
itemtogglevisualverts.Checked = General.Settings.GZShowVisualVertices;
itemtogglerendernights.Checked = General.Settings.SRB2RenderNiGHTS;
itemtogglerenderzoomtubes.Checked = General.Settings.SRB2RenderZoomTubes;
itemtogglerenderpolyobjects.Checked = General.Settings.SRB2RenderPolyobjects;
// Update Model Rendering Mode items...
foreach(ToolStripMenuItem item in itemmodelmodes.DropDownItems)
foreach (ToolStripMenuItem item in itemmodelmodes.DropDownItems)
{
item.Checked = ((ModelRenderMode)item.Tag == General.Settings.GZDrawModelsMode);
if(item.Checked) itemmodelmodes.Image = item.Image;
@ -3349,6 +3358,45 @@ namespace CodeImp.DoomBuilder.Windows
General.MainWindow.UpdateGZDoomPanel();
}
[BeginAction("srb2togglenights")]
internal void SRB2ToggleNiGHTS()
{
General.Settings.SRB2RenderNiGHTS = !General.Settings.SRB2RenderNiGHTS;
itemtogglerendernights.Checked = General.Settings.SRB2RenderNiGHTS;
buttontogglerendernights.Checked = General.Settings.SRB2RenderNiGHTS;
General.MainWindow.DisplayStatus(StatusType.Action, "NiGHTS track rendering " + (General.Settings.SRB2RenderNiGHTS ? "ENABLED" : "DISABLED"));
General.MainWindow.RedrawDisplay();
General.MainWindow.UpdateGZDoomPanel();
}
[BeginAction("srb2togglezoomtubes")]
internal void SRB2ToggleZoomTubes()
{
General.Settings.SRB2RenderZoomTubes = !General.Settings.SRB2RenderZoomTubes;
itemtogglerenderzoomtubes.Checked = General.Settings.SRB2RenderZoomTubes;
buttontogglerenderzoomtubes.Checked = General.Settings.SRB2RenderZoomTubes;
General.MainWindow.DisplayStatus(StatusType.Action, "Zoom tube waypoint rendering is " + (General.Settings.SRB2RenderZoomTubes ? "ENABLED" : "DISABLED"));
General.MainWindow.RedrawDisplay();
General.MainWindow.UpdateGZDoomPanel();
}
[BeginAction("srb2togglepolyobjects")]
internal void SRB2TogglePolyobjects()
{
General.Settings.SRB2RenderPolyobjects = !General.Settings.SRB2RenderPolyobjects;
itemtogglerenderpolyobjects.Checked = General.Settings.SRB2RenderPolyobjects;
buttontogglerenderpolyobjects.Checked = General.Settings.SRB2RenderPolyobjects;
General.MainWindow.DisplayStatus(StatusType.Action, "Polyobject preview rendering is " + (General.Settings.SRB2RenderPolyobjects ? "ENABLED" : "DISABLED"));
General.MainWindow.RedrawDisplay();
General.MainWindow.UpdateGZDoomPanel();
}
#endregion
#region ================== Mode Menu

File diff suppressed because it is too large Load diff