From ae8780f4eaabc7834d34a736daa47b8526a1fd06 Mon Sep 17 00:00:00 2001 From: MaxED Date: Mon, 20 May 2013 10:43:34 +0000 Subject: [PATCH] Classic Modes: added 3D floor indication (color can be changed in Preferences -> Appearance -> 3D Floors). Sector_Set3dFloor action (160): added hi-tag/line ID check. --- Source/Core/Rendering/ColorCollection.cs | 12 ++- Source/Core/Rendering/IRenderer2D.cs | 1 + Source/Core/Rendering/Plotter.cs | 23 +++++ Source/Core/Rendering/Renderer2D.cs | 28 +++++- .../Core/Windows/PreferencesForm.Designer.cs | 85 +++++++++++-------- Source/Core/Windows/PreferencesForm.cs | 2 + Source/Core/Windows/PreferencesForm.resx | 3 - .../ClassicModes/BaseClassicMode.cs | 1 + .../BuilderModes/ClassicModes/LinedefsMode.cs | 2 + .../BuilderModes/ClassicModes/SectorsMode.cs | 2 + .../BuilderModes/ClassicModes/VerticesMode.cs | 12 ++- .../BuilderModes/General/BuilderPlug.cs | 2 + .../VisualModes/BaseVisualMode.cs | 3 +- .../BuilderModes/VisualModes/Effect3DFloor.cs | 1 + 14 files changed, 125 insertions(+), 52 deletions(-) diff --git a/Source/Core/Rendering/ColorCollection.cs b/Source/Core/Rendering/ColorCollection.cs index 7e146c1e..c8e4c0a4 100644 --- a/Source/Core/Rendering/ColorCollection.cs +++ b/Source/Core/Rendering/ColorCollection.cs @@ -38,7 +38,7 @@ namespace CodeImp.DoomBuilder.Rendering private const float DARK_ADDITION = -0.2f; // Palette size - private const int NUM_COLORS = 41; + private const int NUM_COLORS = 42; public const int NUM_THING_COLORS = 20; public const int THING_COLORS_OFFSET = 20; @@ -46,12 +46,8 @@ namespace CodeImp.DoomBuilder.Rendering public const int BACKGROUND = 0; public const int VERTICES = 1; public const int LINEDEFS = 2; - //mxd - //public const int ACTIONS = 3; - //public const int SOUNDS = 4; - public const int MODELWIRECOLOR = 3; - public const int INFOLINECOLOR = 4; - + public const int MODELWIRECOLOR = 3; //mxd + public const int INFOLINECOLOR = 4; //mxd public const int HIGHLIGHT = 5; public const int SELECTION = 6; public const int INDICATION = 7; @@ -88,6 +84,7 @@ namespace CodeImp.DoomBuilder.Rendering public const int THINGCOLOR18 = 38; public const int THINGCOLOR19 = 39; public const int NEWSECTORCOLOR = 40;//mxd + public const int THREEDFLOORCOLOR = 41; //mxd #endregion @@ -123,6 +120,7 @@ namespace CodeImp.DoomBuilder.Rendering public PixelColor ModelWireframe { get { return colors[MODELWIRECOLOR]; } internal set { colors[MODELWIRECOLOR] = value; } } public PixelColor InfoLine { get { return colors[INFOLINECOLOR]; } internal set { colors[INFOLINECOLOR] = value; } } public PixelColor NewSector { get { return colors[NEWSECTORCOLOR]; } internal set { colors[NEWSECTORCOLOR] = value; } } + public PixelColor ThreeDFloor { get { return colors[THREEDFLOORCOLOR]; } internal set { colors[THREEDFLOORCOLOR] = value;} } public PixelColor Crosshair3D { get { return colors[CROSSHAIR3D]; } internal set { colors[CROSSHAIR3D] = value; } } public PixelColor Highlight3D { get { return colors[HIGHLIGHT3D]; } internal set { colors[HIGHLIGHT3D] = value; } } diff --git a/Source/Core/Rendering/IRenderer2D.cs b/Source/Core/Rendering/IRenderer2D.cs index 556f2f72..e6ba1db0 100644 --- a/Source/Core/Rendering/IRenderer2D.cs +++ b/Source/Core/Rendering/IRenderer2D.cs @@ -47,6 +47,7 @@ namespace CodeImp.DoomBuilder.Rendering PixelColor DetermineThingColor(Thing t); int DetermineVertexColor(Vertex v); int CalculateBrightness(int level); + void Update3dFloorTagsList(); //mxd // Rendering management methods bool StartPlotter(bool clear); diff --git a/Source/Core/Rendering/Plotter.cs b/Source/Core/Rendering/Plotter.cs index 7b383be5..d133687d 100644 --- a/Source/Core/Rendering/Plotter.cs +++ b/Source/Core/Rendering/Plotter.cs @@ -17,6 +17,7 @@ #region ================== Namespaces using System; +using CodeImp.DoomBuilder.Geometry; #endregion @@ -26,6 +27,8 @@ namespace CodeImp.DoomBuilder.Rendering { #region ================== Constants + private const int DASH_INTERVAL = 16; //mxd + #endregion #region ================== Variables @@ -330,6 +333,26 @@ namespace CodeImp.DoomBuilder.Rendering } } + //mxd + public void DrawLine3DFloor(Vector2D start, Vector2D end, ref PixelColor c, PixelColor c2) { + Vector2D delta = end - start; + float length = delta.GetLength(); + + if(length < DASH_INTERVAL * 2) { + DrawLineSolid((int)start.x, (int)start.y, (int)end.x, (int)end.y, ref c2); + } else { + float d1 = DASH_INTERVAL / length; + float d2 = 1.0f - d1; + + Vector2D p1 = CurveTools.GetPointOnLine(start, end, d1); + Vector2D p2 = CurveTools.GetPointOnLine(start, end, d2); + + DrawLineSolid((int)start.x, (int)start.y, (int)p1.x, (int)p1.y, ref c2); + DrawLineSolid((int)p1.x, (int)p1.y, (int)p2.x, (int)p2.y, ref c); + DrawLineSolid((int)p2.x, (int)p2.y, (int)end.x, (int)end.y, ref c2); + } + } + #endregion } } diff --git a/Source/Core/Rendering/Renderer2D.cs b/Source/Core/Rendering/Renderer2D.cs index 5a8c5d4e..b3c0b869 100644 --- a/Source/Core/Rendering/Renderer2D.cs +++ b/Source/Core/Rendering/Renderer2D.cs @@ -96,7 +96,6 @@ namespace CodeImp.DoomBuilder.Rendering private VertexBuffer thingsvertices; // Render settings - //private bool thingsfront; private int vertexsize; private RenderLayers renderlayer = RenderLayers.None; @@ -127,6 +126,7 @@ namespace CodeImp.DoomBuilder.Rendering //mxd private Dictionary thingsWithModel; + private List tagsOf3DFloors; #endregion @@ -161,6 +161,7 @@ namespace CodeImp.DoomBuilder.Rendering // Create surface manager surfaces = new SurfaceManager(); + tagsOf3DFloors = new List(); //mxd // Create rendertargets CreateRendertargets(); @@ -617,6 +618,20 @@ namespace CodeImp.DoomBuilder.Rendering return General.Colors.Linedefs.WithAlpha(General.Settings.DoubleSidedAlphaByte); } + //mxd + public void Update3dFloorTagsList() { + //mxd. Collect 3d-floors tags + tagsOf3DFloors = new List(); + foreach(Linedef l in General.Map.Map.Linedefs){ + if(l.Action == 160) { + int sectortag = (l.Args[1] & 8) != 0 ? l.Args[0] : l.Args[0] + (l.Args[4] << 8); + + if(sectortag != 0 && !tagsOf3DFloors.Contains(sectortag)) + tagsOf3DFloors.Add(sectortag); + } + } + } + #endregion #region ================== Start / Finish @@ -640,11 +655,11 @@ namespace CodeImp.DoomBuilder.Rendering // Create structures plotter plotter = new Plotter((PixelColor*)plotlocked.Data.DataPointer.ToPointer(), plotlocked.Pitch / sizeof(PixelColor), structsize.Height, structsize.Width, structsize.Height); - if(clear) plotter.Clear(); // Redraw grid when structures image was cleared if(clear) { + plotter.Clear(); RenderBackgroundGrid(); SetupBackground(); } @@ -1604,8 +1619,13 @@ namespace CodeImp.DoomBuilder.Rendering } } - // Draw line - plotter.DrawLineSolid((int)v1.x, (int)v1.y, (int)v2.x, (int)v2.y, ref c); + // Draw line. mxd: added 3d-floor indication + if((l.Front != null && l.Front.Sector != null && tagsOf3DFloors.Contains(l.Front.Sector.Tag)) || + (l.Back != null && l.Back.Sector != null && tagsOf3DFloors.Contains(l.Back.Sector.Tag))) { + plotter.DrawLine3DFloor(v1, v2, ref c, General.Colors.ThreeDFloor); + } else { + plotter.DrawLineSolid((int)v1.x, (int)v1.y, (int)v2.x, (int)v2.y, ref c); + } // Calculate normal indicator float mx = (v2.x - v1.x) * 0.5f; diff --git a/Source/Core/Windows/PreferencesForm.Designer.cs b/Source/Core/Windows/PreferencesForm.Designer.cs index 1cefced2..89692d98 100644 --- a/Source/Core/Windows/PreferencesForm.Designer.cs +++ b/Source/Core/Windows/PreferencesForm.Designer.cs @@ -163,6 +163,7 @@ namespace CodeImp.DoomBuilder.Windows this.label16 = new System.Windows.Forms.Label(); this.pasteoptions = new CodeImp.DoomBuilder.Controls.PasteOptionsControl(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.color3dFloors = new CodeImp.DoomBuilder.Controls.ColorControl(); label7 = new System.Windows.Forms.Label(); label6 = new System.Windows.Forms.Label(); label5 = new System.Windows.Forms.Label(); @@ -430,7 +431,7 @@ namespace CodeImp.DoomBuilder.Windows // label1 // label1.AutoSize = true; - label1.Location = new System.Drawing.Point(28, 30); + label1.Location = new System.Drawing.Point(28, 22); label1.Name = "label1"; label1.Size = new System.Drawing.Size(147, 14); label1.TabIndex = 20; @@ -440,7 +441,7 @@ namespace CodeImp.DoomBuilder.Windows // label18 // label18.AutoSize = true; - label18.Location = new System.Drawing.Point(22, 78); + label18.Location = new System.Drawing.Point(22, 54); label18.Name = "label18"; label18.Size = new System.Drawing.Size(151, 14); label18.TabIndex = 25; @@ -450,7 +451,7 @@ namespace CodeImp.DoomBuilder.Windows // label20 // label20.AutoSize = true; - label20.Location = new System.Drawing.Point(76, 126); + label20.Location = new System.Drawing.Point(76, 86); label20.Name = "label20"; label20.Size = new System.Drawing.Size(96, 14); label20.TabIndex = 28; @@ -460,7 +461,7 @@ namespace CodeImp.DoomBuilder.Windows // label21 // label21.AutoSize = true; - label21.Location = new System.Drawing.Point(55, 174); + label21.Location = new System.Drawing.Point(55, 118); label21.Name = "label21"; label21.Size = new System.Drawing.Size(116, 14); label21.TabIndex = 31; @@ -481,23 +482,21 @@ namespace CodeImp.DoomBuilder.Windows // this.colorsgroup1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); + this.colorsgroup1.Controls.Add(this.color3dFloors); this.colorsgroup1.Controls.Add(this.label23); this.colorsgroup1.Controls.Add(this.numSectorsLabel); this.colorsgroup1.Controls.Add(this.colorNewSectors); this.colorsgroup1.Controls.Add(this.colorInfo); - this.colorsgroup1.Controls.Add(this.cbStretchModels); this.colorsgroup1.Controls.Add(this.colorMD3); - this.colorsgroup1.Controls.Add(this.label2); + this.colorsgroup1.Controls.Add(this.doublesidedalpha); this.colorsgroup1.Controls.Add(this.colorgrid64); - this.colorsgroup1.Controls.Add(this.squarethings); this.colorsgroup1.Controls.Add(this.colorgrid); - this.colorsgroup1.Controls.Add(this.doublesidedalphalabel); this.colorsgroup1.Controls.Add(this.colorindication); - this.colorsgroup1.Controls.Add(this.qualitydisplay); this.colorsgroup1.Controls.Add(this.colorbackcolor); + this.colorsgroup1.Controls.Add(this.label2); + this.colorsgroup1.Controls.Add(this.doublesidedalphalabel); this.colorsgroup1.Controls.Add(this.colorselection); this.colorsgroup1.Controls.Add(this.colorvertices); - this.colorsgroup1.Controls.Add(this.doublesidedalpha); this.colorsgroup1.Controls.Add(this.colorhighlight); this.colorsgroup1.Controls.Add(this.colorlinedefs); this.colorsgroup1.Controls.Add(this.tbNumSectors); @@ -512,7 +511,7 @@ namespace CodeImp.DoomBuilder.Windows // label23 // this.label23.AutoSize = true; - this.label23.Location = new System.Drawing.Point(14, 319); + this.label23.Location = new System.Drawing.Point(14, 344); this.label23.Name = "label23"; this.label23.Size = new System.Drawing.Size(182, 14); this.label23.TabIndex = 22; @@ -522,7 +521,7 @@ namespace CodeImp.DoomBuilder.Windows // numSectorsLabel // this.numSectorsLabel.AutoSize = true; - this.numSectorsLabel.Location = new System.Drawing.Point(148, 347); + this.numSectorsLabel.Location = new System.Drawing.Point(148, 371); this.numSectorsLabel.Name = "numSectorsLabel"; this.numSectorsLabel.Size = new System.Drawing.Size(13, 14); this.numSectorsLabel.TabIndex = 23; @@ -533,7 +532,7 @@ namespace CodeImp.DoomBuilder.Windows this.colorNewSectors.BackColor = System.Drawing.Color.Transparent; this.colorNewSectors.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.colorNewSectors.Label = "New sectors:"; - this.colorNewSectors.Location = new System.Drawing.Point(15, 287); + this.colorNewSectors.Location = new System.Drawing.Point(15, 312); this.colorNewSectors.MaximumSize = new System.Drawing.Size(10000, 23); this.colorNewSectors.MinimumSize = new System.Drawing.Size(100, 23); this.colorNewSectors.Name = "colorNewSectors"; @@ -555,7 +554,7 @@ namespace CodeImp.DoomBuilder.Windows // cbStretchModels // this.cbStretchModels.AutoSize = true; - this.cbStretchModels.Location = new System.Drawing.Point(21, 466); + this.cbStretchModels.Location = new System.Drawing.Point(236, 170); this.cbStretchModels.Name = "cbStretchModels"; this.cbStretchModels.Size = new System.Drawing.Size(167, 18); this.cbStretchModels.TabIndex = 18; @@ -579,7 +578,7 @@ namespace CodeImp.DoomBuilder.Windows // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(14, 373); + this.label2.Location = new System.Drawing.Point(14, 405); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(147, 14); this.label2.TabIndex = 14; @@ -601,7 +600,7 @@ namespace CodeImp.DoomBuilder.Windows // squarethings // this.squarethings.AutoSize = true; - this.squarethings.Location = new System.Drawing.Point(21, 445); + this.squarethings.Location = new System.Drawing.Point(25, 170); this.squarethings.Name = "squarethings"; this.squarethings.Size = new System.Drawing.Size(93, 18); this.squarethings.TabIndex = 8; @@ -623,7 +622,7 @@ namespace CodeImp.DoomBuilder.Windows // doublesidedalphalabel // this.doublesidedalphalabel.AutoSize = true; - this.doublesidedalphalabel.Location = new System.Drawing.Point(148, 401); + this.doublesidedalphalabel.Location = new System.Drawing.Point(147, 438); this.doublesidedalphalabel.Name = "doublesidedalphalabel"; this.doublesidedalphalabel.Size = new System.Drawing.Size(23, 14); this.doublesidedalphalabel.TabIndex = 16; @@ -644,7 +643,7 @@ namespace CodeImp.DoomBuilder.Windows // qualitydisplay // this.qualitydisplay.AutoSize = true; - this.qualitydisplay.Location = new System.Drawing.Point(21, 424); + this.qualitydisplay.Location = new System.Drawing.Point(25, 191); this.qualitydisplay.Name = "qualitydisplay"; this.qualitydisplay.Size = new System.Drawing.Size(130, 18); this.qualitydisplay.TabIndex = 7; @@ -690,7 +689,7 @@ namespace CodeImp.DoomBuilder.Windows // doublesidedalpha // this.doublesidedalpha.LargeChange = 3; - this.doublesidedalpha.Location = new System.Drawing.Point(11, 388); + this.doublesidedalpha.Location = new System.Drawing.Point(11, 426); this.doublesidedalpha.Name = "doublesidedalpha"; this.doublesidedalpha.Size = new System.Drawing.Size(130, 45); this.doublesidedalpha.TabIndex = 2; @@ -724,7 +723,7 @@ namespace CodeImp.DoomBuilder.Windows // tbNumSectors // this.tbNumSectors.LargeChange = 3; - this.tbNumSectors.Location = new System.Drawing.Point(11, 334); + this.tbNumSectors.Location = new System.Drawing.Point(11, 359); this.tbNumSectors.Maximum = 8; this.tbNumSectors.Name = "tbNumSectors"; this.tbNumSectors.Size = new System.Drawing.Size(130, 45); @@ -1317,8 +1316,11 @@ namespace CodeImp.DoomBuilder.Windows this.appearancegroup1.Controls.Add(this.cbOldHighlightMode); this.appearancegroup1.Controls.Add(label21); this.appearancegroup1.Controls.Add(this.labelDynLightIntensity); + this.appearancegroup1.Controls.Add(this.cbStretchModels); + this.appearancegroup1.Controls.Add(this.squarethings); this.appearancegroup1.Controls.Add(this.tbDynLightIntensity); this.appearancegroup1.Controls.Add(label20); + this.appearancegroup1.Controls.Add(this.qualitydisplay); this.appearancegroup1.Controls.Add(this.labelDynLightSize); this.appearancegroup1.Controls.Add(this.tbDynLightSize); this.appearancegroup1.Controls.Add(label18); @@ -1354,7 +1356,7 @@ namespace CodeImp.DoomBuilder.Windows // cbOldHighlightMode // this.cbOldHighlightMode.AutoSize = true; - this.cbOldHighlightMode.Location = new System.Drawing.Point(236, 254); + this.cbOldHighlightMode.Location = new System.Drawing.Point(236, 233); this.cbOldHighlightMode.Name = "cbOldHighlightMode"; this.cbOldHighlightMode.Size = new System.Drawing.Size(218, 18); this.cbOldHighlightMode.TabIndex = 33; @@ -1366,7 +1368,7 @@ namespace CodeImp.DoomBuilder.Windows // labelDynLightIntensity // this.labelDynLightIntensity.AutoSize = true; - this.labelDynLightIntensity.Location = new System.Drawing.Point(337, 174); + this.labelDynLightIntensity.Location = new System.Drawing.Point(337, 116); this.labelDynLightIntensity.Name = "labelDynLightIntensity"; this.labelDynLightIntensity.Size = new System.Drawing.Size(22, 14); this.labelDynLightIntensity.TabIndex = 32; @@ -1375,19 +1377,19 @@ namespace CodeImp.DoomBuilder.Windows // tbDynLightIntensity // this.tbDynLightIntensity.LargeChange = 1; - this.tbDynLightIntensity.Location = new System.Drawing.Point(176, 161); + this.tbDynLightIntensity.Location = new System.Drawing.Point(176, 106); this.tbDynLightIntensity.Minimum = 1; this.tbDynLightIntensity.Name = "tbDynLightIntensity"; this.tbDynLightIntensity.Size = new System.Drawing.Size(154, 45); this.tbDynLightIntensity.TabIndex = 30; - this.tbDynLightIntensity.TickStyle = System.Windows.Forms.TickStyle.Both; + this.tbDynLightIntensity.TickStyle = System.Windows.Forms.TickStyle.TopLeft; this.tbDynLightIntensity.Value = 10; this.tbDynLightIntensity.ValueChanged += new System.EventHandler(this.tbDynLightIntensity_ValueChanged); // // labelDynLightSize // this.labelDynLightSize.AutoSize = true; - this.labelDynLightSize.Location = new System.Drawing.Point(337, 126); + this.labelDynLightSize.Location = new System.Drawing.Point(337, 85); this.labelDynLightSize.Name = "labelDynLightSize"; this.labelDynLightSize.Size = new System.Drawing.Size(22, 14); this.labelDynLightSize.TabIndex = 29; @@ -1396,20 +1398,20 @@ namespace CodeImp.DoomBuilder.Windows // tbDynLightSize // this.tbDynLightSize.LargeChange = 1; - this.tbDynLightSize.Location = new System.Drawing.Point(176, 113); + this.tbDynLightSize.Location = new System.Drawing.Point(176, 74); this.tbDynLightSize.Maximum = 20; this.tbDynLightSize.Minimum = 1; this.tbDynLightSize.Name = "tbDynLightSize"; this.tbDynLightSize.Size = new System.Drawing.Size(154, 45); this.tbDynLightSize.TabIndex = 27; - this.tbDynLightSize.TickStyle = System.Windows.Forms.TickStyle.Both; + this.tbDynLightSize.TickStyle = System.Windows.Forms.TickStyle.TopLeft; this.tbDynLightSize.Value = 10; this.tbDynLightSize.ValueChanged += new System.EventHandler(this.tbDynLightSize_ValueChanged); // // labelDynLightCount // this.labelDynLightCount.AutoSize = true; - this.labelDynLightCount.Location = new System.Drawing.Point(337, 78); + this.labelDynLightCount.Location = new System.Drawing.Point(337, 53); this.labelDynLightCount.Name = "labelDynLightCount"; this.labelDynLightCount.Size = new System.Drawing.Size(19, 14); this.labelDynLightCount.TabIndex = 26; @@ -1418,21 +1420,21 @@ namespace CodeImp.DoomBuilder.Windows // tbDynLightCount // this.tbDynLightCount.LargeChange = 3; - this.tbDynLightCount.Location = new System.Drawing.Point(176, 65); + this.tbDynLightCount.Location = new System.Drawing.Point(176, 42); this.tbDynLightCount.Maximum = 32; this.tbDynLightCount.Minimum = 1; this.tbDynLightCount.Name = "tbDynLightCount"; this.tbDynLightCount.Size = new System.Drawing.Size(154, 45); this.tbDynLightCount.TabIndex = 24; this.tbDynLightCount.TickFrequency = 4; - this.tbDynLightCount.TickStyle = System.Windows.Forms.TickStyle.Both; + this.tbDynLightCount.TickStyle = System.Windows.Forms.TickStyle.TopLeft; this.tbDynLightCount.Value = 1; this.tbDynLightCount.ValueChanged += new System.EventHandler(this.tbDynLightCount_ValueChanged); // // animatevisualselection // this.animatevisualselection.AutoSize = true; - this.animatevisualselection.Location = new System.Drawing.Point(236, 233); + this.animatevisualselection.Location = new System.Drawing.Point(236, 212); this.animatevisualselection.Name = "animatevisualselection"; this.animatevisualselection.Size = new System.Drawing.Size(188, 18); this.animatevisualselection.TabIndex = 23; @@ -1442,7 +1444,7 @@ namespace CodeImp.DoomBuilder.Windows // blackbrowsers // this.blackbrowsers.AutoSize = true; - this.blackbrowsers.Location = new System.Drawing.Point(236, 212); + this.blackbrowsers.Location = new System.Drawing.Point(236, 191); this.blackbrowsers.Name = "blackbrowsers"; this.blackbrowsers.Size = new System.Drawing.Size(199, 18); this.blackbrowsers.TabIndex = 4; @@ -1472,7 +1474,7 @@ namespace CodeImp.DoomBuilder.Windows // imagebrightnesslabel // this.imagebrightnesslabel.AutoSize = true; - this.imagebrightnesslabel.Location = new System.Drawing.Point(337, 30); + this.imagebrightnesslabel.Location = new System.Drawing.Point(337, 22); this.imagebrightnesslabel.Name = "imagebrightnesslabel"; this.imagebrightnesslabel.Size = new System.Drawing.Size(31, 14); this.imagebrightnesslabel.TabIndex = 22; @@ -1481,11 +1483,11 @@ namespace CodeImp.DoomBuilder.Windows // imagebrightness // this.imagebrightness.LargeChange = 3; - this.imagebrightness.Location = new System.Drawing.Point(176, 17); + this.imagebrightness.Location = new System.Drawing.Point(176, 11); this.imagebrightness.Name = "imagebrightness"; this.imagebrightness.Size = new System.Drawing.Size(154, 45); this.imagebrightness.TabIndex = 3; - this.imagebrightness.TickStyle = System.Windows.Forms.TickStyle.Both; + this.imagebrightness.TickStyle = System.Windows.Forms.TickStyle.TopLeft; this.imagebrightness.ValueChanged += new System.EventHandler(this.imagebrightness_ValueChanged); // // colorsgroup3 @@ -1752,6 +1754,18 @@ namespace CodeImp.DoomBuilder.Windows this.pasteoptions.Size = new System.Drawing.Size(666, 427); this.pasteoptions.TabIndex = 0; // + // color3dFloors + // + this.color3dFloors.BackColor = System.Drawing.Color.Transparent; + this.color3dFloors.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.color3dFloors.Label = "3D Floors:"; + this.color3dFloors.Location = new System.Drawing.Point(15, 286); + this.color3dFloors.MaximumSize = new System.Drawing.Size(10000, 23); + this.color3dFloors.MinimumSize = new System.Drawing.Size(100, 23); + this.color3dFloors.Name = "color3dFloors"; + this.color3dFloors.Size = new System.Drawing.Size(168, 23); + this.color3dFloors.TabIndex = 24; + // // PreferencesForm // this.AcceptButton = this.apply; @@ -1941,5 +1955,6 @@ namespace CodeImp.DoomBuilder.Windows private System.Windows.Forms.Button bClearActionFilter; private System.Windows.Forms.TextBox tbFilterActions; private System.Windows.Forms.Label label24; + private CodeImp.DoomBuilder.Controls.ColorControl color3dFloors; } } \ No newline at end of file diff --git a/Source/Core/Windows/PreferencesForm.cs b/Source/Core/Windows/PreferencesForm.cs index c6005bdf..b264d9d1 100644 --- a/Source/Core/Windows/PreferencesForm.cs +++ b/Source/Core/Windows/PreferencesForm.cs @@ -168,6 +168,7 @@ namespace CodeImp.DoomBuilder.Windows colorMD3.Color = General.Colors.ModelWireframe; colorInfo.Color = General.Colors.InfoLine; colorNewSectors.Color = General.Colors.NewSector; + color3dFloors.Color = General.Colors.ThreeDFloor; colorscriptbackground.Color = General.Colors.ScriptBackground; colorlinenumbers.Color = General.Colors.LineNumbers; @@ -275,6 +276,7 @@ namespace CodeImp.DoomBuilder.Windows General.Colors.ModelWireframe = colorMD3.Color; General.Colors.InfoLine = colorInfo.Color; General.Colors.NewSector = colorNewSectors.Color; + General.Colors.ThreeDFloor = color3dFloors.Color; General.Colors.CreateAssistColors(); General.Settings.BlackBrowsers = blackbrowsers.Checked; diff --git a/Source/Core/Windows/PreferencesForm.resx b/Source/Core/Windows/PreferencesForm.resx index 983bf1dc..d68fbbd5 100644 --- a/Source/Core/Windows/PreferencesForm.resx +++ b/Source/Core/Windows/PreferencesForm.resx @@ -144,7 +144,4 @@ False - - 17, 17 - \ No newline at end of file diff --git a/Source/Plugins/BuilderModes/ClassicModes/BaseClassicMode.cs b/Source/Plugins/BuilderModes/ClassicModes/BaseClassicMode.cs index f0311333..5b96aec5 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/BaseClassicMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/BaseClassicMode.cs @@ -99,6 +99,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { General.Map.Map.ClearAllSelected(); General.Map.Map.SelectMarkedGeometry(true, true); + General.Map.Renderer2D.Update3dFloorTagsList(); //mxd // Switch to EditSelectionMode EditSelectionMode editmode = new EditSelectionMode(); diff --git a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs index 4839b033..e8f0e94f 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/LinedefsMode.cs @@ -405,6 +405,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(selected.Count == 1) General.Map.Map.ClearSelectedLinedefs(); // Update entire display + General.Map.Renderer2D.Update3dFloorTagsList(); //mxd General.Interface.RedrawDisplay(); } } @@ -809,6 +810,7 @@ namespace CodeImp.DoomBuilder.BuilderModes OnMouseMove(e); // Redraw screen + General.Map.Renderer2D.Update3dFloorTagsList(); //mxd General.Interface.RedrawDisplay(); } } diff --git a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs index 1316dcda..8d8e4780 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs @@ -632,6 +632,7 @@ namespace CodeImp.DoomBuilder.BuilderModes } // Update entire display + General.Map.Renderer2D.Update3dFloorTagsList(); //mxd General.Interface.RedrawDisplay(); } } @@ -1344,6 +1345,7 @@ namespace CodeImp.DoomBuilder.BuilderModes UpdateSelectedLabels(); // Redraw screen + General.Map.Renderer2D.Update3dFloorTagsList(); //mxd General.Interface.RedrawDisplay(); } } diff --git a/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs b/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs index f95e3303..9d6958e6 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs @@ -198,15 +198,21 @@ namespace CodeImp.DoomBuilder.BuilderModes // Update display if(renderer.StartPlotter(false)) { // Undraw previous highlight - if((highlightedLine != null) && !highlightedLine.IsDisposed) + if((highlightedLine != null) && !highlightedLine.IsDisposed) { renderer.PlotLinedef(highlightedLine, renderer.DetermineLinedefColor(highlightedLine)); + renderer.PlotVertex(highlightedLine.Start, renderer.DetermineVertexColor(highlightedLine.Start)); + renderer.PlotVertex(highlightedLine.End, renderer.DetermineVertexColor(highlightedLine.End)); + } // Set new highlight highlightedLine = l; // Render highlighted item - if((highlightedLine != null) && !highlightedLine.IsDisposed) + if((highlightedLine != null) && !highlightedLine.IsDisposed) { renderer.PlotLinedef(highlightedLine, General.Colors.InfoLine); + renderer.PlotVertex(highlightedLine.Start, renderer.DetermineVertexColor(highlightedLine.Start)); + renderer.PlotVertex(highlightedLine.End, renderer.DetermineVertexColor(highlightedLine.End)); + } // Done renderer.Finish(); @@ -390,6 +396,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(selected.Count == 1) General.Map.Map.ClearSelectedVertices(); // Update entire display + General.Map.Renderer2D.Update3dFloorTagsList(); //mxd General.Interface.RedrawDisplay(); } } @@ -1019,6 +1026,7 @@ namespace CodeImp.DoomBuilder.BuilderModes OnMouseMove(e); // Redraw screen + General.Map.Renderer2D.Update3dFloorTagsList(); //mxd General.Interface.RedrawDisplay(); } } diff --git a/Source/Plugins/BuilderModes/General/BuilderPlug.cs b/Source/Plugins/BuilderModes/General/BuilderPlug.cs index 8f963c7d..6f6298c0 100644 --- a/Source/Plugins/BuilderModes/General/BuilderPlug.cs +++ b/Source/Plugins/BuilderModes/General/BuilderPlug.cs @@ -466,6 +466,8 @@ namespace CodeImp.DoomBuilder.BuilderModes drawCurveModeMenuItem.Enabled = true; drawRectModeMenuItem.Enabled = true; drawEllipseModeMenuItem.Enabled = true; + + General.Map.Renderer2D.Update3dFloorTagsList(); //mxd } // Map closed diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index 85b03ef5..b9c94b0e 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -822,7 +822,8 @@ namespace CodeImp.DoomBuilder.BuilderModes // ========== Sector 3D floor (see http://zdoom.org/wiki/Sector_Set3dFloor) ========== else if((l.Action == 160) && (l.Front != null)) { - int sectortag = l.Args[0] + (l.Args[4] << 8); + //mxd. Added hi-tag/line ID check + int sectortag = (l.Args[1] & (int)Effect3DFloor.FloorTypes.HiTagIsLineID) != 0 ? l.Args[0] : l.Args[0] + (l.Args[4] << 8); if(sectortags.ContainsKey(sectortag)) { List sectors = sectortags[sectortag]; diff --git a/Source/Plugins/BuilderModes/VisualModes/Effect3DFloor.cs b/Source/Plugins/BuilderModes/VisualModes/Effect3DFloor.cs index 2e7b765a..da0dc70f 100644 --- a/Source/Plugins/BuilderModes/VisualModes/Effect3DFloor.cs +++ b/Source/Plugins/BuilderModes/VisualModes/Effect3DFloor.cs @@ -62,6 +62,7 @@ namespace CodeImp.DoomBuilder.BuilderModes Swimmable = 2, NonSolid = 3, RenderInside = 4, + HiTagIsLineID = 8, InvertVisibilityRules = 16, InvertShootabilityRules = 32 }