From 415a3644c730a1df7cbf1dca315cae77c57084e8 Mon Sep 17 00:00:00 2001 From: MaxED Date: Sun, 16 Aug 2015 23:42:57 +0000 Subject: [PATCH] Changed, curved event lines, Visual mode: associated lines were not rendered as curved when the control object was not on screen [Xabis' patch #3]. Game configurations: removed "GZDoom only" from FraggleScript actions (because FraggleScript can be used in ZDoon). Internal: fixed a couple of bugs in DebugConsole.StopTimer(); --- .../Includes/ZDoom_linedefs.cfg | 20 ++++---- Source/Core/Controls/DebugConsole.cs | 24 ++++------ Source/Core/GZBuilder/Data/LinksCollector.cs | 46 +++++++++---------- 3 files changed, 43 insertions(+), 47 deletions(-) diff --git a/Build/Configurations/Includes/ZDoom_linedefs.cfg b/Build/Configurations/Includes/ZDoom_linedefs.cfg index f07724d8..49484b36 100644 --- a/Build/Configurations/Includes/ZDoom_linedefs.cfg +++ b/Build/Configurations/Includes/ZDoom_linedefs.cfg @@ -9,44 +9,44 @@ doom { title = "Script"; - 270 // FraggleScript Execute + 270 { - title = "FraggleScript Execute (GZDoom only)"; + title = "FraggleScript Execute"; prefix = "WR"; } 273 { - title = "FraggleScript Execute one-way (GZDoom only)"; + title = "FraggleScript Execute one-way"; prefix = "WR"; } 274 { - title = "FraggleScript Execute (GZDoom only)"; + title = "FraggleScript Execute"; prefix = "W1"; } 275 { - title = "FraggleScript Execute one-way (GZDoom only)"; + title = "FraggleScript Execute one-way"; prefix = "W1"; } 276 { - title = "FraggleScript Execute (GZDoom only)"; + title = "FraggleScript Execute"; prefix = "SR"; } 277 { - title = "FraggleScript Execute (GZDoom only)"; + title = "FraggleScript Execute"; prefix = "S1"; } 278 { - title = "FraggleScript Execute (GZDoom only)"; + title = "FraggleScript Execute"; prefix = "GR"; } 279 { - title = "FraggleScript Execute (GZDoom only)"; + title = "FraggleScript Execute"; prefix = "G1"; } } @@ -2691,7 +2691,7 @@ zdoom } 158 { - title = "FraggleScript Execute (GZDoom only)"; + title = "FraggleScript Execute"; id = "FS_Execute"; arg0 diff --git a/Source/Core/Controls/DebugConsole.cs b/Source/Core/Controls/DebugConsole.cs index 4b4d02bc..ca81ee1d 100644 --- a/Source/Core/Controls/DebugConsole.cs +++ b/Source/Core/Controls/DebugConsole.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Globalization; using System.Windows.Forms; #endregion @@ -140,21 +141,16 @@ namespace CodeImp.DoomBuilder public static void StopTimer(string message) { - if (starttime == -1) - { - Write(DebugMessageType.WARNING, "Call General.Console.StartTimer before General.Console.StopTimer!"); - } - else - { - long endtime = SlimDX.Configuration.Timer.ElapsedMilliseconds; - - if (message.Contains("%")) - message = message.Replace("&", (endtime - starttime) + " ms."); - else - message = message.TrimEnd() + " " + (endtime - starttime) + " ms."; + if(starttime == -1) throw new InvalidOperationException("DebugConsole.StartTimer() must be called before DebugConsole.StopTimer()!"); - Write(DebugMessageType.SPECIAL, message); - } + long duration = SlimDX.Configuration.Timer.ElapsedMilliseconds - starttime; + + if (message.Contains("%")) + message = message.Replace("%", duration.ToString(CultureInfo.InvariantCulture)); + else + message = message.TrimEnd() + " " + duration + " ms."; + + WriteLine(DebugMessageType.SPECIAL, message); starttime = -1; } diff --git a/Source/Core/GZBuilder/Data/LinksCollector.cs b/Source/Core/GZBuilder/Data/LinksCollector.cs index e62b1a89..68975788 100644 --- a/Source/Core/GZBuilder/Data/LinksCollector.cs +++ b/Source/Core/GZBuilder/Data/LinksCollector.cs @@ -113,6 +113,29 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data if(!result.PolyobjectStartSpots.ContainsKey(t.AngleDoom)) result.PolyobjectStartSpots[t.AngleDoom] = new List(); result.PolyobjectStartSpots[t.AngleDoom].Add(t); break; + } + + // Process Thing_SetGoal action + if(t.Action != 0 + && General.Map.Config.LinedefActions.ContainsKey(t.Action) + && General.Map.Config.LinedefActions[t.Action].Id.ToLowerInvariant() == "thing_setgoal" + && (t.Args[0] == 0 || t.Args[0] == t.Tag) + && t.Args[1] != 0) + { + result.ThingsWithGoal.Add(t); + } + } + + // We may need all of these actors... + foreach (Thing t in General.Map.Map.Things) + { + ThingTypeInfo info = General.Map.Data.GetThingInfo(t.Type); + switch (info.ClassName.ToLowerInvariant()) + { + case "interpolationpoint": + if(!result.InterpolationPoints.ContainsKey(t.Tag)) result.InterpolationPoints.Add(t.Tag, new List()); + result.InterpolationPoints[t.Tag].Add(new PathNode(t, correctheight)); + break; case "movingcamera": if(t.Args[0] != 0 || t.Args[1] != 0) result.Cameras.Add(t); @@ -130,29 +153,6 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data } break; } - - // Process Thing_SetGoal action - if(t.Action != 0 - && General.Map.Config.LinedefActions.ContainsKey(t.Action) - && General.Map.Config.LinedefActions[t.Action].Id.ToLowerInvariant() == "thing_setgoal" - && (t.Args[0] == 0 || t.Args[0] == t.Tag) - && t.Args[1] != 0) - { - result.ThingsWithGoal.Add(t); - } - } - - // We may need all InterpolationPoints... - foreach (Thing t in General.Map.Map.Things) - { - ThingTypeInfo info = General.Map.Data.GetThingInfo(t.Type); - switch (info.ClassName.ToLowerInvariant()) - { - case "interpolationpoint": - if(!result.InterpolationPoints.ContainsKey(t.Tag)) result.InterpolationPoints.Add(t.Tag, new List()); - result.InterpolationPoints[t.Tag].Add(new PathNode(t, correctheight)); - break; - } } return result;