3D floor types are now handled via the config, including changes when certain linedef flags are set

This commit is contained in:
MascaraSnake 2016-01-15 14:40:36 +01:00
parent cbb210e1ae
commit 057a5b16c3
9 changed files with 221 additions and 129 deletions

View file

@ -781,12 +781,16 @@ linedeftypes
{ {
title = "Solid, Opaque"; title = "Solid, Opaque";
prefix = "(100)"; prefix = "(100)";
3dfloor = true;
3dfloorflags = "19F";
} }
101 101
{ {
title = "Solid, Opaque, No Shadow"; title = "Solid, Opaque, No Shadow";
prefix = "(101)"; prefix = "(101)";
3dfloor = true;
3dfloorflags = "1DF";
} }
102 102
@ -794,12 +798,17 @@ linedeftypes
title = "Solid, Translucent"; title = "Solid, Translucent";
prefix = "(102)"; prefix = "(102)";
flags64text = "[6] Render insides"; flags64text = "[6] Render insides";
3dfloor = true;
3dfloorflags = "195F";
flags643dfloorflagsadd = "7C80";
} }
103 103
{ {
title = "Solid, Sides Only"; title = "Solid, Sides Only";
prefix = "(103)"; prefix = "(103)";
3dfloor = true;
3dfloorflags = "1CF";
} }
104 104
@ -807,12 +816,17 @@ linedeftypes
title = "Solid, No Sides"; title = "Solid, No Sides";
prefix = "(104)"; prefix = "(104)";
flags64text = "[6] Cast shadow"; flags64text = "[6] Cast shadow";
3dfloor = true;
3dfloorflags = "1D7";
flags643dfloorflagsremove = "40";
} }
105 105
{ {
title = "Solid, Invisible"; title = "Solid, Invisible";
prefix = "(105)"; prefix = "(105)";
3dfloor = true;
3dfloorflags = "47";
} }
140 140
@ -820,6 +834,9 @@ linedeftypes
title = "Intangible from Bottom, Opaque"; title = "Intangible from Bottom, Opaque";
prefix = "(140)"; prefix = "(140)";
flags64text = "[6] Don't cast shadow"; flags64text = "[6] Don't cast shadow";
3dfloor = true;
3dfloorflags = "200841F";
flags643dfloorflagsadd = "40";
} }
141 141
@ -828,6 +845,10 @@ linedeftypes
prefix = "(141)"; prefix = "(141)";
flags64text = "[6] Don't cast shadow"; flags64text = "[6] Don't cast shadow";
flags128text = "[7] Render insides"; flags128text = "[7] Render insides";
3dfloor = true;
3dfloorflags = "200191F";
flags1283dfloorflagsadd = "7C80";
flags643dfloorflagsadd = "40";
} }
142 142
@ -836,6 +857,10 @@ linedeftypes
prefix = "(142)"; prefix = "(142)";
flags64text = "[6] Don't cast shadow"; flags64text = "[6] Don't cast shadow";
flags128text = "[7] Render insides"; flags128text = "[7] Render insides";
3dfloor = true;
3dfloorflags = "2001917";
flags1283dfloorflagsadd = "7C80";
flags643dfloorflagsadd = "40";
} }
143 143
@ -843,6 +868,9 @@ linedeftypes
title = "Intangible from Top, Opaque"; title = "Intangible from Top, Opaque";
prefix = "(143)"; prefix = "(143)";
flags64text = "[6] Don't cast shadow"; flags64text = "[6] Don't cast shadow";
3dfloor = true;
3dfloorflags = "400841F";
flags643dfloorflagsadd = "40";
} }
144 144
@ -851,6 +879,10 @@ linedeftypes
prefix = "(144)"; prefix = "(144)";
flags64text = "[6] Don't cast shadow"; flags64text = "[6] Don't cast shadow";
flags128text = "[7] Render insides"; flags128text = "[7] Render insides";
3dfloor = true;
3dfloorflags = "400191F";
flags1283dfloorflagsadd = "7C80";
flags643dfloorflagsadd = "40";
} }
145 145
@ -859,12 +891,18 @@ linedeftypes
prefix = "(145)"; prefix = "(145)";
flags64text = "[6] Don't cast shadow"; flags64text = "[6] Don't cast shadow";
flags128text = "[7] Render insides"; flags128text = "[7] Render insides";
3dfloor = true;
3dfloorflags = "4001917";
flags1283dfloorflagsadd = "7C80";
flags643dfloorflagsadd = "40";
} }
146 146
{ {
title = "Only Tangible from Sides"; title = "Only Tangible from Sides";
prefix = "(146)"; prefix = "(146)";
3dfloor = true;
3dfloorflags = "600800F";
} }
} }
@ -879,6 +917,11 @@ linedeftypes
flags64text = "[6] Use two light levels"; flags64text = "[6] Use two light levels";
flags512text = "[9] Use target light level"; flags512text = "[9] Use target light level";
flags1024text = "[10] Ripple effect"; flags1024text = "[10] Ripple effect";
3dfloor = true;
3dfloorflags = "8F39";
flags643dfloorflagsadd = "20000";
flags5123dfloorflagsadd = "80000000";
flags10243dfloorflagsadd = "40000000";
} }
121 121
@ -888,6 +931,11 @@ linedeftypes
flags64text = "[6] Use two light levels"; flags64text = "[6] Use two light levels";
flags512text = "[9] Use target light level"; flags512text = "[9] Use target light level";
flags1024text = "[10] Ripple effect"; flags1024text = "[10] Ripple effect";
3dfloor = true;
3dfloorflags = "9F39";
flags643dfloorflagsadd = "20000";
flags5123dfloorflagsadd = "80000000";
flags10243dfloorflagsadd = "40000000";
} }
122 122
@ -897,6 +945,11 @@ linedeftypes
flags64text = "[6] Use two light levels"; flags64text = "[6] Use two light levels";
flags512text = "[9] Use target light level"; flags512text = "[9] Use target light level";
flags1024text = "[10] Ripple effect"; flags1024text = "[10] Ripple effect";
3dfloor = true;
3dfloorflags = "F31";
flags643dfloorflagsadd = "20000";
flags5123dfloorflagsadd = "80000000";
flags10243dfloorflagsadd = "40000000";
} }
123 123
@ -906,6 +959,11 @@ linedeftypes
flags64text = "[6] Use two light levels"; flags64text = "[6] Use two light levels";
flags512text = "[9] Use target light level"; flags512text = "[9] Use target light level";
flags1024text = "[10] Ripple effect"; flags1024text = "[10] Ripple effect";
3dfloor = true;
3dfloorflags = "1F31";
flags643dfloorflagsadd = "20000";
flags5123dfloorflagsadd = "80000000";
flags10243dfloorflagsadd = "40000000";
} }
124 124
@ -915,6 +973,11 @@ linedeftypes
flags64text = "[6] Use two light levels"; flags64text = "[6] Use two light levels";
flags512text = "[9] Use target light level"; flags512text = "[9] Use target light level";
flags1024text = "[10] Ripple effect"; flags1024text = "[10] Ripple effect";
3dfloor = true;
3dfloorflags = "209F39";
flags643dfloorflagsadd = "20000";
flags5123dfloorflagsadd = "80000000";
flags10243dfloorflagsadd = "40000000";
} }
125 125
@ -924,12 +987,19 @@ linedeftypes
flags64text = "[6] Use two light levels"; flags64text = "[6] Use two light levels";
flags512text = "[9] Use target light level"; flags512text = "[9] Use target light level";
flags1024text = "[10] Ripple effect"; flags1024text = "[10] Ripple effect";
3dfloor = true;
3dfloorflags = "201F31";
flags643dfloorflagsadd = "20000";
flags5123dfloorflagsadd = "80000000";
flags10243dfloorflagsadd = "40000000";
} }
220 220
{ {
title = "Intangible, Opaque"; title = "Intangible, Opaque";
prefix = "(220)"; prefix = "(220)";
3dfloor = true;
3dfloorflags = "8F19";
} }
221 221
@ -937,6 +1007,9 @@ linedeftypes
title = "Intangible, Translucent"; title = "Intangible, Translucent";
prefix = "(221)"; prefix = "(221)";
flags64text = "[6] Cast shadow"; flags64text = "[6] Cast shadow";
3dfloor = true;
3dfloorflags = "1B59";
flags643dfloorflagsremove = "40";
} }
222 222
@ -944,12 +1017,17 @@ linedeftypes
title = "Intangible, Sides Only"; title = "Intangible, Sides Only";
prefix = "(222)"; prefix = "(222)";
flags64text = "[6] Cast shadow"; flags64text = "[6] Cast shadow";
3dfloor = true;
3dfloorflags = "8249";
flags643dfloorflagsremove = "240";
} }
223 223
{ {
title = "Intangible, Invisible"; title = "Intangible, Invisible";
prefix = "(223)"; prefix = "(223)";
3dfloor = true;
3dfloorflags = "41";
} }
} }
@ -962,6 +1040,8 @@ linedeftypes
title = "Air Bobbing"; title = "Air Bobbing";
prefix = "(150)"; prefix = "(150)";
flags64text = "[6] Spindash to move"; flags64text = "[6] Spindash to move";
3dfloor = true;
3dfloorflags = "19F";
} }
151 151
@ -969,6 +1049,8 @@ linedeftypes
title = "Air Bobbing (Adjustable)"; title = "Air Bobbing (Adjustable)";
prefix = "(151)"; prefix = "(151)";
flags64text = "[6] Spindash to move"; flags64text = "[6] Spindash to move";
3dfloor = true;
3dfloorflags = "19F";
} }
152 152
@ -976,12 +1058,16 @@ linedeftypes
title = "Reverse Air Bobbing (Adjustable)"; title = "Reverse Air Bobbing (Adjustable)";
prefix = "(152)"; prefix = "(152)";
flags64text = "[6] Spindash to move"; flags64text = "[6] Spindash to move";
3dfloor = true;
3dfloorflags = "19F";
} }
160 160
{ {
title = "Floating, Bobbing"; title = "Floating, Bobbing";
prefix = "(160)"; prefix = "(160)";
3dfloor = true;
3dfloorflags = "4019F";
} }
190 190
@ -990,6 +1076,8 @@ linedeftypes
prefix = "(190)"; prefix = "(190)";
flags2text = "[1] Sink when stepped on"; flags2text = "[1] Sink when stepped on";
flags64text = "[6] Spindash to move"; flags64text = "[6] Spindash to move";
3dfloor = true;
3dfloorflags = "19F";
} }
191 191
@ -998,6 +1086,8 @@ linedeftypes
prefix = "(191)"; prefix = "(191)";
flags2text = "[1] Sink when stepped on"; flags2text = "[1] Sink when stepped on";
flags64text = "[6] Spindash to move"; flags64text = "[6] Spindash to move";
3dfloor = true;
3dfloorflags = "1DF";
} }
192 192
@ -1006,6 +1096,8 @@ linedeftypes
prefix = "(192)"; prefix = "(192)";
flags2text = "[1] Sink when stepped on"; flags2text = "[1] Sink when stepped on";
flags64text = "[6] Spindash to move"; flags64text = "[6] Spindash to move";
3dfloor = true;
3dfloorflags = "195F";
} }
193 193
@ -1014,6 +1106,8 @@ linedeftypes
prefix = "(193)"; prefix = "(193)";
flags2text = "[1] Sink when stepped on"; flags2text = "[1] Sink when stepped on";
flags64text = "[6] Spindash to move"; flags64text = "[6] Spindash to move";
3dfloor = true;
3dfloorflags = "47";
} }
194 194
@ -1022,6 +1116,9 @@ linedeftypes
prefix = "(194)"; prefix = "(194)";
flags2text = "[1] Sink when stepped on"; flags2text = "[1] Sink when stepped on";
flags64text = "[6] Spindash, no shadow"; flags64text = "[6] Spindash, no shadow";
3dfloor = true;
3dfloorflags = "200841F";
flags643dfloorflagsadd = "40";
} }
195 195
@ -1030,6 +1127,9 @@ linedeftypes
prefix = "(195)"; prefix = "(195)";
flags2text = "[1] Sink when stepped on"; flags2text = "[1] Sink when stepped on";
flags64text = "[6] Spindash, no shadow"; flags64text = "[6] Spindash, no shadow";
3dfloor = true;
3dfloorflags = "2009D1F";
flags643dfloorflagsadd = "40";
} }
} }
@ -1041,12 +1141,16 @@ linedeftypes
{ {
title = "Crumbling, Respawn"; title = "Crumbling, Respawn";
prefix = "(170)"; prefix = "(170)";
3dfloor = true;
3dfloorflags = "10019F";
} }
171 171
{ {
title = "Crumbling, No Respawn"; title = "Crumbling, No Respawn";
prefix = "(171)"; prefix = "(171)";
3dfloor = true;
3dfloorflags = "80019F";
} }
172 172
@ -1054,6 +1158,9 @@ linedeftypes
title = "Crumbling, Respawn, Intangible from Bottom"; title = "Crumbling, Respawn, Intangible from Bottom";
prefix = "(172)"; prefix = "(172)";
flags64text = "[6] Don't cast shadow"; flags64text = "[6] Don't cast shadow";
3dfloor = true;
3dfloorflags = "210841F";
flags643dfloorflagsadd = "40";
} }
173 173
@ -1061,6 +1168,9 @@ linedeftypes
title = "Crumbling, No Respawn, Intangible from Bottom"; title = "Crumbling, No Respawn, Intangible from Bottom";
prefix = "(173)"; prefix = "(173)";
flags64text = "[6] Don't cast shadow"; flags64text = "[6] Don't cast shadow";
3dfloor = true;
3dfloorflags = "218841F";
flags643dfloorflagsadd = "40";
} }
174 174
@ -1068,42 +1178,59 @@ linedeftypes
title = "Crumbling, Respawn, Int. from Bottom, Translucent"; title = "Crumbling, Respawn, Int. from Bottom, Translucent";
prefix = "(174)"; prefix = "(174)";
flags64text = "[6] Don't cast shadow"; flags64text = "[6] Don't cast shadow";
3dfloor = true;
3dfloorflags = "210959F";
flags643dfloorflagsadd = "40";
} }
175 175
{ {
title = "Crumbling, No Respawn, Int. from Bottom, Translucent"; title = "Crumbling, No Respawn, Int. from Bottom, Translucent";
prefix = "(175)"; prefix = "(175)";
flags64text = "[6] Don't cast shadow";
3dfloor = true;
3dfloorflags = "218959F";
flags643dfloorflagsadd = "40";
} }
176 176
{ {
title = "Crumbling, Respawn, Floating, Bobbing"; title = "Crumbling, Respawn, Floating, Bobbing";
prefix = "(176)"; prefix = "(176)";
3dfloor = true;
3dfloorflags = "14019F";
} }
177 177
{ {
title = "Crumbling, No Respawn, Floating, Bobbing"; title = "Crumbling, No Respawn, Floating, Bobbing";
prefix = "(177)"; prefix = "(177)";
3dfloor = true;
3dfloorflags = "1C019F";
} }
178 178
{ {
title = "Crumbling, Respawn, Floating"; title = "Crumbling, Respawn, Floating";
prefix = "(178)"; prefix = "(178)";
3dfloor = true;
3dfloorflags = "14019F";
} }
179 179
{ {
title = "Crumbling, No Respawn, Floating"; title = "Crumbling, No Respawn, Floating";
prefix = "(179)"; prefix = "(179)";
3dfloor = true;
3dfloorflags = "1C019F";
} }
180 180
{ {
title = "Crumbling, Respawn, Air Bobbing"; title = "Crumbling, Respawn, Air Bobbing";
prefix = "(180)"; prefix = "(180)";
3dfloor = true;
3dfloorflags = "10019F";
} }
} }
@ -1115,24 +1242,32 @@ linedeftypes
{ {
title = "Light Block"; title = "Light Block";
prefix = "(200)"; prefix = "(200)";
3dfloor = true;
3dfloorflags = "20201";
} }
201 201
{ {
title = "Half Light Block"; title = "Half Light Block";
prefix = "(201)"; prefix = "(201)";
3dfloor = true;
3dfloorflags = "201";
} }
202 202
{ {
title = "Fog Block"; title = "Fog Block";
prefix = "(202)"; prefix = "(202)";
3dfloor = true;
3dfloorflags = "3EF19";
} }
250 250
{ {
title = "Mario Block"; title = "Mario Block";
prefix = "(250)"; prefix = "(250)";
3dfloor = true;
3dfloorflags = "40019F";
} }
251 251
@ -1141,6 +1276,8 @@ linedeftypes
prefix = "(251)"; prefix = "(251)";
flags512text = "[9] Custom crushing sound"; flags512text = "[9] Custom crushing sound";
flags1024text = "[10] Custom speed"; flags1024text = "[10] Custom speed";
3dfloor = true;
3dfloorflags = "19F";
} }
252 252
@ -1150,6 +1287,9 @@ linedeftypes
flags64text = "[6] Shatter only from below"; flags64text = "[6] Shatter only from below";
flags512text = "[9] Shattered by pushables"; flags512text = "[9] Shattered by pushables";
flags1024text = "[10] Trigger linedef executor"; flags1024text = "[10] Trigger linedef executor";
3dfloor = true;
3dfloorflags = "8800019";
flags643dfloorflagsadd = "200006";
} }
253 253
@ -1158,6 +1298,8 @@ linedeftypes
prefix = "(253)"; prefix = "(253)";
flags512text = "[9] Shattered by pushables"; flags512text = "[9] Shattered by pushables";
flags1024text = "[10] Trigger linedef executor"; flags1024text = "[10] Trigger linedef executor";
3dfloor = true;
3dfloorflags = "8801019";
} }
254 254
@ -1167,6 +1309,9 @@ linedeftypes
flags64text = "[6] Only bustable by Knuckles"; flags64text = "[6] Only bustable by Knuckles";
flags512text = "[9] Shattered by pushables"; flags512text = "[9] Shattered by pushables";
flags1024text = "[10] Trigger linedef executor"; flags1024text = "[10] Trigger linedef executor";
3dfloor = true;
3dfloorflags = "80001F";
flags643dfloorflagsadd = "20000000";
} }
255 255
@ -1175,6 +1320,8 @@ linedeftypes
prefix = "(255)"; prefix = "(255)";
flags512text = "[9] Shattered by pushables"; flags512text = "[9] Shattered by pushables";
flags1024text = "[10] Trigger linedef executor"; flags1024text = "[10] Trigger linedef executor";
3dfloor = true;
3dfloorflags = "1080001F";
} }
256 256
@ -1183,6 +1330,8 @@ linedeftypes
prefix = "(256)"; prefix = "(256)";
flags512text = "[9] Shattered by pushables"; flags512text = "[9] Shattered by pushables";
flags1024text = "[10] Trigger linedef executor"; flags1024text = "[10] Trigger linedef executor";
3dfloor = true;
3dfloorflags = "1080101F";
} }
257 257
@ -1190,6 +1339,9 @@ linedeftypes
title = "Quicksand"; title = "Quicksand";
prefix = "(257)"; prefix = "(257)";
flags1024text = "[10] Ripple effect"; flags1024text = "[10] Ripple effect";
3dfloor = true;
3dfloorflags = "1008219";
flags10243dfloorflagsadd = "40000000";
} }
258 258
@ -1197,6 +1349,8 @@ linedeftypes
title = "Laser"; title = "Laser";
prefix = "(258)"; prefix = "(258)";
flags32text = "[5] Don't damage bosses"; flags32text = "[5] Don't damage bosses";
3dfloor = true;
3dfloorflags = "959";
} }
259 259
@ -1207,6 +1361,8 @@ linedeftypes
flags128text = "[7] Only block non-players"; flags128text = "[7] Only block non-players";
flags512text = "[9] Shattered by pushables"; flags512text = "[9] Shattered by pushables";
flags1024text = "[10] Trigger linedef executor"; flags1024text = "[10] Trigger linedef executor";
3dfloor = true;
3dfloorcustom = true;
} }
} }

