From a7d2417844d47cf09b4fb26369cfa6a64bd9c861 Mon Sep 17 00:00:00 2001 From: MaxED <j.maxed@gmail.com> Date: Wed, 4 Jan 2017 16:28:36 +0300 Subject: [PATCH] Visual mode, UDMF: added rendering support for fogdensity and floor/ceiling glow properties. Internal, build tools: use origin/master to get commits count and current hash instead of local master. --- Source/Core/Controls/AngleControlEx.cs | 9 +- Source/Core/Data/ImageData.cs | 144 ++++++++++-------- Source/Core/GZBuilder/Data/GlowingFlatData.cs | 2 +- Source/Core/VisualModes/VisualGeometry.cs | 16 +- .../Core/Windows/LinedefEditForm.Designer.cs | 18 ++- .../Windows/LinedefEditFormUDMF.Designer.cs | 72 ++++----- Source/Core/Windows/LinedefEditFormUDMF.cs | 1 + .../Core/Windows/SectorEditForm.Designer.cs | 11 +- .../Windows/SectorEditFormUDMF.Designer.cs | 80 +++++++--- Source/Core/Windows/SectorEditFormUDMF.cs | 49 +++++- Source/Core/Windows/SectorEditFormUDMF.resx | 3 +- Source/Core/Windows/ThingEditForm.Designer.cs | 12 +- .../Core/Windows/VertexEditForm.Designer.cs | 16 +- .../VisualModes/BaseVisualThing.cs | 4 +- .../VisualModes/EffectGlowingFlat.cs | 50 ++++-- Source/Tools/VersionFromSVN/Program.cs | 2 +- VersionFromGIT.exe | Bin 10240 -> 10752 bytes 17 files changed, 308 insertions(+), 181 deletions(-) diff --git a/Source/Core/Controls/AngleControlEx.cs b/Source/Core/Controls/AngleControlEx.cs index 3cb9889fc..7ab1db67c 100644 --- a/Source/Core/Controls/AngleControlEx.cs +++ b/Source/Core/Controls/AngleControlEx.cs @@ -5,6 +5,7 @@ //The Code Project - http://www.codeproject.com using System; +using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; @@ -44,7 +45,13 @@ namespace CodeImp.DoomBuilder.Controls public event EventHandler AngleChanged; - public int Angle { get { return (angle == NO_ANGLE ? NO_ANGLE : angle - angleoffset); } set { angle = (value == NO_ANGLE ? NO_ANGLE : value + angleoffset); this.Refresh(); } } + public int Angle { get { return (angle == NO_ANGLE ? NO_ANGLE : angle - angleoffset); } set { + if(LicenseManager.UsageMode != LicenseUsageMode.Designtime) + { + angle = (value == NO_ANGLE ? NO_ANGLE : value + angleoffset); + this.Refresh(); + } + } } public int AngleOffset { get { return angleoffset; } set { angleoffset = value; this.Refresh(); } } public bool DoomAngleClamping { get { return doomangleclamping; } set { doomangleclamping = value; } } public const int NO_ANGLE = int.MinValue; diff --git a/Source/Core/Data/ImageData.cs b/Source/Core/Data/ImageData.cs index 41dd4d944..eecf23edc 100644 --- a/Source/Core/Data/ImageData.cs +++ b/Source/Core/Data/ImageData.cs @@ -339,84 +339,98 @@ namespace CodeImp.DoomBuilder.Data } } - //mxd. Calculate average color? - if(General.Map != null && General.Map.Data != null && General.Map.Data.GlowingFlats != null && - General.Map.Data.GlowingFlats.ContainsKey(longname) && - General.Map.Data.GlowingFlats[longname].CalculateTextureColor) + if(!loadfailed) { - BitmapData bmpdata = null; - try { bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); } - catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for glow color calculation. " + e.GetType().Name + ": " + e.Message); } - - if(bmpdata != null) + //mxd. Check translucency and calculate average color? + if(General.Map != null && General.Map.Data != null && General.Map.Data.GlowingFlats != null && + General.Map.Data.GlowingFlats.ContainsKey(longname) && + General.Map.Data.GlowingFlats[longname].CalculateTextureColor) { - PixelColor* pixels = (PixelColor*) (bmpdata.Scan0.ToPointer()); - int numpixels = bmpdata.Width * bmpdata.Height; - uint r = 0; - uint g = 0; - uint b = 0; - - for(PixelColor* cp = pixels + numpixels - 1; cp >= pixels; cp--) + BitmapData bmpdata = null; + try { - r += cp->r; - g += cp->g; - b += cp->b; - - // Also check alpha - if(cp->a > 0 && cp->a < 255) istranslucent = true; - else if(cp->a == 0) ismasked = true; + bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); } - - // Update glow data - int br = (int)(r / numpixels); - int bg = (int)(g / numpixels); - int bb = (int)(b / numpixels); - - int max = Math.Max(br, Math.Max(bg, bb)); - - // Black can't glow... - if(max == 0) + catch(Exception e) { - General.Map.Data.GlowingFlats.Remove(longname); + General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for glow color calculation. " + e.GetType().Name + ": " + e.Message); } - else + + if(bmpdata != null) { - // That's how it's done in GZDoom (and I may be totally wrong about this) - br = Math.Min(255, br * 153 / max); - bg = Math.Min(255, bg * 153 / max); - bb = Math.Min(255, bb * 153 / max); - - General.Map.Data.GlowingFlats[longname].Color = new PixelColor(255, (byte)br, (byte)bg, (byte)bb); - General.Map.Data.GlowingFlats[longname].CalculateTextureColor = false; - if(!General.Map.Data.GlowingFlats[longname].Fullbright) - General.Map.Data.GlowingFlats[longname].Brightness = (br + bg + bb) / 3; + PixelColor* pixels = (PixelColor*)(bmpdata.Scan0.ToPointer()); + int numpixels = bmpdata.Width * bmpdata.Height; + uint r = 0; + uint g = 0; + uint b = 0; + + for(PixelColor* cp = pixels + numpixels - 1; cp >= pixels; cp--) + { + r += cp->r; + g += cp->g; + b += cp->b; + + // Also check alpha + if(cp->a > 0 && cp->a < 255) istranslucent = true; + else if(cp->a == 0) ismasked = true; + } + + // Update glow data + int br = (int)(r / numpixels); + int bg = (int)(g / numpixels); + int bb = (int)(b / numpixels); + + int max = Math.Max(br, Math.Max(bg, bb)); + + // Black can't glow... + if(max == 0) + { + General.Map.Data.GlowingFlats.Remove(longname); + } + else + { + // That's how it's done in GZDoom (and I may be totally wrong about this) + br = Math.Min(255, br * 153 / max); + bg = Math.Min(255, bg * 153 / max); + bb = Math.Min(255, bb * 153 / max); + + General.Map.Data.GlowingFlats[longname].Color = new PixelColor(255, (byte)br, (byte)bg, (byte)bb); + General.Map.Data.GlowingFlats[longname].CalculateTextureColor = false; + if(!General.Map.Data.GlowingFlats[longname].Fullbright) General.Map.Data.GlowingFlats[longname].Brightness = (br + bg + bb) / 3; + } + + // Release the data + bitmap.UnlockBits(bmpdata); } - - // Release the data - bitmap.UnlockBits(bmpdata); } - } - //mxd. Check if the texture is translucent - else if(!loadfailed) - { - BitmapData bmpdata = null; - try { bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); } - catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for translucency check. " + e.GetType().Name + ": " + e.Message); } - - if(bmpdata != null) + //mxd. Check if the texture is translucent + else { - PixelColor* pixels = (PixelColor*)(bmpdata.Scan0.ToPointer()); - int numpixels = bmpdata.Width * bmpdata.Height; - - for(PixelColor* cp = pixels + numpixels - 1; cp >= pixels; cp--) + BitmapData bmpdata = null; + try { - // Check alpha - if(cp->a > 0 && cp->a < 255) istranslucent = true; - else if(cp->a == 0) ismasked = true; + bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); + } + catch(Exception e) + { + General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image \"" + this.filepathname + "\" for translucency check. " + e.GetType().Name + ": " + e.Message); } - // Release the data - bitmap.UnlockBits(bmpdata); + if(bmpdata != null) + { + PixelColor* pixels = (PixelColor*)(bmpdata.Scan0.ToPointer()); + int numpixels = bmpdata.Width * bmpdata.Height; + + for(PixelColor* cp = pixels + numpixels - 1; cp >= pixels; cp--) + { + // Check alpha + if(cp->a > 0 && cp->a < 255) istranslucent = true; + else if(cp->a == 0) ismasked = true; + } + + // Release the data + bitmap.UnlockBits(bmpdata); + } } } } diff --git a/Source/Core/GZBuilder/Data/GlowingFlatData.cs b/Source/Core/GZBuilder/Data/GlowingFlatData.cs index 4ad2538bd..79a16505f 100644 --- a/Source/Core/GZBuilder/Data/GlowingFlatData.cs +++ b/Source/Core/GZBuilder/Data/GlowingFlatData.cs @@ -5,7 +5,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data public class GlowingFlatData { public PixelColor Color; - public int Height; + public float Height; public int Brightness = 255; public bool Fullbright; public bool CalculateTextureColor; diff --git a/Source/Core/VisualModes/VisualGeometry.cs b/Source/Core/VisualModes/VisualGeometry.cs index baf5127e9..e83482d44 100644 --- a/Source/Core/VisualModes/VisualGeometry.cs +++ b/Source/Core/VisualModes/VisualGeometry.cs @@ -203,22 +203,26 @@ namespace CodeImp.DoomBuilder.VisualModes //TODO: this doesn't match any GZDoom light mode... //GZDoom: gl_renderstate.h, SetFog(); //GZDoom: gl_lightlevel.cpp gl_SetFog(); - protected float CalculateFogFactor(int brightness) { return CalculateFogFactor(Sector.Sector.FogMode, brightness); } - public static float CalculateFogFactor(SectorFogMode mode, int brightness) + protected float CalculateFogFactor(int brightness) { return CalculateFogFactor(Sector.Sector, brightness); } + public static float CalculateFogFactor(Sector sector, int brightness) { float density; - switch(mode) + int fogdensity = (General.Map.UDMF ? General.Clamp(sector.Fields.GetValue("fogdensity", 0), 0, 510) : 0); + switch(sector.FogMode) { case SectorFogMode.OUTSIDEFOGDENSITY: - density = General.Map.Data.MapInfo.OutsideFogDensity * FADE_MULTIPLIER; + if(fogdensity < 3) fogdensity = General.Map.Data.MapInfo.OutsideFogDensity; + density = fogdensity * FADE_MULTIPLIER; break; case SectorFogMode.FOGDENSITY: - density = General.Map.Data.MapInfo.FogDensity * FADE_MULTIPLIER; + if(fogdensity < 3) fogdensity = General.Map.Data.MapInfo.FogDensity; + density = fogdensity * FADE_MULTIPLIER; break; case SectorFogMode.FADE: - density = General.Clamp(255 - brightness, 30, 255) * FADE_MULTIPLIER; + if(fogdensity < 3) fogdensity = General.Clamp(255 - brightness, 30, 255); + density = fogdensity * FADE_MULTIPLIER; break; case SectorFogMode.CLASSIC: diff --git a/Source/Core/Windows/LinedefEditForm.Designer.cs b/Source/Core/Windows/LinedefEditForm.Designer.cs index aa9ef86e9..72928a235 100644 --- a/Source/Core/Windows/LinedefEditForm.Designer.cs +++ b/Source/Core/Windows/LinedefEditForm.Designer.cs @@ -164,7 +164,7 @@ namespace CodeImp.DoomBuilder.Windows label11.Name = "label11"; label11.Size = new System.Drawing.Size(80, 14); label11.TabIndex = 13; - label11.Text = "Sector Index:"; + label11.Text = "Sector index:"; label11.TextAlign = System.Drawing.ContentAlignment.TopRight; // // label12 @@ -173,7 +173,7 @@ namespace CodeImp.DoomBuilder.Windows label12.Name = "label12"; label12.Size = new System.Drawing.Size(80, 14); label12.TabIndex = 16; - label12.Text = "Sector Index:"; + label12.Text = "Sector index:"; label12.TextAlign = System.Drawing.ContentAlignment.TopRight; // // activationlabel @@ -191,7 +191,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelFrontTextureOffset.Name = "labelFrontTextureOffset"; this.labelFrontTextureOffset.Size = new System.Drawing.Size(80, 14); this.labelFrontTextureOffset.TabIndex = 42; - this.labelFrontTextureOffset.Text = "Texture Offset:"; + this.labelFrontTextureOffset.Text = "Texture offset:"; this.labelFrontTextureOffset.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelBackTextureOffset @@ -200,7 +200,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelBackTextureOffset.Name = "labelBackTextureOffset"; this.labelBackTextureOffset.Size = new System.Drawing.Size(80, 14); this.labelBackTextureOffset.TabIndex = 43; - this.labelBackTextureOffset.Text = "Texture Offset:"; + this.labelBackTextureOffset.Text = "Texture offset:"; this.labelBackTextureOffset.TextAlign = System.Drawing.ContentAlignment.TopRight; // // cancel @@ -353,9 +353,9 @@ namespace CodeImp.DoomBuilder.Windows this.frontside.AutoSize = true; this.frontside.Location = new System.Drawing.Point(17, 4); this.frontside.Name = "frontside"; - this.frontside.Size = new System.Drawing.Size(74, 17); + this.frontside.Size = new System.Drawing.Size(72, 17); this.frontside.TabIndex = 0; - this.frontside.Text = "Front Side"; + this.frontside.Text = "Front side"; this.frontside.UseVisualStyleBackColor = true; this.frontside.CheckStateChanged += new System.EventHandler(this.frontside_CheckStateChanged); // @@ -384,6 +384,7 @@ namespace CodeImp.DoomBuilder.Windows // frontsector // this.frontsector.AllowDecimal = false; + this.frontsector.AllowExpressions = false; this.frontsector.AllowNegative = false; this.frontsector.AllowRelative = false; this.frontsector.ButtonStep = 1; @@ -449,9 +450,9 @@ namespace CodeImp.DoomBuilder.Windows this.backside.AutoSize = true; this.backside.Location = new System.Drawing.Point(17, 158); this.backside.Name = "backside"; - this.backside.Size = new System.Drawing.Size(75, 17); + this.backside.Size = new System.Drawing.Size(73, 17); this.backside.TabIndex = 0; - this.backside.Text = "Back Side"; + this.backside.Text = "Back side"; this.backside.UseVisualStyleBackColor = true; this.backside.CheckStateChanged += new System.EventHandler(this.backside_CheckStateChanged); // @@ -480,6 +481,7 @@ namespace CodeImp.DoomBuilder.Windows // backsector // this.backsector.AllowDecimal = false; + this.backsector.AllowExpressions = false; this.backsector.AllowNegative = false; this.backsector.AllowRelative = false; this.backsector.ButtonStep = 1; diff --git a/Source/Core/Windows/LinedefEditFormUDMF.Designer.cs b/Source/Core/Windows/LinedefEditFormUDMF.Designer.cs index f86c818fd..ae982f21e 100644 --- a/Source/Core/Windows/LinedefEditFormUDMF.Designer.cs +++ b/Source/Core/Windows/LinedefEditFormUDMF.Designer.cs @@ -50,6 +50,7 @@ namespace CodeImp.DoomBuilder.Windows this.tabs = new System.Windows.Forms.TabControl(); this.tabproperties = new System.Windows.Forms.TabPage(); this.groupsettings = new System.Windows.Forms.GroupBox(); + this.resetalpha = new System.Windows.Forms.Button(); this.lockpick = new System.Windows.Forms.ComboBox(); this.alpha = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); this.renderStyle = new System.Windows.Forms.ComboBox(); @@ -124,7 +125,6 @@ namespace CodeImp.DoomBuilder.Windows this.fieldslist = new CodeImp.DoomBuilder.Controls.FieldsEditorControl(); this.imagelist = new System.Windows.Forms.ImageList(this.components); this.tooltip = new System.Windows.Forms.ToolTip(this.components); - this.resetalpha = new System.Windows.Forms.Button(); label2 = new System.Windows.Forms.Label(); label11 = new System.Windows.Forms.Label(); label12 = new System.Windows.Forms.Label(); @@ -168,7 +168,7 @@ namespace CodeImp.DoomBuilder.Windows label11.Name = "label11"; label11.Size = new System.Drawing.Size(80, 14); label11.TabIndex = 13; - label11.Text = "Sector Index:"; + label11.Text = "Sector index:"; label11.TextAlign = System.Drawing.ContentAlignment.TopRight; // // label12 @@ -177,7 +177,7 @@ namespace CodeImp.DoomBuilder.Windows label12.Name = "label12"; label12.Size = new System.Drawing.Size(80, 14); label12.TabIndex = 16; - label12.Text = "Sector Index:"; + label12.Text = "Sector index:"; label12.TextAlign = System.Drawing.ContentAlignment.TopRight; // // label6 @@ -389,6 +389,17 @@ namespace CodeImp.DoomBuilder.Windows this.groupsettings.TabStop = false; this.groupsettings.Text = " Settings"; // + // resetalpha + // + this.resetalpha.Image = global::CodeImp.DoomBuilder.Properties.Resources.Reset; + this.resetalpha.Location = new System.Drawing.Point(301, 16); + this.resetalpha.Name = "resetalpha"; + this.resetalpha.Size = new System.Drawing.Size(23, 23); + this.resetalpha.TabIndex = 70; + this.tooltip.SetToolTip(this.resetalpha, "Reset"); + this.resetalpha.UseVisualStyleBackColor = true; + this.resetalpha.Click += new System.EventHandler(this.resetalpha_Click); + // // lockpick // this.lockpick.FormattingEnabled = true; @@ -488,9 +499,9 @@ namespace CodeImp.DoomBuilder.Windows this.frontside.AutoSize = true; this.frontside.Location = new System.Drawing.Point(20, 6); this.frontside.Name = "frontside"; - this.frontside.Size = new System.Drawing.Size(74, 17); + this.frontside.Size = new System.Drawing.Size(72, 17); this.frontside.TabIndex = 0; - this.frontside.Text = "Front Side"; + this.frontside.Text = "Front side"; this.frontside.UseVisualStyleBackColor = true; this.frontside.CheckStateChanged += new System.EventHandler(this.frontside_CheckStateChanged); // @@ -551,7 +562,7 @@ namespace CodeImp.DoomBuilder.Windows this.frontscalegroup.Size = new System.Drawing.Size(290, 112); this.frontscalegroup.TabIndex = 44; this.frontscalegroup.TabStop = false; - this.frontscalegroup.Text = " Texture Scale "; + this.frontscalegroup.Text = " Texture scale "; // // labelFrontScaleBottom // @@ -560,7 +571,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelFrontScaleBottom.Size = new System.Drawing.Size(80, 14); this.labelFrontScaleBottom.TabIndex = 42; this.labelFrontScaleBottom.Tag = ""; - this.labelFrontScaleBottom.Text = "Lower Scale:"; + this.labelFrontScaleBottom.Text = "Lower scale:"; this.labelFrontScaleBottom.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelFrontScaleMid @@ -570,7 +581,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelFrontScaleMid.Size = new System.Drawing.Size(80, 14); this.labelFrontScaleMid.TabIndex = 41; this.labelFrontScaleMid.Tag = ""; - this.labelFrontScaleMid.Text = "Middle Scale:"; + this.labelFrontScaleMid.Text = "Middle scale:"; this.labelFrontScaleMid.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelFrontScaleTop @@ -580,7 +591,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelFrontScaleTop.Size = new System.Drawing.Size(80, 14); this.labelFrontScaleTop.TabIndex = 28; this.labelFrontScaleTop.Tag = ""; - this.labelFrontScaleTop.Text = "Upper Scale:"; + this.labelFrontScaleTop.Text = "Upper scale:"; this.labelFrontScaleTop.TextAlign = System.Drawing.ContentAlignment.TopRight; // // pfcFrontScaleTop @@ -655,7 +666,7 @@ namespace CodeImp.DoomBuilder.Windows this.groupBox6.Size = new System.Drawing.Size(290, 143); this.groupBox6.TabIndex = 43; this.groupBox6.TabStop = false; - this.groupBox6.Text = " Texture Offsets "; + this.groupBox6.Text = " Texture offsets "; // // labelFrontTextureOffset // @@ -664,7 +675,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelFrontTextureOffset.Size = new System.Drawing.Size(80, 14); this.labelFrontTextureOffset.TabIndex = 46; this.labelFrontTextureOffset.Tag = ""; - this.labelFrontTextureOffset.Text = "Sidedef Offset:"; + this.labelFrontTextureOffset.Text = "Sidedef offset:"; this.labelFrontTextureOffset.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelFrontOffsetBottom @@ -674,7 +685,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelFrontOffsetBottom.Size = new System.Drawing.Size(80, 14); this.labelFrontOffsetBottom.TabIndex = 45; this.labelFrontOffsetBottom.Tag = ""; - this.labelFrontOffsetBottom.Text = "Lower Offset:"; + this.labelFrontOffsetBottom.Text = "Lower offset:"; this.labelFrontOffsetBottom.TextAlign = System.Drawing.ContentAlignment.TopRight; // // frontTextureOffset @@ -697,7 +708,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelFrontOffsetMid.Size = new System.Drawing.Size(80, 14); this.labelFrontOffsetMid.TabIndex = 44; this.labelFrontOffsetMid.Tag = ""; - this.labelFrontOffsetMid.Text = "Middle Offset:"; + this.labelFrontOffsetMid.Text = "Middle offset:"; this.labelFrontOffsetMid.TextAlign = System.Drawing.ContentAlignment.TopRight; // // pfcFrontOffsetTop @@ -726,7 +737,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelFrontOffsetTop.Size = new System.Drawing.Size(80, 14); this.labelFrontOffsetTop.TabIndex = 43; this.labelFrontOffsetTop.Tag = ""; - this.labelFrontOffsetTop.Text = "Upper Offset:"; + this.labelFrontOffsetTop.Text = "Upper offset:"; this.labelFrontOffsetTop.TextAlign = System.Drawing.ContentAlignment.TopRight; // // pfcFrontOffsetMid @@ -905,9 +916,9 @@ namespace CodeImp.DoomBuilder.Windows this.backside.AutoSize = true; this.backside.Location = new System.Drawing.Point(20, 6); this.backside.Name = "backside"; - this.backside.Size = new System.Drawing.Size(75, 17); + this.backside.Size = new System.Drawing.Size(73, 17); this.backside.TabIndex = 0; - this.backside.Text = "Back Side"; + this.backside.Text = "Back side"; this.backside.UseVisualStyleBackColor = true; this.backside.CheckStateChanged += new System.EventHandler(this.backside_CheckStateChanged); // @@ -1064,7 +1075,7 @@ namespace CodeImp.DoomBuilder.Windows this.backscalegroup.Size = new System.Drawing.Size(290, 112); this.backscalegroup.TabIndex = 44; this.backscalegroup.TabStop = false; - this.backscalegroup.Text = " Texture Scale"; + this.backscalegroup.Text = " Texture scale"; // // labelBackScaleBottom // @@ -1073,7 +1084,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelBackScaleBottom.Size = new System.Drawing.Size(80, 14); this.labelBackScaleBottom.TabIndex = 45; this.labelBackScaleBottom.Tag = ""; - this.labelBackScaleBottom.Text = "Lower Scale:"; + this.labelBackScaleBottom.Text = "Lower scale:"; this.labelBackScaleBottom.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelBackScaleMid @@ -1083,7 +1094,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelBackScaleMid.Size = new System.Drawing.Size(80, 14); this.labelBackScaleMid.TabIndex = 44; this.labelBackScaleMid.Tag = ""; - this.labelBackScaleMid.Text = "Middle Scale:"; + this.labelBackScaleMid.Text = "Middle scale:"; this.labelBackScaleMid.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelBackScaleTop @@ -1093,7 +1104,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelBackScaleTop.Size = new System.Drawing.Size(80, 14); this.labelBackScaleTop.TabIndex = 43; this.labelBackScaleTop.Tag = ""; - this.labelBackScaleTop.Text = "Upper Scale:"; + this.labelBackScaleTop.Text = "Upper scale:"; this.labelBackScaleTop.TextAlign = System.Drawing.ContentAlignment.TopRight; // // pfcBackScaleTop @@ -1168,7 +1179,7 @@ namespace CodeImp.DoomBuilder.Windows this.groupBox1.Size = new System.Drawing.Size(290, 143); this.groupBox1.TabIndex = 43; this.groupBox1.TabStop = false; - this.groupBox1.Text = " Texture Offsets "; + this.groupBox1.Text = " Texture offsets "; // // labelBackTextureOffset // @@ -1177,7 +1188,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelBackTextureOffset.Size = new System.Drawing.Size(80, 14); this.labelBackTextureOffset.TabIndex = 50; this.labelBackTextureOffset.Tag = ""; - this.labelBackTextureOffset.Text = "Sidedef Offset:"; + this.labelBackTextureOffset.Text = "Sidedef offset:"; this.labelBackTextureOffset.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelBackOffsetBottom @@ -1187,7 +1198,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelBackOffsetBottom.Size = new System.Drawing.Size(80, 14); this.labelBackOffsetBottom.TabIndex = 49; this.labelBackOffsetBottom.Tag = ""; - this.labelBackOffsetBottom.Text = "Lower Offset:"; + this.labelBackOffsetBottom.Text = "Lower offset:"; this.labelBackOffsetBottom.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelBackOffsetMid @@ -1197,7 +1208,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelBackOffsetMid.Size = new System.Drawing.Size(80, 14); this.labelBackOffsetMid.TabIndex = 48; this.labelBackOffsetMid.Tag = ""; - this.labelBackOffsetMid.Text = "Middle Offset:"; + this.labelBackOffsetMid.Text = "Middle offset:"; this.labelBackOffsetMid.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelBackOffsetTop @@ -1207,7 +1218,7 @@ namespace CodeImp.DoomBuilder.Windows this.labelBackOffsetTop.Size = new System.Drawing.Size(80, 14); this.labelBackOffsetTop.TabIndex = 47; this.labelBackOffsetTop.Tag = ""; - this.labelBackOffsetTop.Text = "Upper Offset:"; + this.labelBackOffsetTop.Text = "Upper offset:"; this.labelBackOffsetTop.TextAlign = System.Drawing.ContentAlignment.TopRight; // // pfcBackOffsetTop @@ -1374,17 +1385,6 @@ namespace CodeImp.DoomBuilder.Windows this.imagelist.Images.SetKeyName(0, "Check.png"); this.imagelist.Images.SetKeyName(1, "SearchClear.png"); // - // resetalpha - // - this.resetalpha.Image = global::CodeImp.DoomBuilder.Properties.Resources.Reset; - this.resetalpha.Location = new System.Drawing.Point(301, 16); - this.resetalpha.Name = "resetalpha"; - this.resetalpha.Size = new System.Drawing.Size(23, 23); - this.resetalpha.TabIndex = 70; - this.tooltip.SetToolTip(this.resetalpha, "Reset"); - this.resetalpha.UseVisualStyleBackColor = true; - this.resetalpha.Click += new System.EventHandler(this.resetalpha_Click); - // // LinedefEditFormUDMF // this.AcceptButton = this.apply; diff --git a/Source/Core/Windows/LinedefEditFormUDMF.cs b/Source/Core/Windows/LinedefEditFormUDMF.cs index 67c3c10de..4a55b7084 100644 --- a/Source/Core/Windows/LinedefEditFormUDMF.cs +++ b/Source/Core/Windows/LinedefEditFormUDMF.cs @@ -864,6 +864,7 @@ namespace CodeImp.DoomBuilder.Windows private void resetalpha_Click(object sender, EventArgs e) { + alpha.Focus(); alpha.Text = "1"; } diff --git a/Source/Core/Windows/SectorEditForm.Designer.cs b/Source/Core/Windows/SectorEditForm.Designer.cs index e8095ff9c..76abc000e 100644 --- a/Source/Core/Windows/SectorEditForm.Designer.cs +++ b/Source/Core/Windows/SectorEditForm.Designer.cs @@ -101,7 +101,7 @@ namespace CodeImp.DoomBuilder.Windows groupeffect.Size = new System.Drawing.Size(436, 92); groupeffect.TabIndex = 1; groupeffect.TabStop = false; - groupeffect.Text = "Effect and Identification"; + groupeffect.Text = "Effect and identification"; // // browseeffect // @@ -174,7 +174,7 @@ namespace CodeImp.DoomBuilder.Windows groupfloorceiling.Size = new System.Drawing.Size(436, 186); groupfloorceiling.TabIndex = 0; groupfloorceiling.TabStop = false; - groupfloorceiling.Text = "Floor and Ceiling "; + groupfloorceiling.Text = "Floor and ceiling "; // // label7 // @@ -210,9 +210,9 @@ namespace CodeImp.DoomBuilder.Windows // heightoffset // this.heightoffset.AllowDecimal = false; + this.heightoffset.AllowExpressions = true; this.heightoffset.AllowNegative = true; this.heightoffset.AllowRelative = true; - this.heightoffset.AllowExpressions = true; this.heightoffset.ButtonStep = 8; this.heightoffset.ButtonStepBig = 16F; this.heightoffset.ButtonStepFloat = 1F; @@ -229,6 +229,7 @@ namespace CodeImp.DoomBuilder.Windows // brightness // this.brightness.AllowDecimal = false; + this.brightness.AllowExpressions = false; this.brightness.AllowNegative = true; this.brightness.AllowRelative = true; this.brightness.ButtonStep = 8; @@ -247,9 +248,9 @@ namespace CodeImp.DoomBuilder.Windows // ceilingheight // this.ceilingheight.AllowDecimal = false; + this.ceilingheight.AllowExpressions = true; this.ceilingheight.AllowNegative = true; this.ceilingheight.AllowRelative = true; - this.ceilingheight.AllowExpressions = true; this.ceilingheight.ButtonStep = 8; this.ceilingheight.ButtonStepBig = 16F; this.ceilingheight.ButtonStepFloat = 1F; @@ -314,9 +315,9 @@ namespace CodeImp.DoomBuilder.Windows // floorheight // this.floorheight.AllowDecimal = false; + this.floorheight.AllowExpressions = true; this.floorheight.AllowNegative = true; this.floorheight.AllowRelative = true; - this.floorheight.AllowExpressions = true; this.floorheight.ButtonStep = 8; this.floorheight.ButtonStepBig = 16F; this.floorheight.ButtonStepFloat = 1F; diff --git a/Source/Core/Windows/SectorEditFormUDMF.Designer.cs b/Source/Core/Windows/SectorEditFormUDMF.Designer.cs index 6e9f6cc9c..ee773f804 100644 --- a/Source/Core/Windows/SectorEditFormUDMF.Designer.cs +++ b/Source/Core/Windows/SectorEditFormUDMF.Designer.cs @@ -74,6 +74,7 @@ this.flags = new CodeImp.DoomBuilder.Controls.CheckboxArrayControl(); this.tabSurfaces = new System.Windows.Forms.TabPage(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.floorglowheightrequired = new System.Windows.Forms.PictureBox(); this.disablefloorglow = new System.Windows.Forms.CheckBox(); this.resetfloorglowheight = new System.Windows.Forms.Button(); this.floorglowheightlabel = new System.Windows.Forms.Label(); @@ -101,6 +102,7 @@ this.floorOffsets = new CodeImp.DoomBuilder.Controls.PairedFieldsControl(); this.floortex = new CodeImp.DoomBuilder.Controls.FlatSelectorControl(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.ceilingglowheightrequired = new System.Windows.Forms.PictureBox(); this.disableceilingglow = new System.Windows.Forms.CheckBox(); this.resetceilingglowheight = new System.Windows.Forms.Button(); this.ceilingglowheightlabel = new System.Windows.Forms.Label(); @@ -178,7 +180,9 @@ this.groupBox3.SuspendLayout(); this.tabSurfaces.SuspendLayout(); this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.floorglowheightrequired)).BeginInit(); this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ceilingglowheightrequired)).BeginInit(); this.tabslopes.SuspendLayout(); this.groupBox7.SuspendLayout(); this.groupBox6.SuspendLayout(); @@ -246,7 +250,7 @@ this.fogdensity.ButtonStepSmall = 1F; this.fogdensity.ButtonStepsUseModifierKeys = true; this.fogdensity.ButtonStepsWrapAround = false; - this.fogdensity.Location = new System.Drawing.Point(89, 132); + this.fogdensity.Location = new System.Drawing.Point(283, 130); this.fogdensity.Name = "fogdensity"; this.fogdensity.Size = new System.Drawing.Size(81, 24); this.fogdensity.StepValues = null; @@ -257,7 +261,7 @@ // label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(0))); label4.ForeColor = System.Drawing.SystemColors.HotTrack; - label4.Location = new System.Drawing.Point(9, 137); + label4.Location = new System.Drawing.Point(203, 135); label4.Name = "label4"; label4.Size = new System.Drawing.Size(74, 14); label4.TabIndex = 9; @@ -773,6 +777,7 @@ // this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Controls.Add(this.floorglowheightrequired); this.groupBox2.Controls.Add(this.disablefloorglow); this.groupBox2.Controls.Add(this.resetfloorglowheight); this.groupBox2.Controls.Add(this.floorglowheightlabel); @@ -806,6 +811,17 @@ this.groupBox2.TabStop = false; this.groupBox2.Text = " Floor "; // + // floorglowheightrequired + // + this.floorglowheightrequired.Image = global::CodeImp.DoomBuilder.Properties.Resources.Warning; + this.floorglowheightrequired.Location = new System.Drawing.Point(20, 257); + this.floorglowheightrequired.Name = "floorglowheightrequired"; + this.floorglowheightrequired.Size = new System.Drawing.Size(16, 16); + this.floorglowheightrequired.TabIndex = 27; + this.floorglowheightrequired.TabStop = false; + this.tooltip.SetToolTip(this.floorglowheightrequired, "Non-zero glow height required\r\nfor the glow to be shown ingame!"); + this.floorglowheightrequired.Visible = false; + // // disablefloorglow // this.disablefloorglow.AutoSize = true; @@ -845,9 +861,9 @@ this.floorglowheight.AllowExpressions = false; this.floorglowheight.AllowNegative = false; this.floorglowheight.AllowRelative = false; - this.floorglowheight.ButtonStep = 8; - this.floorglowheight.ButtonStepBig = 16F; - this.floorglowheight.ButtonStepFloat = 1F; + this.floorglowheight.ButtonStep = 16; + this.floorglowheight.ButtonStepBig = 64F; + this.floorglowheight.ButtonStepFloat = 16F; this.floorglowheight.ButtonStepSmall = 1F; this.floorglowheight.ButtonStepsUseModifierKeys = true; this.floorglowheight.ButtonStepsWrapAround = false; @@ -883,7 +899,7 @@ // // label23 // - this.label23.Location = new System.Drawing.Point(24, 202); + this.label23.Location = new System.Drawing.Point(26, 202); this.label23.Name = "label23"; this.label23.Size = new System.Drawing.Size(80, 14); this.label23.TabIndex = 17; @@ -925,7 +941,7 @@ // // label3 // - this.label3.Location = new System.Drawing.Point(24, 114); + this.label3.Location = new System.Drawing.Point(26, 114); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(80, 14); this.label3.TabIndex = 6; @@ -956,22 +972,22 @@ // // labelFloorOffsets // - this.labelFloorOffsets.Location = new System.Drawing.Point(6, 27); + this.labelFloorOffsets.Location = new System.Drawing.Point(8, 27); this.labelFloorOffsets.Name = "labelFloorOffsets"; this.labelFloorOffsets.Size = new System.Drawing.Size(98, 14); this.labelFloorOffsets.TabIndex = 0; this.labelFloorOffsets.Tag = ""; - this.labelFloorOffsets.Text = "Texture Offsets:"; + this.labelFloorOffsets.Text = "Texture offsets:"; this.labelFloorOffsets.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelFloorScale // - this.labelFloorScale.Location = new System.Drawing.Point(9, 59); + this.labelFloorScale.Location = new System.Drawing.Point(8, 59); this.labelFloorScale.Name = "labelFloorScale"; - this.labelFloorScale.Size = new System.Drawing.Size(95, 14); + this.labelFloorScale.Size = new System.Drawing.Size(98, 14); this.labelFloorScale.TabIndex = 2; this.labelFloorScale.Tag = ""; - this.labelFloorScale.Text = "Texture Scale:"; + this.labelFloorScale.Text = "Texture scale:"; this.labelFloorScale.TextAlign = System.Drawing.ContentAlignment.TopRight; // // cbUseFloorLineAngles @@ -988,7 +1004,7 @@ // // floorAngleControl // - this.floorAngleControl.Angle = -1710; + this.floorAngleControl.Angle = -270; this.floorAngleControl.AngleOffset = 90; this.floorAngleControl.DoomAngleClamping = false; this.floorAngleControl.Location = new System.Drawing.Point(6, 156); @@ -999,7 +1015,7 @@ // // labelfloorrenderstyle // - this.labelfloorrenderstyle.Location = new System.Drawing.Point(24, 88); + this.labelfloorrenderstyle.Location = new System.Drawing.Point(26, 88); this.labelfloorrenderstyle.Name = "labelfloorrenderstyle"; this.labelfloorrenderstyle.Size = new System.Drawing.Size(80, 14); this.labelfloorrenderstyle.TabIndex = 4; @@ -1009,7 +1025,7 @@ // // label11 // - this.label11.Location = new System.Drawing.Point(24, 172); + this.label11.Location = new System.Drawing.Point(26, 172); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(80, 14); this.label11.TabIndex = 14; @@ -1050,7 +1066,7 @@ // // label12 // - this.label12.Location = new System.Drawing.Point(24, 142); + this.label12.Location = new System.Drawing.Point(26, 142); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(80, 14); this.label12.TabIndex = 9; @@ -1139,6 +1155,7 @@ // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.ceilingglowheightrequired); this.groupBox1.Controls.Add(this.disableceilingglow); this.groupBox1.Controls.Add(this.resetceilingglowheight); this.groupBox1.Controls.Add(this.ceilingglowheightlabel); @@ -1172,6 +1189,17 @@ this.groupBox1.TabStop = false; this.groupBox1.Text = " Ceiling "; // + // ceilingglowheightrequired + // + this.ceilingglowheightrequired.Image = global::CodeImp.DoomBuilder.Properties.Resources.Warning; + this.ceilingglowheightrequired.Location = new System.Drawing.Point(20, 257); + this.ceilingglowheightrequired.Name = "ceilingglowheightrequired"; + this.ceilingglowheightrequired.Size = new System.Drawing.Size(16, 16); + this.ceilingglowheightrequired.TabIndex = 26; + this.ceilingglowheightrequired.TabStop = false; + this.tooltip.SetToolTip(this.ceilingglowheightrequired, "Non-zero glow height required\r\nfor the glow to be shown ingame!"); + this.ceilingglowheightrequired.Visible = false; + // // disableceilingglow // this.disableceilingglow.AutoSize = true; @@ -1211,9 +1239,9 @@ this.ceilingglowheight.AllowExpressions = false; this.ceilingglowheight.AllowNegative = false; this.ceilingglowheight.AllowRelative = false; - this.ceilingglowheight.ButtonStep = 8; - this.ceilingglowheight.ButtonStepBig = 16F; - this.ceilingglowheight.ButtonStepFloat = 1F; + this.ceilingglowheight.ButtonStep = 16; + this.ceilingglowheight.ButtonStepBig = 64F; + this.ceilingglowheight.ButtonStepFloat = 16F; this.ceilingglowheight.ButtonStepSmall = 1F; this.ceilingglowheight.ButtonStepsUseModifierKeys = true; this.ceilingglowheight.ButtonStepsWrapAround = false; @@ -1327,17 +1355,17 @@ this.labelCeilOffsets.Size = new System.Drawing.Size(98, 14); this.labelCeilOffsets.TabIndex = 0; this.labelCeilOffsets.Tag = ""; - this.labelCeilOffsets.Text = "Texture Offsets:"; + this.labelCeilOffsets.Text = "Texture offsets:"; this.labelCeilOffsets.TextAlign = System.Drawing.ContentAlignment.TopRight; // // labelCeilScale // - this.labelCeilScale.Location = new System.Drawing.Point(11, 59); + this.labelCeilScale.Location = new System.Drawing.Point(8, 59); this.labelCeilScale.Name = "labelCeilScale"; - this.labelCeilScale.Size = new System.Drawing.Size(95, 14); + this.labelCeilScale.Size = new System.Drawing.Size(98, 14); this.labelCeilScale.TabIndex = 2; this.labelCeilScale.Tag = ""; - this.labelCeilScale.Text = "Texture Scale:"; + this.labelCeilScale.Text = "Texture scale:"; this.labelCeilScale.TextAlign = System.Drawing.ContentAlignment.TopRight; // // cbUseCeilLineAngles @@ -1354,7 +1382,7 @@ // // ceilAngleControl // - this.ceilAngleControl.Angle = -1710; + this.ceilAngleControl.Angle = -270; this.ceilAngleControl.AngleOffset = 90; this.ceilAngleControl.DoomAngleClamping = false; this.ceilAngleControl.Location = new System.Drawing.Point(6, 156); @@ -1849,8 +1877,10 @@ this.tabSurfaces.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.floorglowheightrequired)).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ceilingglowheightrequired)).EndInit(); this.tabslopes.ResumeLayout(false); this.groupBox7.ResumeLayout(false); this.groupBox6.ResumeLayout(false); @@ -1971,5 +2001,7 @@ private System.Windows.Forms.Button resetfloorglowheight; private System.Windows.Forms.CheckBox disableceilingglow; private System.Windows.Forms.CheckBox disablefloorglow; + private System.Windows.Forms.PictureBox ceilingglowheightrequired; + private System.Windows.Forms.PictureBox floorglowheightrequired; } } \ No newline at end of file diff --git a/Source/Core/Windows/SectorEditFormUDMF.cs b/Source/Core/Windows/SectorEditFormUDMF.cs index 6fde394be..6709df5c8 100644 --- a/Source/Core/Windows/SectorEditFormUDMF.cs +++ b/Source/Core/Windows/SectorEditFormUDMF.cs @@ -293,9 +293,6 @@ namespace CodeImp.DoomBuilder.Windows { preventchanges = true; //mxd - int floorglowcolorval = 0; - int ceilingglowcolorval = 0; - // Keep this list this.sectors = sectors; if(sectors.Count > 1) this.Text = "Edit Sectors (" + sectors.Count + ")"; @@ -370,8 +367,8 @@ namespace CodeImp.DoomBuilder.Windows fogdensity.Text = General.Clamp(sc.Fields.GetValue("fogdensity", 0), 0, 510).ToString(); // Floor/ceiling glow - ceilingglowcolorval = sc.Fields.GetValue("ceilingglowcolor", 0); - floorglowcolorval = sc.Fields.GetValue("floorglowcolor", 0); + int ceilingglowcolorval = sc.Fields.GetValue("ceilingglowcolor", 0); + int floorglowcolorval = sc.Fields.GetValue("floorglowcolor", 0); ceilingglowcolor.SetValueFrom(sc.Fields, true); floorglowcolor.SetValueFrom(sc.Fields, true); @@ -587,6 +584,10 @@ namespace CodeImp.DoomBuilder.Windows if(ceilingglowheight.Text == "0") resetceilingglowheight.Visible = false; if(floorglowheight.Text == "0") resetfloorglowheight.Visible = false; + //mxd. Cause Graf was not into non-zero default glow height... + UpdateCeilingGlowHeightWarning(); + UpdateFloorGlowHeightWarning(); + //mxd. Setup tags tagsselector.SetValues(sectors); @@ -990,6 +991,7 @@ namespace CodeImp.DoomBuilder.Windows private void resetfloorterrain_Click(object sender, EventArgs e) { + floorterrain.Focus(); floorterrain.Text = NO_TERRAIN; } @@ -1005,6 +1007,7 @@ namespace CodeImp.DoomBuilder.Windows private void resetceilterrain_Click(object sender, EventArgs e) { + ceilterrain.Focus(); ceilterrain.Text = NO_TERRAIN; } @@ -1062,11 +1065,13 @@ namespace CodeImp.DoomBuilder.Windows private void reset_ceiling_reflect_Click(object sender, EventArgs e) { + ceiling_reflect.Focus(); ceiling_reflect.Text = "0"; } private void reset_floor_reflect_Click(object sender, EventArgs e) { + floor_reflect.Focus(); floor_reflect.Text = "0"; } @@ -1082,11 +1087,13 @@ namespace CodeImp.DoomBuilder.Windows private void resetalphafloor_Click(object sender, EventArgs e) { + alphafloor.Focus(); alphafloor.Text = "1"; } private void resetalphaceiling_Click(object sender, EventArgs e) { + alphaceiling.Focus(); alphaceiling.Text = "1"; } @@ -1840,6 +1847,18 @@ namespace CodeImp.DoomBuilder.Windows #region ================== Glow relatime events (mxd) + private void UpdateCeilingGlowHeightWarning() + { + ceilingglowheightrequired.Visible = (ceilingglowcolor.Color.WithAlpha(0).ToInt() != ceilingglowcolor.DefaultValue + && ceilingglowheight.GetResultFloat(0f) == 0f); + } + + private void UpdateFloorGlowHeightWarning() + { + floorglowheightrequired.Visible = (floorglowcolor.Color.WithAlpha(0).ToInt() != floorglowcolor.DefaultValue + && floorglowheight.GetResultFloat(0f) == 0f); + } + private void ceilingglowcolor_OnValueChanged(object sender, EventArgs e) { if(preventchanges) return; @@ -1851,6 +1870,9 @@ namespace CodeImp.DoomBuilder.Windows s.UpdateNeeded = true; } + // Show height warning? + UpdateCeilingGlowHeightWarning(); + General.Map.IsChanged = true; if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); } @@ -1866,6 +1888,9 @@ namespace CodeImp.DoomBuilder.Windows s.UpdateNeeded = true; } + // Show height warning? + UpdateFloorGlowHeightWarning(); + General.Map.IsChanged = true; if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); } @@ -1889,6 +1914,9 @@ namespace CodeImp.DoomBuilder.Windows s.UpdateNeeded = true; } + // Hide height warning + ceilingglowheightrequired.Visible = false; + // Trigger update General.Map.IsChanged = true; if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); @@ -1919,6 +1947,9 @@ namespace CodeImp.DoomBuilder.Windows s.UpdateNeeded = true; } + // Hide height warning + floorglowheightrequired.Visible = false; + // Trigger update General.Map.IsChanged = true; if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); @@ -1957,6 +1988,9 @@ namespace CodeImp.DoomBuilder.Windows // Update "Reset" button resetceilingglowheight.Visible = (ceilingglowheight.GetResultFloat(0f) != 0f); + // Show height warning? + UpdateCeilingGlowHeightWarning(); + General.Map.IsChanged = true; if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); } @@ -1988,17 +2022,22 @@ namespace CodeImp.DoomBuilder.Windows // Update "Reset" button resetfloorglowheight.Visible = (floorglowheight.GetResultFloat(0f) != 0f); + // Show height warning? + UpdateFloorGlowHeightWarning(); + General.Map.IsChanged = true; if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); } private void resetceilingglowheight_Click(object sender, EventArgs e) { + ceilingglowheight.Focus(); ceilingglowheight.Text = "0"; } private void resetfloorglowheight_Click(object sender, EventArgs e) { + floorglowheight.Focus(); floorglowheight.Text = "0"; } diff --git a/Source/Core/Windows/SectorEditFormUDMF.resx b/Source/Core/Windows/SectorEditFormUDMF.resx index b549249bb..d35f4d8e6 100644 --- a/Source/Core/Windows/SectorEditFormUDMF.resx +++ b/Source/Core/Windows/SectorEditFormUDMF.resx @@ -130,7 +130,8 @@ <value>17, 17</value> </metadata> <data name="label4.ToolTip" xml:space="preserve"> - <value>Sets an explicit fog density for the sector, overriding the default calculation from the light level. + <value>Applied only when the sector is affected by either Fade or MAPINFO fogdensity/outsidefogdensity. +Sets an explicit fog density for the sector, overriding the default calculation from the light level. Value range is 0-510, 0 meaning that the default is to be used, 2 equalling the density of a light level of 250, and 255 equalling the density of a light level of 0.</value> </data> diff --git a/Source/Core/Windows/ThingEditForm.Designer.cs b/Source/Core/Windows/ThingEditForm.Designer.cs index 73feb71da..7ef4d32db 100644 --- a/Source/Core/Windows/ThingEditForm.Designer.cs +++ b/Source/Core/Windows/ThingEditForm.Designer.cs @@ -96,9 +96,9 @@ namespace CodeImp.DoomBuilder.Windows this.cbAbsoluteHeight.AutoSize = true; this.cbAbsoluteHeight.Location = new System.Drawing.Point(12, 111); this.cbAbsoluteHeight.Name = "cbAbsoluteHeight"; - this.cbAbsoluteHeight.Size = new System.Drawing.Size(101, 17); + this.cbAbsoluteHeight.Size = new System.Drawing.Size(99, 17); this.cbAbsoluteHeight.TabIndex = 16; - this.cbAbsoluteHeight.Text = "Absolute Height"; + this.cbAbsoluteHeight.Text = "Absolute height"; this.cbAbsoluteHeight.UseVisualStyleBackColor = true; this.cbAbsoluteHeight.CheckedChanged += new System.EventHandler(this.cbAbsoluteHeight_CheckedChanged); // @@ -123,9 +123,9 @@ namespace CodeImp.DoomBuilder.Windows // posX // this.posX.AllowDecimal = false; + this.posX.AllowExpressions = true; this.posX.AllowNegative = true; this.posX.AllowRelative = true; - this.posX.AllowExpressions = true; this.posX.ButtonStep = 8; this.posX.ButtonStepBig = 16F; this.posX.ButtonStepFloat = 1F; @@ -142,9 +142,9 @@ namespace CodeImp.DoomBuilder.Windows // posY // this.posY.AllowDecimal = false; + this.posY.AllowExpressions = true; this.posY.AllowNegative = true; this.posY.AllowRelative = true; - this.posY.AllowExpressions = true; this.posY.ButtonStep = 8; this.posY.ButtonStepBig = 16F; this.posY.ButtonStepFloat = 1F; @@ -161,9 +161,9 @@ namespace CodeImp.DoomBuilder.Windows // posZ // this.posZ.AllowDecimal = false; + this.posZ.AllowExpressions = true; this.posZ.AllowNegative = true; this.posZ.AllowRelative = true; - this.posZ.AllowExpressions = true; this.posZ.ButtonStep = 8; this.posZ.ButtonStepBig = 16F; this.posZ.ButtonStepFloat = 1F; @@ -243,9 +243,9 @@ namespace CodeImp.DoomBuilder.Windows // angle // this.angle.AllowDecimal = false; + this.angle.AllowExpressions = false; this.angle.AllowNegative = true; this.angle.AllowRelative = true; - this.posX.AllowExpressions = true; this.angle.ButtonStep = 5; this.angle.ButtonStepBig = 15F; this.angle.ButtonStepFloat = 1F; diff --git a/Source/Core/Windows/VertexEditForm.Designer.cs b/Source/Core/Windows/VertexEditForm.Designer.cs index 0640b99f7..394f99f1a 100644 --- a/Source/Core/Windows/VertexEditForm.Designer.cs +++ b/Source/Core/Windows/VertexEditForm.Designer.cs @@ -123,9 +123,9 @@ namespace CodeImp.DoomBuilder.Windows // zceiling // this.zceiling.AllowDecimal = false; + this.zceiling.AllowExpressions = true; this.zceiling.AllowNegative = true; this.zceiling.AllowRelative = true; - this.zceiling.AllowExpressions = true; this.zceiling.ButtonStep = 8; this.zceiling.ButtonStepBig = 16F; this.zceiling.ButtonStepFloat = 1F; @@ -142,9 +142,9 @@ namespace CodeImp.DoomBuilder.Windows // zfloor // this.zfloor.AllowDecimal = false; + this.zfloor.AllowExpressions = true; this.zfloor.AllowNegative = true; this.zfloor.AllowRelative = true; - this.zfloor.AllowExpressions = true; this.zfloor.ButtonStep = 8; this.zfloor.ButtonStepBig = 16F; this.zfloor.ButtonStepFloat = 1F; @@ -163,25 +163,25 @@ namespace CodeImp.DoomBuilder.Windows label2.AutoSize = true; label2.Location = new System.Drawing.Point(68, 37); label2.Name = "label2"; - label2.Size = new System.Drawing.Size(111, 13); + label2.Size = new System.Drawing.Size(106, 13); label2.TabIndex = 26; - label2.Text = "Absolute Floor Height:"; + label2.Text = "Absolute floor height:"; // // label3 // label3.AutoSize = true; label3.Location = new System.Drawing.Point(60, 5); label3.Name = "label3"; - label3.Size = new System.Drawing.Size(119, 13); + label3.Size = new System.Drawing.Size(116, 13); label3.TabIndex = 27; - label3.Text = "Absolute Ceiling Height:"; + label3.Text = "Absolute ceiling height:"; // // positiony // this.positiony.AllowDecimal = false; + this.positiony.AllowExpressions = true; this.positiony.AllowNegative = true; this.positiony.AllowRelative = true; - this.positiony.AllowExpressions = true; this.positiony.ButtonStep = 1; this.positiony.ButtonStepBig = 8F; this.positiony.ButtonStepFloat = 1F; @@ -198,9 +198,9 @@ namespace CodeImp.DoomBuilder.Windows // positionx // this.positionx.AllowDecimal = false; + this.positionx.AllowExpressions = true; this.positionx.AllowNegative = true; this.positionx.AllowRelative = true; - this.positionx.AllowExpressions = true; this.positionx.ButtonStep = 1; this.positionx.ButtonStepBig = 8F; this.positionx.ButtonStepFloat = 1F; diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs index c24e8378b..f1df6479b 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs @@ -265,7 +265,7 @@ namespace CodeImp.DoomBuilder.BuilderModes sectorcolor = areacolor.WithAlpha(alpha).ToInt(); //mxd. Calculate fogfactor - fogfactor = VisualGeometry.CalculateFogFactor(level.sector.FogMode, brightness); + fogfactor = VisualGeometry.CalculateFogFactor(level.sector, brightness); } } //TECH: even Bright Thing frames are affected by custom fade... @@ -277,7 +277,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if(level != null && level.sector.FogMode > SectorFogMode.CLASSIC) { //mxd. Calculate fogfactor - fogfactor = VisualGeometry.CalculateFogFactor(level.sector.FogMode, level.brightnessbelow); + fogfactor = VisualGeometry.CalculateFogFactor(level.sector, level.brightnessbelow); } } } diff --git a/Source/Plugins/BuilderModes/VisualModes/EffectGlowingFlat.cs b/Source/Plugins/BuilderModes/VisualModes/EffectGlowingFlat.cs index e00c56ba3..41eb8f8fd 100644 --- a/Source/Plugins/BuilderModes/VisualModes/EffectGlowingFlat.cs +++ b/Source/Plugins/BuilderModes/VisualModes/EffectGlowingFlat.cs @@ -1,4 +1,5 @@ -using CodeImp.DoomBuilder.Rendering; +using CodeImp.DoomBuilder.GZBuilder.Data; +using CodeImp.DoomBuilder.Rendering; namespace CodeImp.DoomBuilder.BuilderModes { @@ -16,10 +17,11 @@ namespace CodeImp.DoomBuilder.BuilderModes data = sourcedata; } - public void Update() + public void Update() { // Create ceiling glow effect? - if(General.Map.Data.GlowingFlats.ContainsKey(data.Sector.LongCeilTexture)) + data.CeilingGlow = GetGlowData(false); + if(data.CeilingGlow != null) { // Create ceiling level? if(ceillevel == null) @@ -29,20 +31,16 @@ namespace CodeImp.DoomBuilder.BuilderModes } // Update ceiling level - data.CeilingGlow = General.Map.Data.GlowingFlats[data.Sector.LongCeilTexture]; ceillevel.brightnessbelow = -1; // We need this plane for clipping only, ceillevel.color = 0; // so we need to reset all shading and coloring ceillevel.plane = data.Ceiling.plane; ceillevel.plane.Offset -= data.CeilingGlow.Height; data.CeilingGlowPlane = ceillevel.plane; } - else - { - data.CeilingGlow = null; - } // Create floor glow effect? - if(General.Map.Data.GlowingFlats.ContainsKey(data.Sector.LongFloorTexture)) + data.FloorGlow = GetGlowData(true); + if(data.FloorGlow != null) { // Create floor level? if(floorlevel == null) @@ -52,7 +50,6 @@ namespace CodeImp.DoomBuilder.BuilderModes } // Update floor level - data.FloorGlow = General.Map.Data.GlowingFlats[data.Sector.LongFloorTexture]; floorlevel.plane = data.Floor.plane.GetInverted(); floorlevel.plane.Offset += data.FloorGlow.Height; @@ -72,10 +69,39 @@ namespace CodeImp.DoomBuilder.BuilderModes data.FloorGlowPlane = floorlevel.plane; } - else + } + + private GlowingFlatData GetGlowData(bool floor) + { + // Check UDMF glow properties + if(General.Map.UDMF) { - data.FloorGlow = null; + int glowcolor = data.Sector.Fields.GetValue((floor ? "floorglowcolor" : "ceilingglowcolor"), 0); + + // Glow is explicidly disabled? + if(glowcolor == -1) return null; + + // Avoid black glows + if(glowcolor > 0) + { + float glowheight = data.Sector.Fields.GetValue((floor ? "floorglowheight" : "ceilingglowheight"), 0f); + if(glowheight > 0f) + { + // Create glow data + PixelColor c = PixelColor.FromInt(glowcolor); + return new GlowingFlatData + { + Color = c, + Height = glowheight, + Brightness = (c.r + c.g + c.b) / 3, + }; + } + } } + + // Use GLDEFS glow if available + long texture = (floor ? data.Sector.LongFloorTexture : data.Sector.LongCeilTexture); + return (General.Map.Data.GlowingFlats.ContainsKey(texture) ? General.Map.Data.GlowingFlats[texture] : null); } } } diff --git a/Source/Tools/VersionFromSVN/Program.cs b/Source/Tools/VersionFromSVN/Program.cs index 74b30b8b1..f64b620ec 100644 --- a/Source/Tools/VersionFromSVN/Program.cs +++ b/Source/Tools/VersionFromSVN/Program.cs @@ -15,7 +15,7 @@ namespace mxd.VersionFromGIT { #region ======================== Constants - private const string GIT_INFO = "@echo off\r\ngit rev-list --count master\r\ngit rev-parse --short=7 master"; + private const string GIT_INFO = "@echo off\r\ngit rev-list --count origin/master\r\ngit rev-parse --short=7 origin/master"; #endregion diff --git a/VersionFromGIT.exe b/VersionFromGIT.exe index 11fde547d50dd53a6c5730a9b228e94f81b9ac3d..afa91661a7e4ad7af2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