diff --git a/Source/Core/IO/DoomMapSetIO.cs b/Source/Core/IO/DoomMapSetIO.cs index 5878a39..7a6d92e 100644 --- a/Source/Core/IO/DoomMapSetIO.cs +++ b/Source/Core/IO/DoomMapSetIO.cs @@ -35,11 +35,6 @@ namespace CodeImp.DoomBuilder.IO #endregion #region ================== Variables - protected Dictionary threeDFloorTypes; - protected Dictionary slopeTypes; - protected Dictionary slopeCopyTypes; - protected Dictionary vertexSlopeTypes; - protected Dictionary translucentLineTypes; #endregion #region ================== Constructor / Disposer @@ -52,6 +47,8 @@ namespace CodeImp.DoomBuilder.IO slopeCopyTypes = new Dictionary() { { 118, new int[2] { -1, -1 } } }; vertexSlopeTypes = new Dictionary() { }; translucentLineTypes = new Dictionary() { { 208, -1.0f } }; + unflippableTypes = new List(); + startTypes = new List(); } #endregion @@ -100,19 +97,12 @@ namespace CodeImp.DoomBuilder.IO public override int MaxThingAngle { get { return short.MaxValue; } } public override int MinThingAngle { get { return short.MinValue; } } public override Dictionary> UIFields { get { return uifields; } } //mxd - public override Dictionary ThreeDFloorTypes { get { return threeDFloorTypes; } } - public override Dictionary SlopeTypes { get { return slopeTypes; } } - public override Dictionary SlopeCopyTypes { get { return slopeCopyTypes; } } - public override Dictionary VertexSlopeTypes { get { return vertexSlopeTypes; } } - public override Dictionary TranslucentLineTypes { get { return translucentLineTypes; } } public override int SlopeVertexType { get { return 9500; } } public override int Custom3DFloorType { get { return 160; } } public override int ColormapType { get { return -1; } } public override int FlatAlignmentType { get { return -1; } } public override int AxisType { get { return -1; } } public override int AxisTransferLineType { get { return -1; } } - - #endregion #region ================== Reading diff --git a/Source/Core/IO/HexenMapSetIO.cs b/Source/Core/IO/HexenMapSetIO.cs index 7ea2b19..4506006 100644 --- a/Source/Core/IO/HexenMapSetIO.cs +++ b/Source/Core/IO/HexenMapSetIO.cs @@ -35,11 +35,6 @@ namespace CodeImp.DoomBuilder.IO #endregion #region ================== Variables - protected Dictionary threeDFloorTypes; - protected Dictionary slopeTypes; - protected Dictionary slopeCopyTypes; - protected Dictionary vertexSlopeTypes; - protected Dictionary translucentLineTypes; #endregion #region ================== Constructor / Disposer @@ -52,6 +47,8 @@ namespace CodeImp.DoomBuilder.IO slopeCopyTypes = new Dictionary() { { 118, new int[2] { -1, -1 } } }; vertexSlopeTypes = new Dictionary() { }; translucentLineTypes = new Dictionary() { { 208, -1.0f } }; + unflippableTypes = new List(); + startTypes = new List(); } #endregion @@ -100,18 +97,12 @@ namespace CodeImp.DoomBuilder.IO public override int MaxThingAngle { get { return short.MaxValue; } } public override int MinThingAngle { get { return short.MinValue; } } public override Dictionary> UIFields { get { return uifields; } } //mxd - public override Dictionary ThreeDFloorTypes { get { return threeDFloorTypes; } } - public override Dictionary SlopeTypes { get { return slopeTypes; } } - public override Dictionary SlopeCopyTypes { get { return slopeCopyTypes; } } - public override Dictionary VertexSlopeTypes { get { return vertexSlopeTypes; } } - public override Dictionary TranslucentLineTypes { get { return translucentLineTypes; } } public override int SlopeVertexType { get { return 9500; } } public override int Custom3DFloorType { get { return 160; } } public override int ColormapType { get { return -1; } } public override int FlatAlignmentType { get { return -1; } } public override int AxisType { get { return -1; } } public override int AxisTransferLineType { get { return -1; } } - #endregion #region ================== Reading diff --git a/Source/Core/IO/IMapSetIO.cs b/Source/Core/IO/IMapSetIO.cs index a377225..a5d5d7c 100644 --- a/Source/Core/IO/IMapSetIO.cs +++ b/Source/Core/IO/IMapSetIO.cs @@ -81,5 +81,7 @@ namespace CodeImp.DoomBuilder.IO int FlatAlignmentType { get; } int AxisType { get; } int AxisTransferLineType { get; } + List UnflippableTypes { get; } + List StartTypes { get; } } } diff --git a/Source/Core/IO/MapSetIO.cs b/Source/Core/IO/MapSetIO.cs index 426b043..c0a468c 100644 --- a/Source/Core/IO/MapSetIO.cs +++ b/Source/Core/IO/MapSetIO.cs @@ -45,11 +45,18 @@ namespace CodeImp.DoomBuilder.IO //mxd protected Dictionary> uifields; - #endregion + protected Dictionary threeDFloorTypes; + protected Dictionary slopeTypes; + protected Dictionary slopeCopyTypes; + protected Dictionary vertexSlopeTypes; + protected Dictionary translucentLineTypes; + protected List unflippableTypes; + protected List startTypes; + #endregion - #region ================== Properties + #region ================== Properties - public abstract int MaxSidedefs { get; } + public abstract int MaxSidedefs { get; } public abstract int MaxVertices { get; } public abstract int MaxLinedefs { get; } public abstract int MaxSectors { get; } @@ -91,19 +98,19 @@ namespace CodeImp.DoomBuilder.IO public abstract int MaxThingAngle { get; } public abstract int MinThingAngle { get; } public abstract Dictionary> UIFields { get; } //mxd - public abstract Dictionary ThreeDFloorTypes { get; } - public abstract Dictionary SlopeTypes { get; } - public abstract Dictionary SlopeCopyTypes { get; } - public abstract Dictionary VertexSlopeTypes { get; } - public abstract Dictionary TranslucentLineTypes { get; } + public Dictionary ThreeDFloorTypes { get { return threeDFloorTypes; } } + public Dictionary SlopeTypes { get { return slopeTypes; } } + public Dictionary SlopeCopyTypes { get { return slopeCopyTypes; } } + public Dictionary VertexSlopeTypes { get { return vertexSlopeTypes; } } + public Dictionary TranslucentLineTypes { get { return translucentLineTypes; } } public abstract int SlopeVertexType { get; } public abstract int Custom3DFloorType { get; } public abstract int ColormapType { get; } public abstract int FlatAlignmentType { get; } public abstract int AxisType { get; } public abstract int AxisTransferLineType { get; } - - + public List UnflippableTypes { get { return unflippableTypes; } } + public List StartTypes { get { return startTypes; } } #endregion #region ================== Constructor / Disposer diff --git a/Source/Core/IO/SRB2MapSetIO.cs b/Source/Core/IO/SRB2MapSetIO.cs index d4df6fb..6213358 100644 --- a/Source/Core/IO/SRB2MapSetIO.cs +++ b/Source/Core/IO/SRB2MapSetIO.cs @@ -143,6 +143,9 @@ namespace CodeImp.DoomBuilder.IO { 908, 0.1f }, }; + unflippableTypes = new List() { 604, 605, 606, 607, 608, 609, 1700, 1701, 1702, 1704, 1705, 1713 }; + + startTypes = new List() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 }; } #endregion diff --git a/Source/Core/IO/UniversalMapSetIO.cs b/Source/Core/IO/UniversalMapSetIO.cs index b033b04..1caedb1 100644 --- a/Source/Core/IO/UniversalMapSetIO.cs +++ b/Source/Core/IO/UniversalMapSetIO.cs @@ -38,11 +38,6 @@ namespace CodeImp.DoomBuilder.IO #endregion #region ================== Variables - protected Dictionary threeDFloorTypes; - protected Dictionary slopeTypes; - protected Dictionary slopeCopyTypes; - protected Dictionary vertexSlopeTypes; - protected Dictionary translucentLineTypes; #endregion #region ================== Constructor / Disposer @@ -57,6 +52,9 @@ namespace CodeImp.DoomBuilder.IO slopeCopyTypes = new Dictionary() { { 118, new int[2] { -1, -1 } } }; vertexSlopeTypes = new Dictionary() { }; translucentLineTypes = new Dictionary() { { 208, -1.0f } }; + unflippableTypes = new List(); + startTypes = new List(); + // Make configuration Configuration config = new Configuration(); @@ -150,18 +148,12 @@ namespace CodeImp.DoomBuilder.IO public override int MaxThingAngle { get { return int.MaxValue; } } public override int MinThingAngle { get { return int.MinValue; } } public override Dictionary> UIFields { get { return uifields; } } //mxd - public override Dictionary ThreeDFloorTypes { get { return threeDFloorTypes; } } - public override Dictionary SlopeTypes { get { return slopeTypes; } } - public override Dictionary SlopeCopyTypes { get { return slopeCopyTypes; } } - public override Dictionary VertexSlopeTypes { get { return vertexSlopeTypes; } } - public override Dictionary TranslucentLineTypes { get { return translucentLineTypes; } } public override int SlopeVertexType { get { return 9500; } } public override int Custom3DFloorType { get { return 160; } } public override int ColormapType { get { return -1; } } public override int FlatAlignmentType { get { return -1; } } public override int AxisType { get { return -1; } } public override int AxisTransferLineType { get { return -1; } } - #endregion #region ================== Reading diff --git a/Source/Core/Map/Thing.cs b/Source/Core/Map/Thing.cs index 6a8f3c0..770efa3 100644 --- a/Source/Core/Map/Thing.cs +++ b/Source/Core/Map/Thing.cs @@ -125,12 +125,11 @@ namespace CodeImp.DoomBuilder.Map get { ThingTypeInfo ti = General.Map.Data.GetThingInfo(Type); - return (ti.Hangs && !IsReverse) || (!ti.Hangs && IsReverse); + return ti.Hangs ^ IsReverse; } } - public bool IsReverse { get { return General.Map.SRB2 && IsFlagSet("2"); } } - - + public bool IsReverse { get { return General.Map.SRB2 && !Unflippable && IsFlagSet("2"); } } + public bool Unflippable { get { return General.Map.FormatInterface.UnflippableTypes.Contains(Type); } } #endregion #region ================== Constructor / Disposer