diff --git a/Source/Core/Data/WADReader.cs b/Source/Core/Data/WADReader.cs index e817c021..b73b54f5 100644 --- a/Source/Core/Data/WADReader.cs +++ b/Source/Core/Data/WADReader.cs @@ -898,8 +898,7 @@ namespace CodeImp.DoomBuilder.Data //mxd internal override bool FileExists(string name) { - Lump l = file.FindLump(name); - return l != null; + return file.FindLumpIndex(name) != -1; } #endregion diff --git a/Source/Core/GZBuilder/GZDoom/AcsParserSE.cs b/Source/Core/GZBuilder/GZDoom/AcsParserSE.cs index c80ae155..4e19600f 100644 --- a/Source/Core/GZBuilder/GZDoom/AcsParserSE.cs +++ b/Source/Core/GZBuilder/GZDoom/AcsParserSE.cs @@ -44,10 +44,9 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom base.Parse(stream, sourcefilename); //already parsed this? - if (parsedLumps.IndexOf(sourcefilename) != -1) return false; + if (parsedLumps.Contains(sourcefilename)) return false; parsedLumps.Add(sourcefilename); - if (isinclude) - includes.Add(sourcefilename); + if (isinclude) includes.Add(sourcefilename); // Keep local data Stream localstream = datastream; @@ -104,7 +103,9 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom string includeLump = StripTokenQuotes(ReadToken()).ToLowerInvariant(); if (!string.IsNullOrEmpty(includeLump)) { - if (includeLump == "zcommon.acs" || includeLump == "common.acs") + string includeName = Path.GetFileName(includeLump); + + if (includeName == "zcommon.acs" || includeName == "common.acs" || includes.Contains(includeName)) continue; // Callback to parse this file diff --git a/Source/Core/General/MapManager.cs b/Source/Core/General/MapManager.cs index 70066953..879a5459 100644 --- a/Source/Core/General/MapManager.cs +++ b/Source/Core/General/MapManager.cs @@ -1719,7 +1719,6 @@ namespace CodeImp.DoomBuilder { foreach(Thing t in General.Map.Map.Things) t.TranslateToUDMF(); } General.Map.Map.UpdateCustomLinedefColors(); - UpdateScriptNames(); //mxd // Update interface General.MainWindow.SetupInterface(); @@ -1728,6 +1727,7 @@ namespace CodeImp.DoomBuilder { // Reload resources ReloadResources(); + UpdateScriptNames(); //mxd // Done General.MainWindow.DisplayReady(); diff --git a/Source/Core/IO/UniversalMapSetIO.cs b/Source/Core/IO/UniversalMapSetIO.cs index 750894df..223ab718 100644 --- a/Source/Core/IO/UniversalMapSetIO.cs +++ b/Source/Core/IO/UniversalMapSetIO.cs @@ -38,14 +38,16 @@ namespace CodeImp.DoomBuilder.IO #region ================== Variables - private Configuration config; + //private Configuration config; #endregion #region ================== Constructor / Disposer // Constructor - public UniversalMapSetIO(WAD wad, MapManager manager) : base(wad, manager) + public UniversalMapSetIO(WAD wad, MapManager manager) : base(wad, manager) { } + + /*public UniversalMapSetIO(WAD wad, MapManager manager) : base(wad, manager) { if((manager != null) && (manager.Config != null)) { @@ -81,6 +83,14 @@ namespace CodeImp.DoomBuilder.IO // Add thing flags foreach(KeyValuePair flag in manager.Config.ThingFlags) config.WriteSetting("managedfields.thing." + flag.Key, true); + + //mxd. Add sector flags + foreach(KeyValuePair flag in manager.Config.SectorFlags) + config.WriteSetting("managedfields.sector." + flag.Key, true); + + //mxd. Add sidedef flags + foreach(KeyValuePair flag in manager.Config.SidedefFlags) + config.WriteSetting("managedfields.sidedef." + flag.Key, true); // Done udmfcfgreader.Dispose(); @@ -89,7 +99,7 @@ namespace CodeImp.DoomBuilder.IO } } } - } + }*/ #endregion diff --git a/Source/Core/Rendering/World3DShader.cs b/Source/Core/Rendering/World3DShader.cs index cff9185c..d9139d21 100644 --- a/Source/Core/Rendering/World3DShader.cs +++ b/Source/Core/Rendering/World3DShader.cs @@ -104,15 +104,22 @@ namespace CodeImp.DoomBuilder.Rendering } // Initialize world vertex declaration - vertexElements = new VertexElement[] - { - 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), - //mxd - new VertexElement(0, 24, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 0), - VertexElement.VertexDeclarationEnd - }; + if (manager.Enabled){ //mxd + vertexElements = new VertexElement[] { + 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), + new VertexElement(0, 24, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Normal, 0), //mxd + VertexElement.VertexDeclarationEnd + }; + } else { + vertexElements = new VertexElement[] { + 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), + VertexElement.VertexDeclarationEnd + }; + } vertexdecl = new VertexDeclaration(General.Map.Graphics.Device, vertexElements); // We have no destructor diff --git a/Source/Core/VisualModes/VisualMode.cs b/Source/Core/VisualModes/VisualMode.cs index d128395a..209bcc48 100644 --- a/Source/Core/VisualModes/VisualMode.cs +++ b/Source/Core/VisualModes/VisualMode.cs @@ -1052,9 +1052,7 @@ namespace CodeImp.DoomBuilder.VisualModes /// protected virtual void FillBlockMap() { - if(blockmap != null) blockmap.Dispose(); - blockmap = new VisualBlockMap(); - + blockmap.Clear();//mxd blockmap.AddLinedefsSet(General.Map.Map.Linedefs); blockmap.AddThingsSet(General.Map.Map.Things); blockmap.AddSectorsSet(General.Map.Map.Sectors); diff --git a/Source/Core/Windows/MainForm.cs b/Source/Core/Windows/MainForm.cs index 5ba9e247..5b34747c 100644 --- a/Source/Core/Windows/MainForm.cs +++ b/Source/Core/Windows/MainForm.cs @@ -1446,6 +1446,7 @@ namespace CodeImp.DoomBuilder.Windows //mxd private void engineItem_Click(object sender, EventArgs e) { General.Map.ConfigSettings.CurrentEngineIndex = (int)(((ToolStripMenuItem)sender).Tag); + UpdateSkills(); } // Event handler for testing at a specific skill @@ -3126,8 +3127,11 @@ namespace CodeImp.DoomBuilder.Windows //mxd private void blinkTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if(warningsCount > 0) { - if(!this.Disposing && blinkTimer != null) - this.Invoke(new CallBlink(blink)); + if (!this.Disposing && blinkTimer != null) { + try { + this.Invoke(new CallBlink(blink)); + } catch(ObjectDisposedException oe) { } //la-la-la. We don't care. + } } else { //get rid of timer blinkTimer.Stop();