Game configurations: added option to enable/disable GZDoom style distinct brightness for walls/ceilings/floors. Fixes #618

This commit is contained in:
biwa 2021-09-06 23:05:58 +02:00
parent d766f27e75
commit da52f71154
6 changed files with 34 additions and 3 deletions

View file

@ -364,6 +364,9 @@ mapformat_udmf
// Enables support for plane equation slopes // Enables support for plane equation slopes
planeequationsupport = true; planeequationsupport = true;
// Enables setting brightness for floor, ceiling, and walls independently from each other
distinctsurfacebrightness = true;
// Default nodebuilder configurations // Default nodebuilder configurations
defaultsavecompiler = "zdbsp_udmf_normal"; defaultsavecompiler = "zdbsp_udmf_normal";
defaulttestcompiler = "zdbsp_udmf_fast"; defaulttestcompiler = "zdbsp_udmf_fast";

View file

@ -110,6 +110,7 @@ namespace CodeImp.DoomBuilder.Config
private readonly bool localsidedeftextureoffsets; //MaxW private readonly bool localsidedeftextureoffsets; //MaxW
private readonly bool effect3dfloorsupport; private readonly bool effect3dfloorsupport;
private readonly bool planeequationsupport; private readonly bool planeequationsupport;
private readonly bool distinctsurfacebrightness;
// Skills // Skills
private readonly List<SkillInfo> skills; private readonly List<SkillInfo> skills;
@ -282,6 +283,7 @@ namespace CodeImp.DoomBuilder.Config
public bool UseLocalSidedefTextureOffsets { get { return localsidedeftextureoffsets; } } //MaxW public bool UseLocalSidedefTextureOffsets { get { return localsidedeftextureoffsets; } } //MaxW
public bool Effect3DFloorSupport { get { return effect3dfloorsupport; } } public bool Effect3DFloorSupport { get { return effect3dfloorsupport; } }
public bool PlaneEquationSupport { get { return planeequationsupport; } } public bool PlaneEquationSupport { get { return planeequationsupport; } }
public bool DistinctSurfaceBrightness { get { return distinctsurfacebrightness; } }
// Texture/flat/voxel sources // Texture/flat/voxel sources
public IDictionary TextureRanges { get { return textureranges; } } public IDictionary TextureRanges { get { return textureranges; } }
@ -456,6 +458,7 @@ namespace CodeImp.DoomBuilder.Config
localsidedeftextureoffsets = (cfg.ReadSetting("localsidedeftextureoffsets", false)); //MaxW localsidedeftextureoffsets = (cfg.ReadSetting("localsidedeftextureoffsets", false)); //MaxW
effect3dfloorsupport = cfg.ReadSetting("effect3dfloorsupport", false); effect3dfloorsupport = cfg.ReadSetting("effect3dfloorsupport", false);
planeequationsupport = cfg.ReadSetting("planeequationsupport", false); planeequationsupport = cfg.ReadSetting("planeequationsupport", false);
distinctsurfacebrightness = cfg.ReadSetting("distinctsurfacebrightness", false);
for (int i = 0; i < Linedef.NUM_ARGS; i++) makedoorargs[i] = cfg.ReadSetting("makedoorarg" + i.ToString(CultureInfo.InvariantCulture), 0); for (int i = 0; i < Linedef.NUM_ARGS; i++) makedoorargs[i] = cfg.ReadSetting("makedoorarg" + i.ToString(CultureInfo.InvariantCulture), 0);
//mxd. Update map format flags //mxd. Update map format flags

View file

@ -237,6 +237,18 @@ namespace CodeImp.DoomBuilder.Windows
labelBackOffsetMid.Enabled = false; labelBackOffsetMid.Enabled = false;
labelBackOffsetBottom.Enabled = false; labelBackOffsetBottom.Enabled = false;
} }
// Diable brightness controls?
if(!General.Map.Config.DistinctSurfaceBrightness)
{
lightFront.Enabled = false;
cbLightAbsoluteFront.Enabled = false;
resetfrontlight.Enabled = false;
lightBack.Enabled = false;
cbLightAbsoluteBack.Enabled = false;
resetbacklight.Enabled = false;
}
} }
#endregion #endregion

View file

@ -298,6 +298,18 @@ namespace CodeImp.DoomBuilder.Windows
ceilingslopecontrol.PivotMode = (SlopePivotMode)General.Settings.ReadSetting("windows." + configname + ".ceilpivotmode", (int)SlopePivotMode.LOCAL); ceilingslopecontrol.PivotMode = (SlopePivotMode)General.Settings.ReadSetting("windows." + configname + ".ceilpivotmode", (int)SlopePivotMode.LOCAL);
floorslopecontrol.PivotMode = (SlopePivotMode)General.Settings.ReadSetting("windows." + configname + ".floorpivotmode", (int)SlopePivotMode.LOCAL); floorslopecontrol.PivotMode = (SlopePivotMode)General.Settings.ReadSetting("windows." + configname + ".floorpivotmode", (int)SlopePivotMode.LOCAL);
// Diable brightness controls?
if(!General.Map.Config.DistinctSurfaceBrightness)
{
ceilBrightness.Enabled = false;
ceilLightAbsolute.Enabled = false;
resetceillight.Enabled = false;
floorBrightness.Enabled = false;
floorLightAbsolute.Enabled = false;
resetfloorlight.Enabled = false;
}
} }
#endregion #endregion

View file

@ -1550,7 +1550,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
public virtual void OnChangeTargetBrightness(bool up) public virtual void OnChangeTargetBrightness(bool up)
{ {
//mxd. Change UDMF wall light? //mxd. Change UDMF wall light?
if(General.Map.UDMF) if(General.Map.UDMF && General.Map.Config.DistinctSurfaceBrightness)
{ {
int light = Sidedef.Fields.GetValue("light", 0); int light = Sidedef.Fields.GetValue("light", 0);
bool absolute = Sidedef.Fields.GetValue("lightabsolute", false); bool absolute = Sidedef.Fields.GetValue("lightabsolute", false);

View file

@ -457,8 +457,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
} }
else else
{ {
//if a map is not in UDMF format, or this ceiling is part of 3D-floor... // Change the sector brightness if the map is not in UDMF format, or this ceiling is part of 3D-floor,
if(!General.Map.UDMF || (level != null && Sector.Sector != level.sector)) // or the game configuration doesn't support distinct surfave brightnesses
if(!General.Map.UDMF || (level != null && Sector.Sector != level.sector) || !General.Map.Config.DistinctSurfaceBrightness)
{ {
base.OnChangeTargetBrightness(up); base.OnChangeTargetBrightness(up);
return; return;