View file

@ -48,7 +48,10 @@ namespace CodeImp.DoomBuilder.Config
private IDictionary<string, string> flags; private IDictionary<string, string> flags;
private readonly bool slope; private readonly bool slope;
private readonly int slopetype; private readonly int slopetype;
private readonly bool threedfloor;
private readonly bool threedfloorcustom;
private readonly int threedfloorflags;
private readonly IDictionary<string,int> threedfloorflagsadditions;
#endregion #endregion
#region ================== Properties #region ================== Properties
@ -70,7 +73,9 @@ namespace CodeImp.DoomBuilder.Config
public bool IsRegularSlope { get { return slope && (slopetype & 0x3) == 1; } } public bool IsRegularSlope { get { return slope && (slopetype & 0x3) == 1; } }
public bool IsCopySlope { get { return slope && (slopetype & 0x3) == 2; } } public bool IsCopySlope { get { return slope && (slopetype & 0x3) == 2; } }
public bool IsVertexSlope { get { return slope && (slopetype & 0x3) == 3; } } public bool IsVertexSlope { get { return slope && (slopetype & 0x3) == 3; } }
public bool ThreeDFloor { get { return threedfloor; } }
public bool ThreeDFloorCustom { get { return threedfloorcustom; } }
public int ThreeDFloorFlags { get { return threedfloorflags; } }
#endregion #endregion
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
@ -95,9 +100,24 @@ namespace CodeImp.DoomBuilder.Config
this.title = this.prefix + " " + this.name; this.title = this.prefix + " " + this.name;
this.title = this.title.Trim(); this.title = this.title.Trim();
this.flags = new Dictionary<string, string>(ac.Flags); this.flags = new Dictionary<string, string>(ac.Flags);
ReadLinedefSpecificFlags(cfg);
this.slope = cfg.ReadSetting(actionsetting + ".slope", false); this.slope = cfg.ReadSetting(actionsetting + ".slope", false);
this.slopetype = cfg.ReadSetting(actionsetting + ".slopetype", 0); this.slopetype = cfg.ReadSetting(actionsetting + ".slopetype", 0);
ReadLinedefSpecificFlags(cfg); this.threedfloor = cfg.ReadSetting(actionsetting + ".3dfloor", false);
this.threedfloorcustom = cfg.ReadSetting(actionsetting + ".3dfloorcustom", false);
try { this.threedfloorflags = Convert.ToInt32(cfg.ReadSetting(actionsetting + ".3dfloorflags", "0"), 16); }
catch (FormatException e) { this.threedfloorflags = 0; }
this.threedfloorflagsadditions = new Dictionary<string, int>();
foreach (KeyValuePair<string,string> p in flags)
{
int value = 0;
try { value = Convert.ToInt32(cfg.ReadSetting(actionsetting + ".flags" + p.Key + "3dfloorflagsadd", "0"), 16); }
catch (FormatException e) { }
try { value -= Convert.ToInt32(cfg.ReadSetting(actionsetting + ".flags" + p.Key + "3dfloorflagsremove", "0"), 16); }
catch (FormatException e) { }
this.threedfloorflagsadditions.Add(p.Key, value);
}
// Read the args // Read the args
for (int i = 0; i < Linedef.NUM_ARGS; i++) for (int i = 0; i < Linedef.NUM_ARGS; i++)
@ -118,6 +138,10 @@ namespace CodeImp.DoomBuilder.Config
this.flags = new Dictionary<string, string>(); this.flags = new Dictionary<string, string>();
this.slope = false; this.slope = false;
this.slopetype = 0; this.slopetype = 0;
this.threedfloor = false;
this.threedfloorcustom = false;
this.threedfloorflags = 0;
this.threedfloorflagsadditions = new Dictionary<string, int>();
this.args = new ArgumentInfo[Linedef.NUM_ARGS]; this.args = new ArgumentInfo[Linedef.NUM_ARGS];
for(int i = 0; i < Linedef.NUM_ARGS; i++) for(int i = 0; i < Linedef.NUM_ARGS; i++)
this.args[i] = new ArgumentInfo(i); this.args[i] = new ArgumentInfo(i);
@ -152,6 +176,16 @@ namespace CodeImp.DoomBuilder.Config
flags = newflags; flags = newflags;
} }
public int Get3DFloorFlags(IDictionary<string,bool> setflags)
{
int value = threedfloorflags;
foreach (KeyValuePair<string,int> p in threedfloorflagsadditions)
{
if (setflags[p.Key]) value += p.Value;
}
return value;
}
#endregion #endregion
} }
} }

