diff --git a/Build/Configurations/Includes/SRB222_common.cfg b/Build/Configurations/Includes/SRB222_common.cfg index 9a574d6f..86ac7ae9 100644 --- a/Build/Configurations/Includes/SRB222_common.cfg +++ b/Build/Configurations/Includes/SRB222_common.cfg @@ -104,6 +104,7 @@ mapformat_udmf distinctfloorandceilingbrightness = true; planeequationsupport = true; + effect3dfloorsupport = true; // Special linedefs include("SRB222_misc.cfg", "speciallinedefs_udmf"); diff --git a/Source/Core/General/General.cs b/Source/Core/General/General.cs index 5d7cd498..daf5a4cd 100755 --- a/Source/Core/General/General.cs +++ b/Source/Core/General/General.cs @@ -177,6 +177,9 @@ namespace CodeImp.DoomBuilder private const string TEXTURES_DIR = "Textures"; //mxd private const string HELP_FILE = "Refmanual.chm"; + // SRB2 + public static readonly int[] FOF_TYPES = { 100, 120, 150, 160, 170, 190, 200, 202, 220, 223, 250, 251, 254, 257, 258, 259, 260 }; + #endregion #region ================== Variables diff --git a/Source/Core/Rendering/Renderer2D.cs b/Source/Core/Rendering/Renderer2D.cs index 4324bf9c..02f154f2 100755 --- a/Source/Core/Rendering/Renderer2D.cs +++ b/Source/Core/Rendering/Renderer2D.cs @@ -638,7 +638,7 @@ namespace CodeImp.DoomBuilder.Rendering //find lines with 3d floor action and collect sector tags foreach(Linedef l in General.Map.Map.Linedefs) { - if(l.Action == 160) + if(General.FOF_TYPES.Contains(l.Action)) { int sectortag = (General.Map.UDMF || (l.Args[1] & 8) != 0) ? l.Args[0] : l.Args[0] + (l.Args[4] << 8); if(sectortag != 0 && !tags.Contains(sectortag)) tags.Add(sectortag); diff --git a/Source/Plugins/3DFloorMode/BuilderPlug.cs b/Source/Plugins/3DFloorMode/BuilderPlug.cs index 833e1a64..b1087646 100644 --- a/Source/Plugins/3DFloorMode/BuilderPlug.cs +++ b/Source/Plugins/3DFloorMode/BuilderPlug.cs @@ -764,7 +764,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode HashSet tmpsectors = new HashSet(); HashSet potentialsectors = new HashSet(); Dictionary> tags = new Dictionary>(); - + // Immediately return if the list is empty if (sectors.Count == 0) return tdf; @@ -776,7 +776,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode if (ld.Front == null || ld.Front.Sector == null || ld.Front.Sector.IsDisposed || (General.Map.UDMF && ld.Front.Sector.Fields.GetValue("user_managed_3d_floor", false) == false)) continue; - if (ld.Action == 160 && ld.Args[0] != 0) + if (General.FOF_TYPES.Contains(ld.Action) && ld.Args[0] != 0) { if (!tags.ContainsKey(ld.Args[0])) tags.Add(ld.Args[0], new List() { ld.Front.Sector }); diff --git a/Source/Plugins/3DFloorMode/DrawSlopesMode.cs b/Source/Plugins/3DFloorMode/DrawSlopesMode.cs index 6a7b5808..0c82c18d 100644 --- a/Source/Plugins/3DFloorMode/DrawSlopesMode.cs +++ b/Source/Plugins/3DFloorMode/DrawSlopesMode.cs @@ -542,7 +542,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode //Determine whether or not the sector is actually a control sector for a 3D floor foreach (Sidedef sd in s.Sidedefs) { - if (sd.Line.Action == 160) + if (General.FOF_TYPES.Contains(sd.Line.Action)) return true; } return false; diff --git a/Source/Plugins/3DFloorMode/SlopeVertexGroup.cs b/Source/Plugins/3DFloorMode/SlopeVertexGroup.cs index 697d8106..4dacdb70 100644 --- a/Source/Plugins/3DFloorMode/SlopeVertexGroup.cs +++ b/Source/Plugins/3DFloorMode/SlopeVertexGroup.cs @@ -168,7 +168,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode // tagged sector(s). They will be used for highlighting in slope mode foreach (Sidedef sd in s.Sidedefs) { - if (sd.Line.Action == 160) + if (General.FOF_TYPES.Contains(sd.Line.Action)) { foreach (Sector ts in BuilderPlug.GetSectorsByTag(sd.Line.Args[0])) { diff --git a/Source/Plugins/3DFloorMode/ThreeDFloor.cs b/Source/Plugins/3DFloorMode/ThreeDFloor.cs index e29911fd..38438eb4 100644 --- a/Source/Plugins/3DFloorMode/ThreeDFloor.cs +++ b/Source/Plugins/3DFloorMode/ThreeDFloor.cs @@ -132,7 +132,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode foreach (Sidedef sd in sector.Sidedefs) { - if (sd.Line.Action == 160) + if (General.FOF_TYPES.Contains(sd.Line.Action)) { bordertexture = sd.MiddleTexture; udmftag = sd.Line.Args[0]; @@ -224,7 +224,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode { sd.SetTextureMid(bordertexture); - if (sd.Line.Action == 160) + if (General.FOF_TYPES.Contains(sd.Line.Action)) { sd.Line.Args[1] = type; sd.Line.Args[2] = flags; @@ -315,7 +315,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode foreach (Sidedef sd in sector.Sidedefs) { - if (sd.Line.Action == 160 && BuilderPlug.GetSectorsByTag(sd.Line.Args[0]).Count == 0) + if (General.FOF_TYPES.Contains(sd.Line.Action) && BuilderPlug.GetSectorsByTag(sd.Line.Args[0]).Count == 0) { sd.Line.Action = 0; diff --git a/Source/Plugins/BuilderModes/ClassicModes/DragGeometryMode.cs b/Source/Plugins/BuilderModes/ClassicModes/DragGeometryMode.cs index 2caf7d1a..f78dc693 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/DragGeometryMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/DragGeometryMode.cs @@ -24,6 +24,7 @@ using CodeImp.DoomBuilder.Rendering; using CodeImp.DoomBuilder.Geometry; using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.Types; +using System.Linq; #endregion @@ -36,7 +37,7 @@ namespace CodeImp.DoomBuilder.BuilderModes #endregion #region ================== Variables - + // Mouse position on map where dragging started private Vector2D dragstartmappos; @@ -443,7 +444,7 @@ namespace CodeImp.DoomBuilder.BuilderModes // sectors that need updating foreach (Linedef ld in General.Map.Map.Linedefs) { - if (ld.Action != 160) // Action 160 defines a 3D floor + if (!General.FOF_TYPES.Contains(ld.Action)) // Action 160 defines a 3D floor continue; foreach (Sector s in draggedsectors) diff --git a/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs b/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs index 8ba7f85a..509de5d9 100755 --- a/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs @@ -1592,7 +1592,7 @@ namespace CodeImp.DoomBuilder.BuilderModes { foreach (Linedef ld in General.Map.Map.Linedefs) { - if (ld.Action != 160) // Action 160 defines a 3D floor + if (!General.FOF_TYPES.Contains(ld.Action)) // Action 160 defines a 3D floor continue; if (ld.Args[0] == 0) // First argument of the action is the sector tag. 0 is not a valid value diff --git a/Source/Plugins/BuilderModes/ErrorChecks/BaseCheckTextures.cs b/Source/Plugins/BuilderModes/ErrorChecks/BaseCheckTextures.cs index 66f6cfa1..e01357ca 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/BaseCheckTextures.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/BaseCheckTextures.cs @@ -19,6 +19,8 @@ using CodeImp.DoomBuilder.Map; using System.Collections.Generic; using System; +using System.Linq; + #endregion @@ -82,7 +84,7 @@ namespace CodeImp.DoomBuilder.BuilderModes foreach (Linedef ld in General.Map.Map.Linedefs) { - if (ld.Action == 160) + if (General.FOF_TYPES.Contains(ld.Action)) { if ((ld.Args[1] & 4) == 4) // Type render inside { diff --git a/Source/Plugins/BuilderModes/IO/WavefrontExporter.cs b/Source/Plugins/BuilderModes/IO/WavefrontExporter.cs index c86e5108..23f16655 100755 --- a/Source/Plugins/BuilderModes/IO/WavefrontExporter.cs +++ b/Source/Plugins/BuilderModes/IO/WavefrontExporter.cs @@ -15,6 +15,8 @@ using CodeImp.DoomBuilder.VisualModes; using CodeImp.DoomBuilder.Windows; using CodeImp.DoomBuilder.BuilderModes.Interface; using System.Windows.Forms; +using System.Linq; + #endregion @@ -377,7 +379,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO { foreach (Sidedef sd in s.Sidedefs) { - if (sd.Line.Action == 160) + if (General.FOF_TYPES.Contains(sd.Line.Action)) { addvs = false; break;