mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-27 14:12:16 +00:00
5fe89efc7c
Visual mode: added support for "Transfer Floor Brightness" (210) effect. Visual mode: added support for "Transfer Ceiling Brightness" (211) effect. Visual mode: changed the way thing brightness is calculated. Should be closer to GZDoom now. Sector Edit Form: you can now enter "++" or "--" into "Height Offset" input to raise or lower sectors by their height. Cosmetic fix in ZDoom_linedefs.cfg.
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
#region === Copyright (c) 2015 MaxED ===
|
|
|
|
using CodeImp.DoomBuilder.Map;
|
|
|
|
#endregion
|
|
|
|
namespace CodeImp.DoomBuilder.BuilderModes
|
|
{
|
|
internal class EffectTransferFloorBrightness : SectorEffect
|
|
{
|
|
// Linedef that is used to create this effect
|
|
private readonly Linedef linedef;
|
|
|
|
// Constructor
|
|
public EffectTransferFloorBrightness(SectorData data, Linedef sourcelinedef) : base(data)
|
|
{
|
|
linedef = sourcelinedef;
|
|
|
|
// New effect added: This sector needs an update!
|
|
if(data.Mode.VisualSectorExists(data.Sector))
|
|
{
|
|
BaseVisualSector vs = (BaseVisualSector)data.Mode.GetVisualSector(data.Sector);
|
|
vs.UpdateSectorGeometry(false);
|
|
}
|
|
}
|
|
|
|
// This makes sure we are updated with the source linedef information
|
|
public override void Update()
|
|
{
|
|
SectorData sd = data.Mode.GetSectorData(linedef.Front.Sector);
|
|
if(!sd.Updated) sd.Update();
|
|
sd.AddUpdateSector(data.Sector, false);
|
|
|
|
// Transfer floor brightness
|
|
data.Floor.color = General.Map.Renderer3D.CalculateBrightness(sd.Sector.Brightness);
|
|
data.Floor.brightnessbelow = sd.Floor.brightnessbelow;
|
|
}
|
|
}
|
|
}
|