View file

@ -42,7 +42,6 @@ namespace CodeImp.DoomBuilder.IO
// Constructor // Constructor
public DoomMapSetIO(WAD wad, MapManager manager) : base(wad, manager) public DoomMapSetIO(WAD wad, MapManager manager) : base(wad, manager)
{ {
threeDFloorTypes = new Dictionary<int, int[]>() { { 160, new int[3] { -1, -1, -1 } } };
translucentLineTypes = new Dictionary<int, float>() { { 208, -1.0f } }; translucentLineTypes = new Dictionary<int, float>() { { 208, -1.0f } };
startTypes = new List<int>(); startTypes = new List<int>();
} }
@ -94,7 +93,6 @@ namespace CodeImp.DoomBuilder.IO
public override int MinThingAngle { get { return short.MinValue; } } public override int MinThingAngle { get { return short.MinValue; } }
public override Dictionary<MapElementType, Dictionary<string, UniversalType>> UIFields { get { return uifields; } } //mxd public override Dictionary<MapElementType, Dictionary<string, UniversalType>> UIFields { get { return uifields; } } //mxd
public override int SlopeVertexType { get { return 9500; } } public override int SlopeVertexType { get { return 9500; } }
public override int Custom3DFloorType { get { return 160; } }
public override int ColormapType { get { return -1; } } public override int ColormapType { get { return -1; } }
public override int FlatAlignmentType { get { return -1; } } public override int FlatAlignmentType { get { return -1; } }
public override int AxisType { get { return -1; } } public override int AxisType { get { return -1; } }

