From abfcd8e53babadce47d4a0706d853b0eb88698ed Mon Sep 17 00:00:00 2001 From: MaxED Date: Fri, 25 Mar 2016 14:06:00 +0000 Subject: [PATCH] Added, Preferences -> Appearance: added "Anisotropic filtering" and "Edge Antialiasing" settings. Also regrouped some settings. Added, "Check polyobjects" error check: added a check for matching Polyobject and Mirror Polyobject numbers of Polyobj_StartLine action. Changed, Visual mode: anisotropic filtering is now always applied (previously it was applied only when bilinear filtering was enabled). Fixed, Visual mode: in some cases light values were incorrectly transferred between 3d floors and regular floors/ceilings. Fixed, ACS parser: includes for each library must be stored separately (fixes inability to compile a script with an included library, which in turn includes files already included by the script). --- Source/Core/Config/ProgramConfiguration.cs | 6 +- Source/Core/Controls/ScriptFileDocumentTab.cs | 2 +- Source/Core/GZBuilder/GZDoom/AcsParserSE.cs | 172 +++++----- Source/Core/General/MapManager.cs | 2 +- Source/Core/Rendering/D3DDevice.cs | 30 +- Source/Core/Rendering/World3DShader.cs | 22 +- .../Core/Windows/PreferencesForm.Designer.cs | 322 ++++++++++++------ Source/Core/Windows/PreferencesForm.cs | 18 + Source/Core/Windows/PreferencesForm.resx | 6 + Source/Core/ZDoom/ZDTextParser.cs | 23 +- .../ErrorChecks/CheckPolyobjects.cs | 9 +- .../BuilderModes/VisualModes/Effect3DFloor.cs | 5 +- .../BuilderModes/VisualModes/SectorData.cs | 18 +- .../BuilderModes/VisualModes/SectorLevel.cs | 5 +- .../VisualModes/SectorLevelComparer.cs | 34 +- 15 files changed, 436 insertions(+), 238 deletions(-) diff --git a/Source/Core/Config/ProgramConfiguration.cs b/Source/Core/Config/ProgramConfiguration.cs index 8b1282d8..2d544ca3 100644 --- a/Source/Core/Config/ProgramConfiguration.cs +++ b/Source/Core/Config/ProgramConfiguration.cs @@ -82,6 +82,7 @@ namespace CodeImp.DoomBuilder.Config private bool toolbartesting; private bool toolbarfile; private float filteranisotropy; + private int antialiasingsamples; //mxd private bool showtexturesizes; private bool locatetexturegroup; //mxd private bool keeptexturefilterfocused; //mxd @@ -183,6 +184,7 @@ namespace CodeImp.DoomBuilder.Config public bool ToolbarTesting { get { return toolbartesting; } internal set { toolbartesting = value; } } public bool ToolbarFile { get { return toolbarfile; } internal set { toolbarfile = value; } } public float FilterAnisotropy { get { return filteranisotropy; } internal set { filteranisotropy = value; } } + public int AntiAliasingSamples { get { return antialiasingsamples; } internal set { antialiasingsamples = value; } } //mxd public bool ShowTextureSizes { get { return showtexturesizes; } internal set { showtexturesizes = value; } } public bool LocateTextureGroup { get { return locatetexturegroup; } internal set { locatetexturegroup = value; } } //mxd public bool KeepTextureFilterFocused { get { return keeptexturefilterfocused; } internal set { keeptexturefilterfocused = value; } } //mxd @@ -306,7 +308,8 @@ namespace CodeImp.DoomBuilder.Config toolbargeometry = cfg.ReadSetting("toolbargeometry", true); toolbartesting = cfg.ReadSetting("toolbartesting", true); toolbarfile = cfg.ReadSetting("toolbarfile", true); - filteranisotropy = cfg.ReadSetting("filteranisotropy", 8.0f); + filteranisotropy = General.Clamp(cfg.ReadSetting("filteranisotropy", 16.0f), 1.0f, 16.0f); + antialiasingsamples = General.Clamp(cfg.ReadSetting("antialiasingsamples", 4), 0, 8) / 2 * 2; //mxd showtexturesizes = cfg.ReadSetting("showtexturesizes", true); locatetexturegroup = cfg.ReadSetting("locatetexturegroup", true); //mxd keeptexturefilterfocused = cfg.ReadSetting("keeptexturefilterfocused", true); //mxd @@ -412,6 +415,7 @@ namespace CodeImp.DoomBuilder.Config cfg.WriteSetting("toolbartesting", toolbartesting); cfg.WriteSetting("toolbarfile", toolbarfile); cfg.WriteSetting("filteranisotropy", filteranisotropy); + cfg.WriteSetting("antialiasingsamples", antialiasingsamples); //mxd cfg.WriteSetting("showtexturesizes", showtexturesizes); cfg.WriteSetting("locatetexturegroup", locatetexturegroup); //mxd cfg.WriteSetting("keeptexturefilterfocused", keeptexturefilterfocused); //mxd diff --git a/Source/Core/Controls/ScriptFileDocumentTab.cs b/Source/Core/Controls/ScriptFileDocumentTab.cs index ac4f50a5..51fb1a5a 100644 --- a/Source/Core/Controls/ScriptFileDocumentTab.cs +++ b/Source/Core/Controls/ScriptFileDocumentTab.cs @@ -225,7 +225,7 @@ namespace CodeImp.DoomBuilder.Controls compiler.OutputFile = outputfile; compiler.SourceFile = filepathname; compiler.WorkingDirectory = Path.GetDirectoryName(filepathname); - compiler.Includes = parser.Includes; + compiler.Includes = parser.GetIncludes(); compiler.CopyIncludesToWorkingDirectory = false; if(compiler.Run()) { diff --git a/Source/Core/GZBuilder/GZDoom/AcsParserSE.cs b/Source/Core/GZBuilder/GZDoom/AcsParserSE.cs index 41c57eb9..fc7d88ae 100644 --- a/Source/Core/GZBuilder/GZDoom/AcsParserSE.cs +++ b/Source/Core/GZBuilder/GZDoom/AcsParserSE.cs @@ -1,4 +1,6 @@ -using System; +#region ================== Namespaces + +using System; using System.IO; using System.Collections.Generic; using System.Globalization; @@ -7,18 +9,23 @@ using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.ZDoom; using CodeImp.DoomBuilder.GZBuilder.Data; +#endregion + //mxd. ACS parser used to create ScriptItems for use in script editor's navigator namespace CodeImp.DoomBuilder.GZBuilder.GZDoom { internal sealed class AcsParserSE : ZDTextParser { - internal override ScriptType ScriptType { get { return ScriptType.ACS; } } - + #region ================== Event Delegates + internal delegate void IncludeDelegate(AcsParserSE parser, string includefile, IncludeType includetype); internal IncludeDelegate OnInclude; - private readonly HashSet parsedlumps; - private readonly HashSet includes; + #endregion + + #region ================== Variables + + private readonly Dictionary> includes; // > private HashSet includestoskip; private string libraryname; @@ -26,10 +33,15 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom private readonly List numberedscripts; private readonly List functions; + #endregion + + #region ================== Properties + + internal override ScriptType ScriptType { get { return ScriptType.ACS; } } + internal List NamedScripts { get { return namedscripts; } } internal List NumberedScripts { get { return numberedscripts; } } internal List Functions { get { return functions; } } - internal HashSet Includes { get { return includes; } } internal bool IsLibrary { get { return !string.IsNullOrEmpty(libraryname); } } internal string LibraryName { get { return libraryname; } } @@ -37,6 +49,10 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom internal bool IsMapScriptsLump; internal bool IgnoreErrors; + #endregion + + #region ================== Enums + internal enum IncludeType { NONE, @@ -44,43 +60,41 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom LIBRARY } + #endregion + + #region ================== Constructor + internal AcsParserSE() { namedscripts = new List(); numberedscripts = new List(); functions = new List(); - parsedlumps = new HashSet(StringComparer.OrdinalIgnoreCase); - includes = new HashSet(StringComparer.OrdinalIgnoreCase); + includes = new Dictionary>(StringComparer.OrdinalIgnoreCase); includestoskip = new HashSet(StringComparer.OrdinalIgnoreCase); specialtokens += "(,)"; } - public override bool Parse(TextResourceData data, bool clearerrors) - { - return Parse(data, new HashSet(), false, IncludeType.NONE, clearerrors); - } + #endregion - public bool Parse(TextResourceData data, bool processincludes, IncludeType includetype, bool clearerrors) - { - return Parse(data, includestoskip, processincludes, includetype, clearerrors); - } + #region ================== Parsing - public bool Parse(TextResourceData data, HashSet configincludes, bool processincludes, IncludeType includetype, bool clearerrors) + public override bool Parse(TextResourceData data, bool clearerrors) { return Parse(data, new HashSet(), false, IncludeType.NONE, clearerrors); } + public bool Parse(TextResourceData data, bool processincludes, IncludeType includetype, bool clearerrors) { return Parse(data, includestoskip, processincludes, includetype, clearerrors); } + public bool Parse(TextResourceData data, HashSet configincludes, bool processincludes, IncludeType includetype, bool clearerrors) { string source = data.Filename.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); - // Duplicate checks - if(parsedlumps.Contains(source)) - { - ReportError("Already parsed \"" + source + "\". Check your #include directives"); - return IgnoreErrors; - } - - parsedlumps.Add(source); + //INFO: files included or imported inside a library are not visible to the code outside it + //and must be included/imported separately + + // Includes tracking. "Regular" includes go to "SCRIPTS" group, library includes are tracked per-library + string includecategory = (processincludes && includetype == IncludeType.LIBRARY ? source : "SCRIPTS"); + if(!includes.ContainsKey(includecategory)) includes.Add(includecategory, new HashSet(StringComparer.OrdinalIgnoreCase)); + includestoskip = configincludes; int bracelevel = 0; - //mxd. Already parsed? + // Already parsed? if(!base.AddTextResource(data)) { if(clearerrors) ClearError(); @@ -95,7 +109,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom string localsourcename = sourcename; int localsourcelumpindex = sourcelumpindex; BinaryReader localreader = datareader; - DataLocation locallocation = datalocation; //mxd + DataLocation locallocation = datalocation; + string localincludecategory = includecategory; // Continue until at the end of the stream while(SkipWhitespace(true)) @@ -116,7 +131,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom int startpos = (int)datastream.Position; token = ReadToken(); - //is it named script? + // Is this a named script? if(token.IndexOf('"') != -1) { startpos += 1; @@ -132,8 +147,9 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom // Add to collection namedscripts.Add(new ScriptItem(scriptname, argnames, startpos, includetype != IncludeType.NONE)); - } - else //should be numbered script + } + // Should be numbered script + else { int n; if(int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out n)) @@ -155,7 +171,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom if(!string.IsNullOrEmpty(token)) { int commentstart = token.IndexOf("//", StringComparison.Ordinal); - if(commentstart != -1) //found comment + if(commentstart != -1) // Found comment { commentstart += 2; name = token.Substring(commentstart, token.Length - commentstart).Trim(); @@ -181,10 +197,10 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom case "function": { SkipWhitespace(true); - string funcname = ReadToken(); //read return type + string funcname = ReadToken(); // Read return type SkipWhitespace(true); int startpos = (int)datastream.Position; - funcname += " " + ReadToken(); //read function name + funcname += " " + ReadToken(); // Read function name // Try to parse argument names List> args = ParseArgs(); @@ -239,7 +255,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom //and can use forward and backward slashes ("acs\map01/script.acs") //also include paths must be quoted //long filenames are supported - bool islibrary = (token == "#import" || includetype == IncludeType.LIBRARY); + SkipWhitespace(true); string includelump = ReadToken(false); // Don't skip newline @@ -259,25 +275,18 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom includelump = includelump.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); - // Compiler files? + // Compiler files? Track them, but don't parse them if(includestoskip.Contains(includelump)) { // These can also be included several times... - if(parsedlumps.Contains(includelump)) + if(includes[includecategory].Contains(includelump)) { - //INFO: files included or imported inside a library are not visible to the code outside it - //and must be included/imported separately - if(includetype != IncludeType.LIBRARY) - { - ReportError("Already parsed \"" + includelump + "\". Check your " + token + " directives"); - return IgnoreErrors; - } + ReportError("Already parsed \"" + includelump + "\". Check your " + token + " directives"); + return IgnoreErrors; } - else - { - parsedlumps.Add(includelump); - } - + + // Add to collection + includes[includecategory].Add(includelump); continue; } @@ -289,38 +298,32 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom return IgnoreErrors; // Already parsed? - if(includes.Contains(includelumppath)) + if(includes[includecategory].Contains(includelumppath)) { - //INFO: files included or imported inside a library are not visible to the code outside it - //and must be included/imported separately - if(!islibrary) - { - ReportError("Already parsed \"" + includelump + "\". Check your " + token + " directives"); - return IgnoreErrors; - } + ReportError("Already parsed \"" + includelump + "\". Check your " + token + " directives"); + return IgnoreErrors; } - else + + // Add to collection + includes[includecategory].Add(includelumppath); + + // Callback to parse this file + if(OnInclude != null) { - // Add to collections - includes.Add(includelumppath); - - // Callback to parse this file - if(OnInclude != null) - { - IsMapScriptsLump = false; - OnInclude(this, includelumppath, islibrary ? IncludeType.LIBRARY : IncludeType.INCLUDE); - } - - // Bail out on error - if(this.HasError && !IgnoreErrors) return false; - - // Set our buffers back to continue parsing - datastream = localstream; - datareader = localreader; - sourcename = localsourcename; - sourcelumpindex = localsourcelumpindex; //mxd - datalocation = locallocation; //mxd + IsMapScriptsLump = false; + OnInclude(this, includelumppath, (token == "#import" ? IncludeType.LIBRARY : IncludeType.INCLUDE)); } + + // Bail out on error + if(this.HasError && !IgnoreErrors) return false; + + // Set our buffers back to continue parsing + datastream = localstream; + datareader = localreader; + sourcename = localsourcename; + sourcelumpindex = localsourcelumpindex; + datalocation = locallocation; + includecategory = localincludecategory; } break; } @@ -328,6 +331,22 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom return true; } + #endregion + + #region ================== Methods + + internal HashSet GetIncludes() + { + HashSet result = new HashSet(StringComparer.OrdinalIgnoreCase); + foreach(KeyValuePair> group in includes) + { + foreach(string include in group.Value) result.Add(include); + } + + result.ExceptWith(includestoskip); // Remove compiler includes + return result; + } + private List> ParseArgs() //type, name { List> argnames = new List>(); @@ -378,5 +397,6 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom return "(void)"; } + #endregion } } \ No newline at end of file diff --git a/Source/Core/General/MapManager.cs b/Source/Core/General/MapManager.cs index 19649ebe..dc512db9 100644 --- a/Source/Core/General/MapManager.cs +++ b/Source/Core/General/MapManager.cs @@ -2190,7 +2190,7 @@ namespace CodeImp.DoomBuilder // Add them to arrays namedscriptslist.AddRange(parser.NamedScripts); numberedscriptslist.AddRange(parser.NumberedScripts); - scripincludeslist.AddRange(parser.Includes); + scripincludeslist.AddRange(parser.GetIncludes()); // Add to text resource list General.Map.Data.TextResources[parser.ScriptType].UnionWith(parser.TextResources.Values); diff --git a/Source/Core/Rendering/D3DDevice.cs b/Source/Core/Rendering/D3DDevice.cs index 9f6cedba..e808c7a9 100644 --- a/Source/Core/Rendering/D3DDevice.cs +++ b/Source/Core/Rendering/D3DDevice.cs @@ -35,7 +35,13 @@ namespace CodeImp.DoomBuilder.Rendering #region ================== Constants // NVPerfHUD device name - public const string NVPERFHUD_ADAPTER = "NVPerfHUD"; + private const string NVPERFHUD_ADAPTER = "NVPerfHUD"; + + //mxd. Anisotropic filtering steps + public static readonly List AF_STEPS = new List { 1.0f, 2.0f, 4.0f, 8.0f, 16.0f }; + + //mxd. Antialiasing steps + public static readonly List AA_STEPS = new List { 0, 2, 4, 8 }; #endregion @@ -165,6 +171,7 @@ namespace CodeImp.DoomBuilder.Rendering device.SetRenderState(RenderState.FogTableMode, FogMode.Linear); device.SetRenderState(RenderState.Lighting, false); device.SetRenderState(RenderState.LocalViewer, false); + device.SetRenderState(RenderState.MultisampleAntialias, (General.Settings.AntiAliasingSamples > 0)); //mxd device.SetRenderState(RenderState.NormalizeNormals, false); device.SetRenderState(RenderState.PointSpriteEnable, false); device.SetRenderState(RenderState.RangeFogEnable, false); @@ -196,7 +203,7 @@ namespace CodeImp.DoomBuilder.Rendering }; // Shader settings - shaders.World3D.SetConstants(General.Settings.VisualBilinear, General.Settings.FilterAnisotropy); + shaders.World3D.SetConstants(General.Settings.VisualBilinear, Math.Min(devicecaps.MaxAnisotropy, General.Settings.FilterAnisotropy)); // Texture filters postfilter = Filter.Point; @@ -244,6 +251,23 @@ namespace CodeImp.DoomBuilder.Rendering else devtype = DeviceType.Hardware; + //mxd. Check maximum supported AA level... + for(int i = AA_STEPS.Count - 1; i > 0; i--) + { + if(General.Settings.AntiAliasingSamples < AA_STEPS[i]) continue; + if(d3d.CheckDeviceMultisampleType(this.adapter, devtype, d3d.Adapters[adapter].CurrentDisplayMode.Format, displaypp.Windowed, (MultisampleType)AA_STEPS[i])) + break; + + if(General.Settings.AntiAliasingSamples > AA_STEPS[i - 1]) + { + General.Settings.AntiAliasingSamples = AA_STEPS[i - 1]; + + // TODO: looks like setting Multisample here just resets it to MultisampleType.None, + // regardless of value in displaypp.Multisample. Why?.. + displaypp.Multisample = (MultisampleType)General.Settings.AntiAliasingSamples; + } + } + // Get the device capabilities devicecaps = d3d.GetDeviceCaps(adapter, devtype); @@ -328,7 +352,7 @@ namespace CodeImp.DoomBuilder.Rendering displaypp.BackBufferHeight = rendertarget.ClientSize.Height; displaypp.EnableAutoDepthStencil = true; displaypp.AutoDepthStencilFormat = Format.D24X8; //Format.D16; - displaypp.Multisample = MultisampleType.None; + displaypp.Multisample = (MultisampleType)General.Settings.AntiAliasingSamples; displaypp.PresentationInterval = PresentInterval.Immediate; // Return result diff --git a/Source/Core/Rendering/World3DShader.cs b/Source/Core/Rendering/World3DShader.cs index 3e01d30c..d9e486e9 100644 --- a/Source/Core/Rendering/World3DShader.cs +++ b/Source/Core/Rendering/World3DShader.cs @@ -185,8 +185,7 @@ namespace CodeImp.DoomBuilder.Rendering } // Initialize world vertex declaration - VertexElement[] ve = new[] - { + VertexElement[] ve = { new VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0), new VertexElement(0, 12, DeclarationType.Color, DeclarationMethod.Default, DeclarationUsage.Color, 0), new VertexElement(0, 16, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0), @@ -234,20 +233,11 @@ namespace CodeImp.DoomBuilder.Rendering // This sets the constant settings public void SetConstants(bool bilinear, float maxanisotropy) { - if(bilinear) - { - effect.SetValue(magfiltersettings, (int)TextureFilter.Linear); - effect.SetValue(minfiltersettings, (int)TextureFilter.Anisotropic); - effect.SetValue(mipfiltersettings, (int)TextureFilter.Linear); - effect.SetValue(maxanisotropysetting, maxanisotropy); - } - else - { - effect.SetValue(magfiltersettings, (int)TextureFilter.Point); - effect.SetValue(minfiltersettings, (int)TextureFilter.Point); - effect.SetValue(mipfiltersettings, (int)TextureFilter.Linear); - effect.SetValue(maxanisotropysetting, 1.0f); - } + //mxd. It's still nice to have anisotropic filtering when texture filtering is disabled + effect.SetValue(magfiltersettings, (int)(bilinear ? TextureFilter.Linear : TextureFilter.Point)); + effect.SetValue(minfiltersettings, (int)TextureFilter.Anisotropic); + effect.SetValue(mipfiltersettings, (int)TextureFilter.Linear); + effect.SetValue(maxanisotropysetting, maxanisotropy); settingschanged = true; //mxd } diff --git a/Source/Core/Windows/PreferencesForm.Designer.cs b/Source/Core/Windows/PreferencesForm.Designer.cs index 306dd362..78e07387 100644 --- a/Source/Core/Windows/PreferencesForm.Designer.cs +++ b/Source/Core/Windows/PreferencesForm.Designer.cs @@ -38,6 +38,8 @@ namespace CodeImp.DoomBuilder.Windows System.Windows.Forms.Label label18; System.Windows.Forms.Label label20; System.Windows.Forms.Label label21; + System.Windows.Forms.Label label27; + System.Windows.Forms.Label label29; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PreferencesForm)); this.keepfilterfocused = new System.Windows.Forms.CheckBox(); this.checkforupdates = new System.Windows.Forms.CheckBox(); @@ -68,17 +70,17 @@ namespace CodeImp.DoomBuilder.Windows this.color3dFloors = new CodeImp.DoomBuilder.Controls.ColorControl(); this.colorInfo = new CodeImp.DoomBuilder.Controls.ColorControl(); this.colorMD3 = new CodeImp.DoomBuilder.Controls.ColorControl(); - this.doublesidedalpha = new System.Windows.Forms.TrackBar(); this.colorgrid64 = new CodeImp.DoomBuilder.Controls.ColorControl(); this.colorgrid = new CodeImp.DoomBuilder.Controls.ColorControl(); this.colorindication = new CodeImp.DoomBuilder.Controls.ColorControl(); this.colorbackcolor = new CodeImp.DoomBuilder.Controls.ColorControl(); - this.label2 = new System.Windows.Forms.Label(); - this.doublesidedalphalabel = new System.Windows.Forms.Label(); this.colorselection = new CodeImp.DoomBuilder.Controls.ColorControl(); this.colorvertices = new CodeImp.DoomBuilder.Controls.ColorControl(); this.colorhighlight = new CodeImp.DoomBuilder.Controls.ColorControl(); this.colorlinedefs = new CodeImp.DoomBuilder.Controls.ColorControl(); + this.doublesidedalpha = new System.Windows.Forms.TrackBar(); + this.label2 = new System.Windows.Forms.Label(); + this.doublesidedalphalabel = new System.Windows.Forms.Label(); this.cbStretchView = new System.Windows.Forms.CheckBox(); this.qualitydisplay = new System.Windows.Forms.CheckBox(); this.cancel = new System.Windows.Forms.Button(); @@ -137,9 +139,15 @@ namespace CodeImp.DoomBuilder.Windows this.actioncontrolclear = new System.Windows.Forms.Button(); this.actionkey = new System.Windows.Forms.TextBox(); this.tabcolors = new System.Windows.Forms.TabPage(); - this.appearancegroup1 = new System.Windows.Forms.GroupBox(); + this.groupBox10 = new System.Windows.Forms.GroupBox(); this.capitalizetexturenames = new System.Windows.Forms.CheckBox(); + this.blackbrowsers = new System.Windows.Forms.CheckBox(); this.cbMarkExtraFloors = new System.Windows.Forms.CheckBox(); + this.appearancegroup1 = new System.Windows.Forms.GroupBox(); + this.labelantialiasing = new System.Windows.Forms.Label(); + this.antialiasing = new System.Windows.Forms.TrackBar(); + this.labelanisotropicfiltering = new System.Windows.Forms.Label(); + this.anisotropicfiltering = new System.Windows.Forms.TrackBar(); this.cbOldHighlightMode = new System.Windows.Forms.CheckBox(); this.labelDynLightIntensity = new System.Windows.Forms.Label(); this.tbDynLightIntensity = new System.Windows.Forms.TrackBar(); @@ -148,7 +156,6 @@ namespace CodeImp.DoomBuilder.Windows this.labelDynLightCount = new System.Windows.Forms.Label(); this.tbDynLightCount = new System.Windows.Forms.TrackBar(); this.animatevisualselection = new System.Windows.Forms.CheckBox(); - this.blackbrowsers = new System.Windows.Forms.CheckBox(); this.visualbilinear = new System.Windows.Forms.CheckBox(); this.classicbilinear = new System.Windows.Forms.CheckBox(); this.imagebrightnesslabel = new System.Windows.Forms.Label(); @@ -207,6 +214,8 @@ namespace CodeImp.DoomBuilder.Windows label18 = new System.Windows.Forms.Label(); label20 = new System.Windows.Forms.Label(); label21 = new System.Windows.Forms.Label(); + label27 = new System.Windows.Forms.Label(); + label29 = new System.Windows.Forms.Label(); groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.recentFiles)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.vertexScale)).BeginInit(); @@ -229,7 +238,10 @@ namespace CodeImp.DoomBuilder.Windows this.tabkeys.SuspendLayout(); this.actioncontrolpanel.SuspendLayout(); this.tabcolors.SuspendLayout(); + this.groupBox10.SuspendLayout(); this.appearancegroup1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.antialiasing)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.anisotropicfiltering)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightIntensity)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightSize)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightCount)).BeginInit(); @@ -560,7 +572,7 @@ namespace CodeImp.DoomBuilder.Windows // label1 // label1.AutoSize = true; - label1.Location = new System.Drawing.Point(28, 29); + label1.Location = new System.Drawing.Point(22, 70); label1.Name = "label1"; label1.Size = new System.Drawing.Size(143, 13); label1.TabIndex = 20; @@ -570,7 +582,7 @@ namespace CodeImp.DoomBuilder.Windows // label18 // label18.AutoSize = true; - label18.Location = new System.Drawing.Point(22, 63); + label18.Location = new System.Drawing.Point(18, 108); label18.Name = "label18"; label18.Size = new System.Drawing.Size(147, 13); label18.TabIndex = 25; @@ -582,7 +594,7 @@ namespace CodeImp.DoomBuilder.Windows // label20 // label20.AutoSize = true; - label20.Location = new System.Drawing.Point(76, 97); + label20.Location = new System.Drawing.Point(71, 146); label20.Name = "label20"; label20.Size = new System.Drawing.Size(94, 13); label20.TabIndex = 28; @@ -592,13 +604,33 @@ namespace CodeImp.DoomBuilder.Windows // label21 // label21.AutoSize = true; - label21.Location = new System.Drawing.Point(55, 131); + label21.Location = new System.Drawing.Point(51, 184); label21.Name = "label21"; label21.Size = new System.Drawing.Size(114, 13); label21.TabIndex = 31; label21.Text = "Dynamic light intensity:"; label21.TextAlign = System.Drawing.ContentAlignment.TopRight; // + // label27 + // + label27.AutoSize = true; + label27.Location = new System.Drawing.Point(67, 223); + label27.Name = "label27"; + label27.Size = new System.Drawing.Size(98, 13); + label27.TabIndex = 35; + label27.Text = "Anisotropic filtering:"; + label27.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // label29 + // + label29.AutoSize = true; + label29.Location = new System.Drawing.Point(74, 262); + label29.Name = "label29"; + label29.Size = new System.Drawing.Size(91, 13); + label29.TabIndex = 38; + label29.Text = "Edge Antialiasing:"; + label29.TextAlign = System.Drawing.ContentAlignment.TopRight; + // // keyusedlabel // this.keyusedlabel.AutoSize = true; @@ -616,13 +648,10 @@ namespace CodeImp.DoomBuilder.Windows this.colorsgroup1.Controls.Add(this.color3dFloors); this.colorsgroup1.Controls.Add(this.colorInfo); this.colorsgroup1.Controls.Add(this.colorMD3); - this.colorsgroup1.Controls.Add(this.doublesidedalpha); this.colorsgroup1.Controls.Add(this.colorgrid64); this.colorsgroup1.Controls.Add(this.colorgrid); this.colorsgroup1.Controls.Add(this.colorindication); 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.colorhighlight); @@ -632,14 +661,14 @@ namespace CodeImp.DoomBuilder.Windows this.colorsgroup1.Size = new System.Drawing.Size(203, 493); this.colorsgroup1.TabIndex = 0; this.colorsgroup1.TabStop = false; - this.colorsgroup1.Text = " Display "; + this.colorsgroup1.Text = " Colors "; this.colorsgroup1.Visible = false; // // color3dFloors // this.color3dFloors.BackColor = System.Drawing.Color.Transparent; this.color3dFloors.Label = "3D Floors:"; - this.color3dFloors.Location = new System.Drawing.Point(15, 286); + this.color3dFloors.Location = new System.Drawing.Point(15, 307); this.color3dFloors.MaximumSize = new System.Drawing.Size(10000, 23); this.color3dFloors.MinimumSize = new System.Drawing.Size(100, 23); this.color3dFloors.Name = "color3dFloors"; @@ -650,7 +679,7 @@ namespace CodeImp.DoomBuilder.Windows // this.colorInfo.BackColor = System.Drawing.Color.Transparent; this.colorInfo.Label = "Event lines:"; - this.colorInfo.Location = new System.Drawing.Point(15, 260); + this.colorInfo.Location = new System.Drawing.Point(15, 278); this.colorInfo.MaximumSize = new System.Drawing.Size(10000, 23); this.colorInfo.MinimumSize = new System.Drawing.Size(100, 23); this.colorInfo.Name = "colorInfo"; @@ -661,29 +690,18 @@ namespace CodeImp.DoomBuilder.Windows // this.colorMD3.BackColor = System.Drawing.Color.Transparent; this.colorMD3.Label = "Model wireframe:"; - this.colorMD3.Location = new System.Drawing.Point(15, 233); + this.colorMD3.Location = new System.Drawing.Point(15, 249); this.colorMD3.MaximumSize = new System.Drawing.Size(10000, 23); this.colorMD3.MinimumSize = new System.Drawing.Size(100, 23); this.colorMD3.Name = "colorMD3"; this.colorMD3.Size = new System.Drawing.Size(168, 23); this.colorMD3.TabIndex = 17; // - // doublesidedalpha - // - this.doublesidedalpha.BackColor = System.Drawing.SystemColors.Window; - this.doublesidedalpha.LargeChange = 3; - this.doublesidedalpha.Location = new System.Drawing.Point(11, 349); - this.doublesidedalpha.Name = "doublesidedalpha"; - this.doublesidedalpha.Size = new System.Drawing.Size(130, 45); - this.doublesidedalpha.TabIndex = 2; - this.doublesidedalpha.TickStyle = System.Windows.Forms.TickStyle.TopLeft; - this.doublesidedalpha.ValueChanged += new System.EventHandler(this.doublesidedalpha_ValueChanged); - // // colorgrid64 // this.colorgrid64.BackColor = System.Drawing.Color.Transparent; this.colorgrid64.Label = "64 Block grid:"; - this.colorgrid64.Location = new System.Drawing.Point(15, 206); + this.colorgrid64.Location = new System.Drawing.Point(15, 220); this.colorgrid64.MaximumSize = new System.Drawing.Size(10000, 23); this.colorgrid64.MinimumSize = new System.Drawing.Size(100, 23); this.colorgrid64.Name = "colorgrid64"; @@ -694,7 +712,7 @@ namespace CodeImp.DoomBuilder.Windows // this.colorgrid.BackColor = System.Drawing.Color.Transparent; this.colorgrid.Label = "Custom grid:"; - this.colorgrid.Location = new System.Drawing.Point(15, 179); + this.colorgrid.Location = new System.Drawing.Point(15, 191); this.colorgrid.MaximumSize = new System.Drawing.Size(10000, 23); this.colorgrid.MinimumSize = new System.Drawing.Size(100, 23); this.colorgrid.Name = "colorgrid"; @@ -705,7 +723,7 @@ namespace CodeImp.DoomBuilder.Windows // this.colorindication.BackColor = System.Drawing.Color.Transparent; this.colorindication.Label = "Indications:"; - this.colorindication.Location = new System.Drawing.Point(15, 152); + this.colorindication.Location = new System.Drawing.Point(15, 162); this.colorindication.MaximumSize = new System.Drawing.Size(10000, 23); this.colorindication.MinimumSize = new System.Drawing.Size(100, 23); this.colorindication.Name = "colorindication"; @@ -723,30 +741,11 @@ namespace CodeImp.DoomBuilder.Windows this.colorbackcolor.Size = new System.Drawing.Size(168, 23); this.colorbackcolor.TabIndex = 0; // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(14, 328); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(141, 13); - this.label2.TabIndex = 14; - this.label2.Text = "Passable lines transparency:"; - this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // doublesidedalphalabel - // - this.doublesidedalphalabel.AutoSize = true; - this.doublesidedalphalabel.Location = new System.Drawing.Point(147, 361); - this.doublesidedalphalabel.Name = "doublesidedalphalabel"; - this.doublesidedalphalabel.Size = new System.Drawing.Size(21, 13); - this.doublesidedalphalabel.TabIndex = 16; - this.doublesidedalphalabel.Text = "0%"; - // // colorselection // this.colorselection.BackColor = System.Drawing.Color.Transparent; this.colorselection.Label = "Selection:"; - this.colorselection.Location = new System.Drawing.Point(15, 125); + this.colorselection.Location = new System.Drawing.Point(15, 133); this.colorselection.MaximumSize = new System.Drawing.Size(10000, 23); this.colorselection.MinimumSize = new System.Drawing.Size(100, 23); this.colorselection.Name = "colorselection"; @@ -757,7 +756,7 @@ namespace CodeImp.DoomBuilder.Windows // this.colorvertices.BackColor = System.Drawing.Color.Transparent; this.colorvertices.Label = "Vertices:"; - this.colorvertices.Location = new System.Drawing.Point(15, 44); + this.colorvertices.Location = new System.Drawing.Point(15, 46); this.colorvertices.MaximumSize = new System.Drawing.Size(10000, 23); this.colorvertices.MinimumSize = new System.Drawing.Size(100, 23); this.colorvertices.Name = "colorvertices"; @@ -768,7 +767,7 @@ namespace CodeImp.DoomBuilder.Windows // this.colorhighlight.BackColor = System.Drawing.Color.Transparent; this.colorhighlight.Label = "Highlight:"; - this.colorhighlight.Location = new System.Drawing.Point(15, 98); + this.colorhighlight.Location = new System.Drawing.Point(15, 104); this.colorhighlight.MaximumSize = new System.Drawing.Size(10000, 23); this.colorhighlight.MinimumSize = new System.Drawing.Size(100, 23); this.colorhighlight.Name = "colorhighlight"; @@ -779,17 +778,47 @@ namespace CodeImp.DoomBuilder.Windows // this.colorlinedefs.BackColor = System.Drawing.Color.Transparent; this.colorlinedefs.Label = "Common lines:"; - this.colorlinedefs.Location = new System.Drawing.Point(15, 71); + this.colorlinedefs.Location = new System.Drawing.Point(15, 75); this.colorlinedefs.MaximumSize = new System.Drawing.Size(10000, 23); this.colorlinedefs.MinimumSize = new System.Drawing.Size(100, 23); this.colorlinedefs.Name = "colorlinedefs"; this.colorlinedefs.Size = new System.Drawing.Size(168, 23); this.colorlinedefs.TabIndex = 2; // + // doublesidedalpha + // + this.doublesidedalpha.BackColor = System.Drawing.SystemColors.Window; + this.doublesidedalpha.LargeChange = 3; + this.doublesidedalpha.Location = new System.Drawing.Point(176, 19); + this.doublesidedalpha.Name = "doublesidedalpha"; + this.doublesidedalpha.Size = new System.Drawing.Size(153, 45); + this.doublesidedalpha.TabIndex = 2; + this.doublesidedalpha.TickStyle = System.Windows.Forms.TickStyle.TopLeft; + this.doublesidedalpha.ValueChanged += new System.EventHandler(this.doublesidedalpha_ValueChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(24, 30); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(141, 13); + this.label2.TabIndex = 14; + this.label2.Text = "Passable lines transparency:"; + this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // doublesidedalphalabel + // + this.doublesidedalphalabel.AutoSize = true; + this.doublesidedalphalabel.Location = new System.Drawing.Point(337, 30); + this.doublesidedalphalabel.Name = "doublesidedalphalabel"; + this.doublesidedalphalabel.Size = new System.Drawing.Size(21, 13); + this.doublesidedalphalabel.TabIndex = 16; + this.doublesidedalphalabel.Text = "0%"; + // // cbStretchView // this.cbStretchView.AutoSize = true; - this.cbStretchView.Location = new System.Drawing.Point(236, 170); + this.cbStretchView.Location = new System.Drawing.Point(236, 306); this.cbStretchView.Name = "cbStretchView"; this.cbStretchView.Size = new System.Drawing.Size(172, 17); this.cbStretchView.TabIndex = 18; @@ -801,7 +830,7 @@ namespace CodeImp.DoomBuilder.Windows // qualitydisplay // this.qualitydisplay.AutoSize = true; - this.qualitydisplay.Location = new System.Drawing.Point(25, 191); + this.qualitydisplay.Location = new System.Drawing.Point(25, 306); this.qualitydisplay.Name = "qualitydisplay"; this.qualitydisplay.Size = new System.Drawing.Size(128, 17); this.qualitydisplay.TabIndex = 7; @@ -1451,6 +1480,7 @@ namespace CodeImp.DoomBuilder.Windows // // tabcolors // + this.tabcolors.Controls.Add(this.groupBox10); this.tabcolors.Controls.Add(this.appearancegroup1); this.tabcolors.Controls.Add(this.colorsgroup1); this.tabcolors.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -1462,43 +1492,22 @@ namespace CodeImp.DoomBuilder.Windows this.tabcolors.Text = "Appearance"; this.tabcolors.UseVisualStyleBackColor = true; // - // appearancegroup1 + // groupBox10 // - this.appearancegroup1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.appearancegroup1.Controls.Add(this.capitalizetexturenames); - this.appearancegroup1.Controls.Add(this.cbMarkExtraFloors); - this.appearancegroup1.Controls.Add(this.cbOldHighlightMode); - this.appearancegroup1.Controls.Add(label21); - this.appearancegroup1.Controls.Add(this.labelDynLightIntensity); - this.appearancegroup1.Controls.Add(this.cbStretchView); - 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); - this.appearancegroup1.Controls.Add(this.labelDynLightCount); - this.appearancegroup1.Controls.Add(this.tbDynLightCount); - this.appearancegroup1.Controls.Add(this.animatevisualselection); - this.appearancegroup1.Controls.Add(this.blackbrowsers); - this.appearancegroup1.Controls.Add(this.visualbilinear); - this.appearancegroup1.Controls.Add(label1); - this.appearancegroup1.Controls.Add(this.classicbilinear); - this.appearancegroup1.Controls.Add(this.imagebrightnesslabel); - this.appearancegroup1.Controls.Add(this.imagebrightness); - this.appearancegroup1.Location = new System.Drawing.Point(217, 14); - this.appearancegroup1.Name = "appearancegroup1"; - this.appearancegroup1.Size = new System.Drawing.Size(457, 487); - this.appearancegroup1.TabIndex = 24; - this.appearancegroup1.TabStop = false; - this.appearancegroup1.Text = " Additional Options "; + this.groupBox10.Controls.Add(this.capitalizetexturenames); + this.groupBox10.Controls.Add(this.blackbrowsers); + this.groupBox10.Controls.Add(this.cbMarkExtraFloors); + this.groupBox10.Location = new System.Drawing.Point(217, 388); + this.groupBox10.Name = "groupBox10"; + this.groupBox10.Size = new System.Drawing.Size(457, 113); + this.groupBox10.TabIndex = 25; + this.groupBox10.TabStop = false; + this.groupBox10.Text = " Additional Options "; // // capitalizetexturenames // this.capitalizetexturenames.AutoSize = true; - this.capitalizetexturenames.Location = new System.Drawing.Point(236, 191); + this.capitalizetexturenames.Location = new System.Drawing.Point(25, 75); this.capitalizetexturenames.Name = "capitalizetexturenames"; this.capitalizetexturenames.Size = new System.Drawing.Size(140, 17); this.capitalizetexturenames.TabIndex = 36; @@ -1507,10 +1516,20 @@ namespace CodeImp.DoomBuilder.Windows "2 behaviour)"); this.capitalizetexturenames.UseVisualStyleBackColor = true; // + // blackbrowsers + // + this.blackbrowsers.AutoSize = true; + this.blackbrowsers.Location = new System.Drawing.Point(25, 29); + this.blackbrowsers.Name = "blackbrowsers"; + this.blackbrowsers.Size = new System.Drawing.Size(195, 17); + this.blackbrowsers.TabIndex = 4; + this.blackbrowsers.Text = "Black background in image browser"; + this.blackbrowsers.UseVisualStyleBackColor = true; + // // cbMarkExtraFloors // this.cbMarkExtraFloors.AutoSize = true; - this.cbMarkExtraFloors.Location = new System.Drawing.Point(25, 254); + this.cbMarkExtraFloors.Location = new System.Drawing.Point(25, 52); this.cbMarkExtraFloors.Name = "cbMarkExtraFloors"; this.cbMarkExtraFloors.Size = new System.Drawing.Size(175, 17); this.cbMarkExtraFloors.TabIndex = 35; @@ -1519,10 +1538,93 @@ namespace CodeImp.DoomBuilder.Windows " color."); this.cbMarkExtraFloors.UseVisualStyleBackColor = true; // + // appearancegroup1 + // + this.appearancegroup1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.appearancegroup1.Controls.Add(label29); + this.appearancegroup1.Controls.Add(this.labelantialiasing); + this.appearancegroup1.Controls.Add(this.antialiasing); + this.appearancegroup1.Controls.Add(label27); + this.appearancegroup1.Controls.Add(this.labelanisotropicfiltering); + this.appearancegroup1.Controls.Add(this.anisotropicfiltering); + this.appearancegroup1.Controls.Add(this.cbOldHighlightMode); + this.appearancegroup1.Controls.Add(label21); + this.appearancegroup1.Controls.Add(this.labelDynLightIntensity); + this.appearancegroup1.Controls.Add(this.doublesidedalpha); + this.appearancegroup1.Controls.Add(this.cbStretchView); + this.appearancegroup1.Controls.Add(this.tbDynLightIntensity); + this.appearancegroup1.Controls.Add(label20); + this.appearancegroup1.Controls.Add(this.doublesidedalphalabel); + this.appearancegroup1.Controls.Add(this.qualitydisplay); + this.appearancegroup1.Controls.Add(this.labelDynLightSize); + this.appearancegroup1.Controls.Add(this.label2); + this.appearancegroup1.Controls.Add(this.tbDynLightSize); + this.appearancegroup1.Controls.Add(label18); + this.appearancegroup1.Controls.Add(this.labelDynLightCount); + this.appearancegroup1.Controls.Add(this.tbDynLightCount); + this.appearancegroup1.Controls.Add(this.animatevisualselection); + this.appearancegroup1.Controls.Add(this.visualbilinear); + this.appearancegroup1.Controls.Add(label1); + this.appearancegroup1.Controls.Add(this.classicbilinear); + this.appearancegroup1.Controls.Add(this.imagebrightnesslabel); + this.appearancegroup1.Controls.Add(this.imagebrightness); + this.appearancegroup1.Location = new System.Drawing.Point(217, 8); + this.appearancegroup1.Name = "appearancegroup1"; + this.appearancegroup1.Size = new System.Drawing.Size(457, 374); + this.appearancegroup1.TabIndex = 24; + this.appearancegroup1.TabStop = false; + this.appearancegroup1.Text = " Rendering "; + // + // labelantialiasing + // + this.labelantialiasing.AutoSize = true; + this.labelantialiasing.Location = new System.Drawing.Point(337, 262); + this.labelantialiasing.Name = "labelantialiasing"; + this.labelantialiasing.Size = new System.Drawing.Size(54, 13); + this.labelantialiasing.TabIndex = 39; + this.labelantialiasing.Text = "8 samples"; + // + // antialiasing + // + this.antialiasing.BackColor = System.Drawing.SystemColors.Window; + this.antialiasing.LargeChange = 1; + this.antialiasing.Location = new System.Drawing.Point(176, 252); + this.antialiasing.Maximum = 3; + this.antialiasing.Name = "antialiasing"; + this.antialiasing.Size = new System.Drawing.Size(154, 45); + this.antialiasing.TabIndex = 37; + this.antialiasing.TickStyle = System.Windows.Forms.TickStyle.TopLeft; + this.antialiasing.Value = 3; + this.antialiasing.ValueChanged += new System.EventHandler(this.antialiasing_ValueChanged); + // + // labelanisotropicfiltering + // + this.labelanisotropicfiltering.AutoSize = true; + this.labelanisotropicfiltering.Location = new System.Drawing.Point(337, 223); + this.labelanisotropicfiltering.Name = "labelanisotropicfiltering"; + this.labelanisotropicfiltering.Size = new System.Drawing.Size(24, 13); + this.labelanisotropicfiltering.TabIndex = 36; + this.labelanisotropicfiltering.Text = "16x"; + // + // anisotropicfiltering + // + this.anisotropicfiltering.BackColor = System.Drawing.SystemColors.Window; + this.anisotropicfiltering.LargeChange = 1; + this.anisotropicfiltering.Location = new System.Drawing.Point(176, 213); + this.anisotropicfiltering.Maximum = 4; + this.anisotropicfiltering.Name = "anisotropicfiltering"; + this.anisotropicfiltering.Size = new System.Drawing.Size(154, 45); + this.anisotropicfiltering.TabIndex = 34; + this.anisotropicfiltering.TickStyle = System.Windows.Forms.TickStyle.TopLeft; + this.anisotropicfiltering.Value = 4; + this.anisotropicfiltering.ValueChanged += new System.EventHandler(this.anisotropicfiltering_ValueChanged); + // // cbOldHighlightMode // this.cbOldHighlightMode.AutoSize = true; - this.cbOldHighlightMode.Location = new System.Drawing.Point(236, 233); + this.cbOldHighlightMode.Location = new System.Drawing.Point(236, 348); this.cbOldHighlightMode.Name = "cbOldHighlightMode"; this.cbOldHighlightMode.Size = new System.Drawing.Size(207, 17); this.cbOldHighlightMode.TabIndex = 33; @@ -1534,7 +1636,7 @@ namespace CodeImp.DoomBuilder.Windows // labelDynLightIntensity // this.labelDynLightIntensity.AutoSize = true; - this.labelDynLightIntensity.Location = new System.Drawing.Point(337, 129); + this.labelDynLightIntensity.Location = new System.Drawing.Point(337, 184); this.labelDynLightIntensity.Name = "labelDynLightIntensity"; this.labelDynLightIntensity.Size = new System.Drawing.Size(22, 13); this.labelDynLightIntensity.TabIndex = 32; @@ -1544,7 +1646,7 @@ namespace CodeImp.DoomBuilder.Windows // this.tbDynLightIntensity.BackColor = System.Drawing.SystemColors.Window; this.tbDynLightIntensity.LargeChange = 1; - this.tbDynLightIntensity.Location = new System.Drawing.Point(176, 119); + this.tbDynLightIntensity.Location = new System.Drawing.Point(176, 174); this.tbDynLightIntensity.Minimum = 1; this.tbDynLightIntensity.Name = "tbDynLightIntensity"; this.tbDynLightIntensity.Size = new System.Drawing.Size(154, 45); @@ -1556,7 +1658,7 @@ namespace CodeImp.DoomBuilder.Windows // labelDynLightSize // this.labelDynLightSize.AutoSize = true; - this.labelDynLightSize.Location = new System.Drawing.Point(337, 96); + this.labelDynLightSize.Location = new System.Drawing.Point(337, 146); this.labelDynLightSize.Name = "labelDynLightSize"; this.labelDynLightSize.Size = new System.Drawing.Size(22, 13); this.labelDynLightSize.TabIndex = 29; @@ -1566,7 +1668,7 @@ namespace CodeImp.DoomBuilder.Windows // this.tbDynLightSize.BackColor = System.Drawing.SystemColors.Window; this.tbDynLightSize.LargeChange = 1; - this.tbDynLightSize.Location = new System.Drawing.Point(176, 85); + this.tbDynLightSize.Location = new System.Drawing.Point(176, 136); this.tbDynLightSize.Maximum = 20; this.tbDynLightSize.Minimum = 1; this.tbDynLightSize.Name = "tbDynLightSize"; @@ -1579,7 +1681,7 @@ namespace CodeImp.DoomBuilder.Windows // labelDynLightCount // this.labelDynLightCount.AutoSize = true; - this.labelDynLightCount.Location = new System.Drawing.Point(337, 62); + this.labelDynLightCount.Location = new System.Drawing.Point(337, 108); this.labelDynLightCount.Name = "labelDynLightCount"; this.labelDynLightCount.Size = new System.Drawing.Size(19, 13); this.labelDynLightCount.TabIndex = 26; @@ -1589,7 +1691,7 @@ namespace CodeImp.DoomBuilder.Windows // this.tbDynLightCount.BackColor = System.Drawing.SystemColors.Window; this.tbDynLightCount.LargeChange = 3; - this.tbDynLightCount.Location = new System.Drawing.Point(176, 51); + this.tbDynLightCount.Location = new System.Drawing.Point(176, 97); this.tbDynLightCount.Maximum = 32; this.tbDynLightCount.Minimum = 1; this.tbDynLightCount.Name = "tbDynLightCount"; @@ -1603,27 +1705,17 @@ namespace CodeImp.DoomBuilder.Windows // animatevisualselection // this.animatevisualselection.AutoSize = true; - this.animatevisualselection.Location = new System.Drawing.Point(236, 212); + this.animatevisualselection.Location = new System.Drawing.Point(236, 327); this.animatevisualselection.Name = "animatevisualselection"; this.animatevisualselection.Size = new System.Drawing.Size(184, 17); this.animatevisualselection.TabIndex = 23; this.animatevisualselection.Text = "Animate selection in visual modes"; this.animatevisualselection.UseVisualStyleBackColor = true; // - // blackbrowsers - // - this.blackbrowsers.AutoSize = true; - this.blackbrowsers.Location = new System.Drawing.Point(25, 170); - this.blackbrowsers.Name = "blackbrowsers"; - this.blackbrowsers.Size = new System.Drawing.Size(195, 17); - this.blackbrowsers.TabIndex = 4; - this.blackbrowsers.Text = "Black background in image browser"; - this.blackbrowsers.UseVisualStyleBackColor = true; - // // visualbilinear // this.visualbilinear.AutoSize = true; - this.visualbilinear.Location = new System.Drawing.Point(25, 233); + this.visualbilinear.Location = new System.Drawing.Point(25, 348); this.visualbilinear.Name = "visualbilinear"; this.visualbilinear.Size = new System.Drawing.Size(171, 17); this.visualbilinear.TabIndex = 6; @@ -1633,7 +1725,7 @@ namespace CodeImp.DoomBuilder.Windows // classicbilinear // this.classicbilinear.AutoSize = true; - this.classicbilinear.Location = new System.Drawing.Point(25, 212); + this.classicbilinear.Location = new System.Drawing.Point(25, 327); this.classicbilinear.Name = "classicbilinear"; this.classicbilinear.Size = new System.Drawing.Size(176, 17); this.classicbilinear.TabIndex = 5; @@ -1643,7 +1735,7 @@ namespace CodeImp.DoomBuilder.Windows // imagebrightnesslabel // this.imagebrightnesslabel.AutoSize = true; - this.imagebrightnesslabel.Location = new System.Drawing.Point(337, 29); + this.imagebrightnesslabel.Location = new System.Drawing.Point(337, 70); this.imagebrightnesslabel.Name = "imagebrightnesslabel"; this.imagebrightnesslabel.Size = new System.Drawing.Size(30, 13); this.imagebrightnesslabel.TabIndex = 22; @@ -1653,7 +1745,7 @@ namespace CodeImp.DoomBuilder.Windows // this.imagebrightness.BackColor = System.Drawing.SystemColors.Window; this.imagebrightness.LargeChange = 3; - this.imagebrightness.Location = new System.Drawing.Point(176, 18); + this.imagebrightness.Location = new System.Drawing.Point(176, 58); this.imagebrightness.Name = "imagebrightness"; this.imagebrightness.Size = new System.Drawing.Size(154, 45); this.imagebrightness.TabIndex = 3; @@ -2245,7 +2337,6 @@ namespace CodeImp.DoomBuilder.Windows ((System.ComponentModel.ISupportInitialize)(this.autoscrollspeed)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.previewsize)).EndInit(); this.colorsgroup1.ResumeLayout(false); - this.colorsgroup1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.doublesidedalpha)).EndInit(); this.tabs.ResumeLayout(false); this.tabinterface.ResumeLayout(false); @@ -2267,8 +2358,12 @@ namespace CodeImp.DoomBuilder.Windows this.actioncontrolpanel.ResumeLayout(false); this.actioncontrolpanel.PerformLayout(); this.tabcolors.ResumeLayout(false); + this.groupBox10.ResumeLayout(false); + this.groupBox10.PerformLayout(); this.appearancegroup1.ResumeLayout(false); this.appearancegroup1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.antialiasing)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.anisotropicfiltering)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightIntensity)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightSize)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbDynLightCount)).EndInit(); @@ -2450,5 +2545,10 @@ namespace CodeImp.DoomBuilder.Windows private System.Windows.Forms.Label label23; private CodeImp.DoomBuilder.Controls.ColorControl colorproperties; private System.Windows.Forms.CheckBox keepfilterfocused; + private System.Windows.Forms.GroupBox groupBox10; + private System.Windows.Forms.Label labelantialiasing; + private System.Windows.Forms.TrackBar antialiasing; + private System.Windows.Forms.Label labelanisotropicfiltering; + private System.Windows.Forms.TrackBar anisotropicfiltering; } } \ No newline at end of file diff --git a/Source/Core/Windows/PreferencesForm.cs b/Source/Core/Windows/PreferencesForm.cs index 78a53fb6..9b957880 100644 --- a/Source/Core/Windows/PreferencesForm.cs +++ b/Source/Core/Windows/PreferencesForm.cs @@ -110,6 +110,10 @@ namespace CodeImp.DoomBuilder.Windows if(Directory.Exists(General.Settings.ScreenshotsPath)) browseScreenshotsFolderDialog.SelectedPath = General.Settings.ScreenshotsPath; + //mxd. Anisotropic filtering + anisotropicfiltering.Value = Math.Max(D3DDevice.AF_STEPS.IndexOf(General.Settings.FilterAnisotropy), 0); //mxd + antialiasing.Value = Math.Max(D3DDevice.AA_STEPS.IndexOf(General.Settings.AntiAliasingSamples), 0); //mxd + //mxd. Script editor scriptfontbold.Checked = General.Settings.ScriptFontBold; scriptontop.Checked = General.Settings.ScriptOnTop; @@ -359,6 +363,8 @@ namespace CodeImp.DoomBuilder.Windows General.Settings.GZMaxDynamicLights = tbDynLightCount.Value; General.Settings.GZDynamicLightRadius = (tbDynLightSize.Value / 10.0f); General.Settings.GZDynamicLightIntensity = (tbDynLightIntensity.Value / 10.0f); + General.Settings.FilterAnisotropy = D3DDevice.AF_STEPS[anisotropicfiltering.Value]; + General.Settings.AntiAliasingSamples = D3DDevice.AA_STEPS[antialiasing.Value]; General.Settings.GZStretchView = cbStretchView.Checked; General.Settings.GZVertexScale2D = vertexScale.Value; General.Settings.GZOldHighlightMode = cbOldHighlightMode.Checked; @@ -945,6 +951,18 @@ namespace CodeImp.DoomBuilder.Windows labelDynLightIntensity.Text = ((float)tbDynLightIntensity.Value / 10).ToString(); } + //mxd + private void anisotropicfiltering_ValueChanged(object sender, EventArgs e) + { + labelanisotropicfiltering.Text = anisotropicfiltering.Value == 0 ? "None" : (int)D3DDevice.AF_STEPS[anisotropicfiltering.Value] + "x"; + } + + //mxd + private void antialiasing_ValueChanged(object sender, EventArgs e) + { + labelantialiasing.Text = (antialiasing.Value == 0 ? "None" : D3DDevice.AA_STEPS[antialiasing.Value] + " samples"); + } + #endregion #region ================== Script Editor Panel (mxd) diff --git a/Source/Core/Windows/PreferencesForm.resx b/Source/Core/Windows/PreferencesForm.resx index cd44cfbe..3f24db5b 100644 --- a/Source/Core/Windows/PreferencesForm.resx +++ b/Source/Core/Windows/PreferencesForm.resx @@ -144,6 +144,12 @@ False + + False + + + False + When enabled, the opening brace will be placed on a new line when diff --git a/Source/Core/ZDoom/ZDTextParser.cs b/Source/Core/ZDoom/ZDTextParser.cs index 7c11110f..dce9880d 100644 --- a/Source/Core/ZDoom/ZDTextParser.cs +++ b/Source/Core/ZDoom/ZDTextParser.cs @@ -99,13 +99,15 @@ namespace CodeImp.DoomBuilder.ZDoom //mxd. This parses the given decorate stream. Returns false on errors public virtual bool Parse(TextResourceData parsedata, bool clearerrors) { - //mxd. Clear error status? + // Clear error status? if(clearerrors) ClearError(); - - //mxd. Integrity checks + + // Integrity checks + // INFO: MapManager.CompileLump() prepends lumpname with "?" to distinguish between temporary files and files compiled in place + // We don't want this to show up in error messages if(parsedata.Stream == null) { - ReportError("Unable to load \"" + parsedata.Filename + "\""); + ReportError("Unable to load \"" + parsedata.Filename.Replace("?", "") + "\""); return false; } @@ -113,7 +115,7 @@ namespace CodeImp.DoomBuilder.ZDoom { if(!string.IsNullOrEmpty(sourcename) && sourcename != parsedata.Filename) { - LogWarning("Include file \"" + parsedata.Filename + "\" is empty"); + LogWarning("Include file \"" + parsedata.Filename.Replace("?", "") + "\" is empty"); } else { @@ -125,8 +127,8 @@ namespace CodeImp.DoomBuilder.ZDoom datastream = parsedata.Stream; datareader = new BinaryReader(parsedata.Stream, Encoding.ASCII); sourcename = parsedata.Filename; - sourcelumpindex = parsedata.LumpIndex; //mxd - datalocation = parsedata.SourceLocation; //mxd + sourcelumpindex = parsedata.LumpIndex; + datalocation = parsedata.SourceLocation; datastream.Seek(0, SeekOrigin.Begin); return true; @@ -154,8 +156,9 @@ namespace CodeImp.DoomBuilder.ZDoom { Resource = parsedata.Source, Entries = new HashSet(StringComparer.OrdinalIgnoreCase), - Filename = parsedata.Filename, - LumpIndex = parsedata.LumpIndex + Filename = parsedata.Filename.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar), + LumpIndex = parsedata.LumpIndex, + ScriptType = this.ScriptType, }; textresources.Add(textresourcepath, res); @@ -659,7 +662,7 @@ namespace CodeImp.DoomBuilder.ZDoom //mxd if(ScriptType == ScriptType.ACS && sourcename.StartsWith("?")) { - shorterrorsource = sourcename; + shorterrorsource = sourcename.Substring(1); errorsource = sourcename; } else diff --git a/Source/Plugins/BuilderModes/ErrorChecks/CheckPolyobjects.cs b/Source/Plugins/BuilderModes/ErrorChecks/CheckPolyobjects.cs index 42b6e743..a70153d7 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/CheckPolyobjects.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/CheckPolyobjects.cs @@ -125,8 +125,13 @@ namespace CodeImp.DoomBuilder.BuilderModes foreach(Linedef linedef in linesbytype.Value) { // The value of 0 can mean either "No mirror polyobj" or "Polyobj 0" here... - if(linedef.Args[1] > 0 && !startspots.ContainsKey(linedef.Args[1])) - SubmitResult(new ResultInvalidPolyobjectLines(new List { linedef }, "\"" + Polyobj_StartLine + "\" action have non-existing Mirror Polyobject Number assigned (" + linedef.Args[1] + "). It won't function correctly ingame.")); + if(linedef.Args[1] > 0) + { + if(!startspots.ContainsKey(linedef.Args[1])) + SubmitResult(new ResultInvalidPolyobjectLines(new List { linedef }, "\"" + Polyobj_StartLine + "\" action have non-existing Mirror Polyobject Number assigned (" + linedef.Args[1] + "). It won't function correctly ingame.")); + if(linedef.Args[1] == linedef.Args[0]) + SubmitResult(new ResultInvalidPolyobjectLines(new List { linedef }, "\"" + Polyobj_StartLine + "\" action have the same Polyobject and Mirror Polyobject numbers assigned (" + linedef.Args[1] + "). It won't function correctly ingame.")); + } } } } diff --git a/Source/Plugins/BuilderModes/VisualModes/Effect3DFloor.cs b/Source/Plugins/BuilderModes/VisualModes/Effect3DFloor.cs index 26c00785..0fe1e0c1 100644 --- a/Source/Plugins/BuilderModes/VisualModes/Effect3DFloor.cs +++ b/Source/Plugins/BuilderModes/VisualModes/Effect3DFloor.cs @@ -63,7 +63,9 @@ namespace CodeImp.DoomBuilder.BuilderModes IgnoreBottomHeight = 8, UseUpperTexture = 16, UseLowerTexture = 32, - RenderAdditive = 64 + RenderAdditive = 64, + Fade = 512, + ResetLighting = 1024, } //mxd. 3D-Floor Types @@ -173,6 +175,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { bool disablelighting = ((linedef.Args[2] & (int)Flags.DisableLighting) == (int)Flags.DisableLighting); //mxd bool restrictlighting = ((linedef.Args[2] & (int)Flags.RestrictLighting) == (int)Flags.RestrictLighting); //mxd + floor.resetlighting = ((linedef.Args[2] & (int)Flags.ResetLighting) == (int)Flags.ResetLighting); //mxd if(disablelighting || restrictlighting) { diff --git a/Source/Plugins/BuilderModes/VisualModes/SectorData.cs b/Source/Plugins/BuilderModes/VisualModes/SectorData.cs index 05b6e98f..07148ca6 100644 --- a/Source/Plugins/BuilderModes/VisualModes/SectorData.cs +++ b/Source/Plugins/BuilderModes/VisualModes/SectorData.cs @@ -315,6 +315,10 @@ namespace CodeImp.DoomBuilder.BuilderModes //mxd. Store a copy of initial settings floor.CopyProperties(floorbase); ceiling.CopyProperties(ceilingbase); + + //mxd. We need sector brightness here, unaffected by custom ceiling brightness... + ceilingbase.brightnessbelow = sector.Brightness; + ceilingbase.color = PixelColor.FromInt(mode.CalculateBrightness(sector.Brightness)).WithAlpha(255).ToInt(); } //mxd @@ -426,13 +430,12 @@ namespace CodeImp.DoomBuilder.BuilderModes // Use stored light level when previous one has "disablelighting" flag // or is the lower boundary of an extrafloor with "restrictlighting" flag SectorLevel src = (pl.disablelighting || (pl.restrictlighting && pl.type == SectorLevelType.Ceiling) ? stored : pl); - - if((src == l) || (src == ceiling && l == floor && src.LightPropertiesMatch(ceilingbase))) - { - // Don't change anything when light properties were reset before hitting floor - // (otherwise floor UDMF brightness will be lost) + + // Don't change real ceiling light when previous level has "disablelighting" flag + // Don't change anything when light properties were reset before hitting floor (otherwise floor UDMF brightness will be lost) + if((src == ceilingbase && l == ceiling) + || (src == ceiling && l == floor && src.LightPropertiesMatch(ceilingbase))) continue; - } // Transfer color and brightness if previous level has them if(src.colorbelow.a > 0 && src.brightnessbelow != -1) @@ -456,6 +459,9 @@ namespace CodeImp.DoomBuilder.BuilderModes // Store bottom extrafloor level if it doesn't have "restrictlighting" or "restrictlighting" flags set if(l.extrafloor && l.type == SectorLevelType.Ceiling && !l.restrictlighting && !l.disablelighting) stored = l; } + + // Reset lighting? + if(l.resetlighting) stored = ceilingbase; } } diff --git a/Source/Plugins/BuilderModes/VisualModes/SectorLevel.cs b/Source/Plugins/BuilderModes/VisualModes/SectorLevel.cs index 22b42f4b..b282116c 100644 --- a/Source/Plugins/BuilderModes/VisualModes/SectorLevel.cs +++ b/Source/Plugins/BuilderModes/VisualModes/SectorLevel.cs @@ -35,6 +35,7 @@ namespace CodeImp.DoomBuilder.BuilderModes public PixelColor colorbelow; public bool disablelighting; //mxd public bool restrictlighting; //mxd + public bool resetlighting; //mxd public bool affectedbyglow; //mxd public bool extrafloor; //mxd public bool splitsides; //mxd @@ -68,6 +69,7 @@ namespace CodeImp.DoomBuilder.BuilderModes target.affectedbyglow = this.affectedbyglow; //mxd target.disablelighting = this.disablelighting; //mxd target.restrictlighting = this.restrictlighting; //mxd + target.resetlighting = this.resetlighting; //mxd target.splitsides = this.splitsides; //mxd } @@ -76,7 +78,8 @@ namespace CodeImp.DoomBuilder.BuilderModes { return (this.type == other.type && this.lighttype == other.lighttype && this.alpha == other.alpha && this.splitsides == other.splitsides && this.color == other.color && this.brightnessbelow == other.brightnessbelow && this.colorbelow.ToInt() == other.colorbelow.ToInt() - && this.disablelighting == other.disablelighting && this.restrictlighting == other.restrictlighting); + && this.disablelighting == other.disablelighting && this.restrictlighting == other.restrictlighting + && this.resetlighting == other.resetlighting); } #if DEBUG diff --git a/Source/Plugins/BuilderModes/VisualModes/SectorLevelComparer.cs b/Source/Plugins/BuilderModes/VisualModes/SectorLevelComparer.cs index e714a9eb..276d59f1 100644 --- a/Source/Plugins/BuilderModes/VisualModes/SectorLevelComparer.cs +++ b/Source/Plugins/BuilderModes/VisualModes/SectorLevelComparer.cs @@ -24,24 +24,40 @@ namespace CodeImp.DoomBuilder.BuilderModes public int Compare(SectorLevel x, SectorLevel y) { if(x == y) return 0; //mxd + + //mxd. Handle surfaces with the same height float diff = (float)Math.Round(x.plane.GetZ(center) - y.plane.GetZ(center), 3); if(diff == 0) { - //mxd. Push extrafloors above extraceilings - if(x.extrafloor && y.extrafloor && x.lighttype == LightLevelType.UNKNOWN && y.lighttype == LightLevelType.UNKNOWN) - { - if(x.type == SectorLevelType.Floor) return (y.type == SectorLevelType.Ceiling ? 1 : 0); - return (y.type == SectorLevelType.Floor ? -1 : 0); - } - bool xislight = (x.type == SectorLevelType.Light || x.type == SectorLevelType.Glow); bool yislight = (y.type == SectorLevelType.Light || y.type == SectorLevelType.Glow); + + // Compare regular and extrafloors + if(!xislight && ! yislight && x.lighttype == LightLevelType.UNKNOWN && y.lighttype == LightLevelType.UNKNOWN) + { + // Both are 3d floors. Push extrafloors above extraceilings + if(x.extrafloor && y.extrafloor) + { + if(x.type == SectorLevelType.Floor) return (y.type == SectorLevelType.Ceiling ? 1 : 0); + return (y.type == SectorLevelType.Floor ? -1 : 0); + } + + // None is 3d floor. Push ceilings above floors + if(!x.extrafloor && !y.extrafloor) + { + if(x.type == SectorLevelType.Floor) return (y.type == SectorLevelType.Ceiling ? -1 : 0); + return (y.type == SectorLevelType.Floor ? 1 : 0); + } + + // One is 3d floor. Push it below the regular surface if it has "disablelighting" flag, and above otherwise + return ((x.extrafloor && x.disablelighting) || (y.extrafloor && !y.disablelighting) ? -1 : 1); + } - //mxd. Push light levels above floor and ceiling levels when height is the same + // Push light levels above floor and ceiling levels when height is the same if(!xislight) return (yislight ? -1 : 0); if(!yislight) return 1; - //mxd. Push light levels without lighttype (those should be lower levels of type 1 Transfer Brightness effect) above other ones + // Push light levels without lighttype (those should be lower levels of type 1 Transfer Brightness effect) above other ones if(x.lighttype == y.lighttype) return 0; //TODO: how this should be handled? if(x.lighttype == LightLevelType.TYPE1_BOTTOM) return 1; return -1;