2010-09-02 20:42:38 +00:00
|
|
|
#region === Copyright (c) 2010 Pascal van der Heiden ===
|
|
|
|
|
|
|
|
using CodeImp.DoomBuilder.Geometry;
|
2010-09-03 15:12:07 +00:00
|
|
|
using CodeImp.DoomBuilder.Map;
|
|
|
|
using CodeImp.DoomBuilder.Rendering;
|
2010-09-02 20:42:38 +00:00
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
2012-11-27 21:12:20 +00:00
|
|
|
namespace CodeImp.DoomBuilder.BuilderModes
|
2010-09-02 20:42:38 +00:00
|
|
|
{
|
2010-09-17 13:49:54 +00:00
|
|
|
internal class SectorLevel
|
2010-09-02 20:42:38 +00:00
|
|
|
{
|
|
|
|
// Type of level
|
|
|
|
public SectorLevelType type;
|
2010-09-11 20:14:36 +00:00
|
|
|
|
2015-04-01 12:51:26 +00:00
|
|
|
//mxd. Type of extralight
|
|
|
|
public LightLevelType lighttype = LightLevelType.UNKNOWN;
|
|
|
|
|
2010-09-11 20:14:36 +00:00
|
|
|
// Sector where this level originates from
|
2010-09-04 14:51:35 +00:00
|
|
|
public Sector sector;
|
|
|
|
|
2010-09-02 20:42:38 +00:00
|
|
|
// Plane in the sector
|
|
|
|
public Plane plane;
|
2010-09-03 15:12:07 +00:00
|
|
|
|
2010-09-11 20:14:36 +00:00
|
|
|
// Alpha for translucency (255=opaque)
|
2010-09-10 15:59:47 +00:00
|
|
|
public int alpha;
|
|
|
|
|
2010-09-03 15:12:07 +00:00
|
|
|
// Color of the plane (includes brightness)
|
2010-09-06 06:09:22 +00:00
|
|
|
// When this is 0, it takes the color from the sector above
|
2010-09-02 20:42:38 +00:00
|
|
|
public int color;
|
2010-09-03 15:12:07 +00:00
|
|
|
|
|
|
|
// Color and brightness below the plane
|
2010-09-06 06:09:22 +00:00
|
|
|
// When this is 0, it takes the color from the sector above
|
2010-09-03 15:12:07 +00:00
|
|
|
public int brightnessbelow;
|
|
|
|
public PixelColor colorbelow;
|
2015-02-25 19:59:17 +00:00
|
|
|
public bool disablelighting; //mxd
|
|
|
|
public bool restrictlighting; //mxd
|
2016-03-25 14:06:00 +00:00
|
|
|
public bool resetlighting; //mxd
|
Added, Visual mode, GLDEFS, GLOOME: subtractive glow is now supported.
Changed, Visual mode: changed thing fog calculation logic. Should be closer to GZDoom now.
Fixed, GLDEFS parser: "height" texture parameter was not treated as optional.
Fixed, text lump parsers: in some cases incorrect line number was displayed in error and warning messages.
Fixed, Visual mode: glow effect was not applied to sectors with 3 sidedefs.
Fixed, Visual mode: in some cases glow effect was not updated when replacing textures.
Fixed, general interface: "Full Brightness" button state was not updated during map loading.
Fixed, Drag Linedefs/Vertices/Sectors/Things modes: positions of line length labels were not updated while panning the view.
Cosmetic: added a bunch of new icons.
Cosmetic: changed Visual mode crosshair.
2015-08-27 20:46:49 +00:00
|
|
|
public bool affectedbyglow; //mxd
|
2015-11-20 14:31:54 +00:00
|
|
|
public bool extrafloor; //mxd
|
|
|
|
public bool splitsides; //mxd
|
2010-09-03 15:12:07 +00:00
|
|
|
|
|
|
|
// Constructor
|
|
|
|
public SectorLevel(Sector s, SectorLevelType type)
|
|
|
|
{
|
|
|
|
this.type = type;
|
2010-09-11 20:14:36 +00:00
|
|
|
this.sector = s;
|
2010-09-10 15:59:47 +00:00
|
|
|
this.alpha = 255;
|
2015-11-20 14:31:54 +00:00
|
|
|
this.splitsides = true; //mxd
|
2010-09-03 15:12:07 +00:00
|
|
|
}
|
|
|
|
|
2010-09-06 06:09:22 +00:00
|
|
|
// Copy constructor
|
|
|
|
public SectorLevel(SectorLevel source)
|
|
|
|
{
|
2010-09-11 20:14:36 +00:00
|
|
|
source.CopyProperties(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Copy properties
|
|
|
|
public void CopyProperties(SectorLevel target)
|
|
|
|
{
|
|
|
|
target.sector = this.sector;
|
|
|
|
target.type = this.type;
|
2015-04-01 12:51:26 +00:00
|
|
|
target.lighttype = this.lighttype; //mxd
|
2010-09-11 20:14:36 +00:00
|
|
|
target.plane = this.plane;
|
|
|
|
target.alpha = this.alpha;
|
|
|
|
target.color = this.color;
|
|
|
|
target.brightnessbelow = this.brightnessbelow;
|
|
|
|
target.colorbelow = this.colorbelow;
|
2015-11-20 14:31:54 +00:00
|
|
|
target.affectedbyglow = this.affectedbyglow; //mxd
|
2015-02-25 19:59:17 +00:00
|
|
|
target.disablelighting = this.disablelighting; //mxd
|
|
|
|
target.restrictlighting = this.restrictlighting; //mxd
|
2016-03-25 14:06:00 +00:00
|
|
|
target.resetlighting = this.resetlighting; //mxd
|
2015-11-20 14:31:54 +00:00
|
|
|
target.splitsides = this.splitsides; //mxd
|
2010-09-06 06:09:22 +00:00
|
|
|
}
|
2015-11-20 14:31:54 +00:00
|
|
|
|
|
|
|
//mxd. Compare light properties
|
|
|
|
public bool LightPropertiesMatch(SectorLevel other)
|
|
|
|
{
|
|
|
|
return (this.type == other.type && this.lighttype == other.lighttype && this.alpha == other.alpha && this.splitsides == other.splitsides
|
|
|
|
&& this.color == other.color && this.brightnessbelow == other.brightnessbelow && this.colorbelow.ToInt() == other.colorbelow.ToInt()
|
2016-03-25 14:06:00 +00:00
|
|
|
&& this.disablelighting == other.disablelighting && this.restrictlighting == other.restrictlighting
|
|
|
|
&& this.resetlighting == other.resetlighting);
|
2015-11-20 14:31:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
//mxd. Handy when debugging
|
|
|
|
public override string ToString()
|
|
|
|
{
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case SectorLevelType.Ceiling: return (extrafloor ? "ExtraCeiling" : "Ceiling");
|
|
|
|
case SectorLevelType.Floor: return (extrafloor ? "ExtraFloor" : "Floor");
|
|
|
|
case SectorLevelType.Glow: return "Glow Level";
|
|
|
|
case SectorLevelType.Light: return "Light Level (" + GetLightType() + ")";
|
|
|
|
default: return "Unknown Level Type!!!";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//mxd. Handy when debugging
|
|
|
|
private string GetLightType()
|
|
|
|
{
|
|
|
|
switch(lighttype)
|
|
|
|
{
|
|
|
|
case LightLevelType.TYPE0: return "Type 0";
|
|
|
|
case LightLevelType.TYPE1: return "Type 1";
|
|
|
|
case LightLevelType.TYPE1_BOTTOM: return "Type 1 (bottom)";
|
|
|
|
case LightLevelType.TYPE2: return "Type 2";
|
|
|
|
default: return "Unknown";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2010-09-02 20:42:38 +00:00
|
|
|
}
|
|
|
|
}
|