View file

@ -42,7 +42,6 @@ namespace CodeImp.DoomBuilder.IO
// Constructor // Constructor
public HexenMapSetIO(WAD wad, MapManager manager) : base(wad, manager) public HexenMapSetIO(WAD wad, MapManager manager) : base(wad, manager)
{ {
threeDFloorTypes = new Dictionary<int, int[]>() { { 160, new int[3] { -1, -1, -1 } } };
translucentLineTypes = new Dictionary<int, float>() { { 208, -1.0f } }; translucentLineTypes = new Dictionary<int, float>() { { 208, -1.0f } };
startTypes = new List<int>(); startTypes = new List<int>();
} }
@ -94,7 +93,6 @@ namespace CodeImp.DoomBuilder.IO
public override int MinThingAngle { get { return short.MinValue; } } public override int MinThingAngle { get { return short.MinValue; } }
public override Dictionary<MapElementType, Dictionary<string, UniversalType>> UIFields { get { return uifields; } } //mxd public override Dictionary<MapElementType, Dictionary<string, UniversalType>> UIFields { get { return uifields; } } //mxd
public override int SlopeVertexType { get { return 9500; } } public override int SlopeVertexType { get { return 9500; } }
public override int Custom3DFloorType { get { return 160; } }
public override int ColormapType { get { return -1; } } public override int ColormapType { get { return -1; } }
public override int FlatAlignmentType { get { return -1; } } public override int FlatAlignmentType { get { return -1; } }
public override int AxisType { get { return -1; } } public override int AxisType { get { return -1; } }

View file

@ -70,10 +70,8 @@ namespace CodeImp.DoomBuilder.IO
Dictionary<MapElementType, Dictionary<string, UniversalType>> UIFields { get; } //mxd. Element type (like "sector"), list of uifields. Dictionary<MapElementType, Dictionary<string, UniversalType>> UIFields { get; } //mxd. Element type (like "sector"), list of uifields.
string GetElementName(MapElementType elementtype); //mxd string GetElementName(MapElementType elementtype); //mxd
MapElementType GetElementType(string elementname); //mxd MapElementType GetElementType(string elementname); //mxd
Dictionary<int, int[]> ThreeDFloorTypes { get; }
Dictionary<int, float> TranslucentLineTypes { get; } Dictionary<int, float> TranslucentLineTypes { get; }
int SlopeVertexType { get; } int SlopeVertexType { get; }
int Custom3DFloorType { get; }
int ColormapType { get; } int ColormapType { get; }
int FlatAlignmentType { get; } int FlatAlignmentType { get; }
int AxisType { get; } int AxisType { get; }

View file

@ -45,7 +45,6 @@ namespace CodeImp.DoomBuilder.IO
//mxd //mxd
protected Dictionary<MapElementType, Dictionary<string, UniversalType>> uifields; protected Dictionary<MapElementType, Dictionary<string, UniversalType>> uifields;
protected Dictionary<int, int[]> threeDFloorTypes;
protected Dictionary<int, float> translucentLineTypes; protected Dictionary<int, float> translucentLineTypes;
protected List<int> startTypes; protected List<int> startTypes;
#endregion #endregion
@ -94,10 +93,8 @@ namespace CodeImp.DoomBuilder.IO
public abstract int MaxThingAngle { get; } public abstract int MaxThingAngle { get; }
public abstract int MinThingAngle { get; } public abstract int MinThingAngle { get; }
public abstract Dictionary<MapElementType, Dictionary<string, UniversalType>> UIFields { get; } //mxd public abstract Dictionary<MapElementType, Dictionary<string, UniversalType>> UIFields { get; } //mxd
public Dictionary<int, int[]> ThreeDFloorTypes { get { return threeDFloorTypes; } }
public Dictionary<int, float> TranslucentLineTypes { get { return translucentLineTypes; } } public Dictionary<int, float> TranslucentLineTypes { get { return translucentLineTypes; } }
public abstract int SlopeVertexType { get; } public abstract int SlopeVertexType { get; }
public abstract int Custom3DFloorType { get; }
public abstract int ColormapType { get; } public abstract int ColormapType { get; }
public abstract int FlatAlignmentType { get; } public abstract int FlatAlignmentType { get; }
public abstract int AxisType { get; } public abstract int AxisType { get; }

View file

@ -38,70 +38,6 @@ namespace CodeImp.DoomBuilder.IO
// Constructor // Constructor
public SRB2MapSetIO(WAD wad, MapManager manager) : base(wad, manager) public SRB2MapSetIO(WAD wad, MapManager manager) : base(wad, manager)
{ {
//Dictionary contents: Type, flags, translucency, flags when noclimb is active
//Type: 1 = solid, 2 = water, 3 = intangible, +4 = render insides, +64 = don't render planes, +128 = don't render sides
//Flags: 1 = disable lighting effects (e.g. shadows), 2 = restrict lighting effects to insides, 4 = fog
//Translucency: 0 = invisible, 1 = read from front upper texture, 2 = opaque
threeDFloorTypes = new Dictionary<int, int[]>() {
{ 100, new int[4] { 1, 0, 2, 0} },
{ 101, new int[4] { 1, 1, 2, 1} },
{ 102, new int[4] { 1, 1, 1, 1} },
{ 103, new int[4] { 65, 1, 2, 1} },
{ 104, new int[4] { 129, 1, 2, 0} },
{ 105, new int[4] { 1, 1, 0, 1} },
{ 120, new int[4] { 6, 0, 2, 2} },
{ 121, new int[4] { 6, 0, 1, 2} },
{ 122, new int[4] { 134, 0, 2, 2} },
{ 123, new int[4] { 134, 0, 1, 2} },
{ 124, new int[4] { 6, 0, 1, 2} },
{ 125, new int[4] { 134, 0, 1, 2} },
{ 140, new int[4] { 1, 0, 2, 1} },
{ 141, new int[4] { 1, 0, 1, 1} },
{ 142, new int[4] { 129, 0, 1, 1} },
{ 143, new int[4] { 1, 0, 2, 1} },
{ 144, new int[4] { 1, 0, 1, 1} },
{ 145, new int[4] { 129, 0, 1, 1} },
{ 146, new int[4] { 65, 0, 2, 1} },
{ 150, new int[4] { 1, 0, 2, 0} },
{ 151, new int[4] { 1, 0, 2, 0} },
{ 152, new int[4] { 1, 0, 2, 0} },
{ 160, new int[4] { 1, 0, 2, 0} },
{ 170, new int[4] { 1, 0, 2, 0} },
{ 171, new int[4] { 1, 0, 2, 0} },
{ 172, new int[4] { 1, 0, 2, 1} },
{ 173, new int[4] { 1, 0, 2, 1} },
{ 174, new int[4] { 1, 0, 1, 1} },
{ 175, new int[4] { 1, 0, 1, 1} },
{ 176, new int[4] { 1, 0, 2, 0} },
{ 177, new int[4] { 1, 0, 2, 0} },
{ 178, new int[4] { 1, 0, 2, 0} },
{ 179, new int[4] { 1, 0, 2, 0} },
{ 180, new int[4] { 1, 0, 2, 0} },
{ 190, new int[4] { 1, 0, 2, 0} },
{ 191, new int[4] { 1, 1, 2, 1} },
{ 192, new int[4] { 1, 1, 1, 1} },
{ 193, new int[4] { 1, 1, 0, 1} },
{ 194, new int[4] { 1, 0, 2, 1} },
{ 195, new int[4] { 1, 0, 1, 1} },
{ 200, new int[4] { 3, 1, 0, 1} },
{ 201, new int[4] { 3, 0, 0, 0} },
{ 202, new int[4] { 7, 5, 2, 5} },
{ 220, new int[4] { 3, 0, 2, 0} },
{ 221, new int[4] { 3, 1, 1, 0} },
{ 222, new int[4] { 67, 1, 2, 0} },
{ 223, new int[4] { 3, 1, 0, 1} },
{ 250, new int[4] { 1, 0, 2, 0} },
{ 251, new int[4] { 1, 0, 2, 0} },
{ 252, new int[4] { 1, 0, 2, 0} },
{ 253, new int[4] { 1, 0, 1, 0} },
{ 254, new int[4] { 1, 0, 2, 0} },
{ 255, new int[4] { 1, 0, 2, 0} },
{ 256, new int[4] { 1, 0, 1, 0} },
{ 257, new int[4] { 5, 0, 2, 0} },
{ 258, new int[4] { 1, 1, 2, 0} },
{ 259, new int[4] { 1, 0, 2, 0} }
};
translucentLineTypes = new Dictionary<int, float>() { translucentLineTypes = new Dictionary<int, float>() {
{ 900, 0.9f }, { 900, 0.9f },
{ 901, 0.8f }, { 901, 0.8f },
@ -123,7 +59,6 @@ namespace CodeImp.DoomBuilder.IO
public override bool HasThingHeight { get { return true; } } public override bool HasThingHeight { get { return true; } }
public override bool HasLinedefParameters { get { return false; } } public override bool HasLinedefParameters { get { return false; } }
public override bool HasTranslucent3DFloors { get { return true; } } public override bool HasTranslucent3DFloors { get { return true; } }
public override int Custom3DFloorType { get { return 259; } }
public override int SlopeVertexType { get { return 750; } } public override int SlopeVertexType { get { return 750; } }
public override int MaxThingHeight { get { return 4095; } } public override int MaxThingHeight { get { return 4095; } }
public override int MinThingHeight { get { return 0; } } public override int MinThingHeight { get { return 0; } }

View file

@ -47,7 +47,6 @@ namespace CodeImp.DoomBuilder.IO
{ {
if((manager != null) && (manager.Config != null)) if((manager != null) && (manager.Config != null))
{ {
threeDFloorTypes = new Dictionary<int, int[]>() { { 160, new int[3] { -1, -1, -1 } } };
translucentLineTypes = new Dictionary<int, float>() { { 208, -1.0f } }; translucentLineTypes = new Dictionary<int, float>() { { 208, -1.0f } };
startTypes = new List<int>(); startTypes = new List<int>();
@ -145,7 +144,6 @@ namespace CodeImp.DoomBuilder.IO
public override int MinThingAngle { get { return int.MinValue; } } public override int MinThingAngle { get { return int.MinValue; } }
public override Dictionary<MapElementType, Dictionary<string, UniversalType>> UIFields { get { return uifields; } } //mxd public override Dictionary<MapElementType, Dictionary<string, UniversalType>> UIFields { get { return uifields; } } //mxd
public override int SlopeVertexType { get { return 9500; } } public override int SlopeVertexType { get { return 9500; } }
public override int Custom3DFloorType { get { return 160; } }
public override int ColormapType { get { return -1; } } public override int ColormapType { get { return -1; } }
public override int FlatAlignmentType { get { return -1; } } public override int FlatAlignmentType { get { return -1; } }
public override int AxisType { get { return -1; } } public override int AxisType { get { return -1; } }

View file

@ -91,7 +91,8 @@ namespace CodeImp.DoomBuilder.Map
internal Dictionary<string, bool> Flags { get { return flags; } } internal Dictionary<string, bool> Flags { get { return flags; } }
public int Action { get { return action; } set { BeforePropsChange(); action = value; UpdateColorPreset(); } } public int Action { get { return action; } set { BeforePropsChange(); action = value; UpdateColorPreset(); } }
public int Activate { get { return activate; } set { BeforePropsChange(); activate = value; UpdateColorPreset(); } } public int Activate { get { return activate; } set { BeforePropsChange(); activate = value; UpdateColorPreset(); } }
public bool Is3DFloor { get { return General.Map.FormatInterface.ThreeDFloorTypes.ContainsKey(Action); } } public bool Is3DFloor { get { return (!General.Map.SRB2 && Action == 160) || General.Map.Config.GetLinedefActionInfo(Action).ThreeDFloor; } }
public bool IsCustom3DFloor { get { return General.Map.Config.GetLinedefActionInfo(Action).ThreeDFloorCustom; } }
public bool IsRegularSlope { get { return (!General.Map.SRB2 && Action == 181) || General.Map.Config.GetLinedefActionInfo(Action).IsRegularSlope; } } public bool IsRegularSlope { get { return (!General.Map.SRB2 && Action == 181) || General.Map.Config.GetLinedefActionInfo(Action).IsRegularSlope; } }
public bool IsCopySlope { get { return (!General.Map.SRB2 && Action == 118) || General.Map.Config.GetLinedefActionInfo(Action).IsCopySlope; } } public bool IsCopySlope { get { return (!General.Map.SRB2 && Action == 118) || General.Map.Config.GetLinedefActionInfo(Action).IsCopySlope; } }
public bool IsVertexSlope { get { return General.Map.Config.GetLinedefActionInfo(Action).IsVertexSlope; } } public bool IsVertexSlope { get { return General.Map.Config.GetLinedefActionInfo(Action).IsVertexSlope; } }
@ -771,61 +772,38 @@ namespace CodeImp.DoomBuilder.Map
Args[3] = 0; //alpha Args[3] = 0; //alpha
Args[4] = 0; //hi-tag/line ID (irrelevant for SRB2) Args[4] = 0; //hi-tag/line ID (irrelevant for SRB2)
//Handle the custom 3D floor type (259) int value;
if (Action == General.Map.FormatInterface.Custom3DFloorType && Back != null) if (IsCustom3DFloor && Back != null)
{ {
//Read 3D floor flags from upper back texture //Read 3D floor flags from upper back texture
string tex = Back.HighTexture; string tex = Back.HighTexture;
Regex r = new Regex("^[A-F0-9]*$"); try { value = Convert.ToInt32(Back.HighTexture, 16); }
if (r.IsMatch(tex)) catch (FormatException e) { return; }
{
int value = Convert.ToInt32(tex, 16);
bool exists = (value & 0x1) == 0x1; //FF_EXISTS
bool solid = ((value & 0x2) == 0x2) || ((value & 0x4) == 0x4); //FF_BLOCKPLAYER/FF_BLOCKOTHERS/FF_SOLID
bool rendersides = (value & 0x8) == 0x8; //FF_RENDERSIDES
bool renderplanes = (value & 0x10) == 0x10; //FF_RENDERPLANES
bool render = rendersides || renderplanes;
bool water = (value & 0x20) == 0x20; //FF_SWIMMABLE
bool noshade = (value & 0x40) == 0x40; //FF_NOSHADE
bool translucent = (value & 0x1000) == 0x1000; //FF_TRANSLUCENT
bool fog = (value & 0x2000) == 0x2000; //FF_FOG
bool inside = ((value & 0x8000) == 0x8000) || ((value & 0x10000) == 0x10000); //FF_ALLSIDES/FF_INVERTSIDES
bool doubleshadow = (value & 0x20000) == 0x20000; //FF_DOUBLESHADOW
if (exists)
{
Args[1] = water ? 2 : (solid ? 1 : 3);
if (inside) Args[1] += 4;
if (!renderplanes) Args[1] += 64;
if (!rendersides) Args[1] += 128;
}
if (noshade) Args[2] += 1;
if (doubleshadow) Args[2] += 2;
if (fog) Args[2] += 4;
Args[3] = render ? (translucent ? ParseTranslucency(Front.HighTexture) : 255) : 0;
}
} }
else else value = General.Map.Config.GetLinedefActionInfo(Action).Get3DFloorFlags(flags);
bool exists = (value & 0x1) == 0x1; //FF_EXISTS
bool solid = ((value & 0x2) == 0x2) || ((value & 0x4) == 0x4); //FF_BLOCKPLAYER/FF_BLOCKOTHERS/FF_SOLID
bool rendersides = (value & 0x8) == 0x8; //FF_RENDERSIDES
bool renderplanes = (value & 0x10) == 0x10; //FF_RENDERPLANES
bool render = rendersides || renderplanes;
bool water = (value & 0x20) == 0x20; //FF_SWIMMABLE
bool noshade = (value & 0x40) == 0x40; //FF_NOSHADE
bool translucent = (value & 0x1000) == 0x1000; //FF_TRANSLUCENT
bool fog = (value & 0x2000) == 0x2000; //FF_FOG
bool inside = ((value & 0x8000) == 0x8000) || ((value & 0x10000) == 0x10000); //FF_ALLSIDES/FF_INVERTSIDES
bool doubleshadow = (value & 0x20000) == 0x20000; //FF_DOUBLESHADOW
if (exists)
{ {
//Read settings for preconfigured 3D floor type Args[1] = water ? 2 : (solid ? 1 : 3);
int[] settings = General.Map.FormatInterface.ThreeDFloorTypes[Action]; if (inside) Args[1] += 4;
Args[1] = settings[0]; if (!renderplanes) Args[1] += 64;
Args[2] = IsFlagSet("64") ? settings[3] : settings[1]; //Flags may depend on whether the noclimb flag is set if (!rendersides) Args[1] += 128;
switch (settings[2])
{
case 0:
Args[3] = 0;
break;
case 1:
Args[3] = ParseTranslucency(Front.HighTexture);
break;
case 2:
Args[3] = 255;
break;
default:
Args[3] = 0;
break;
}
} }
if (noshade) Args[2] += 1;
if (doubleshadow) Args[2] += 2;
if (fog) Args[2] += 4;
Args[3] = render ? (translucent ? ParseTranslucency(Front.HighTexture) : 255) : 0;
} }
//Read translucency value from texture name (#000-#255) //Read translucency value from texture name (#000-#255)