mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-24 04:41:10 +00:00
50 lines
1.2 KiB
C#
50 lines
1.2 KiB
C#
|
#region === Copyright (c) 2010 Pascal van der Heiden ===
|
|||
|
|
|||
|
using System;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Globalization;
|
|||
|
using System.Text;
|
|||
|
using CodeImp.DoomBuilder.Geometry;
|
|||
|
using CodeImp.DoomBuilder.Map;
|
|||
|
using CodeImp.DoomBuilder.Rendering;
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
|
{
|
|||
|
internal class EffectBrightnessLevel : SectorEffect
|
|||
|
{
|
|||
|
// Linedef that is used to create this effect
|
|||
|
// The sector can be found by linedef.Front.Sector
|
|||
|
private Linedef linedef;
|
|||
|
|
|||
|
// Level plane
|
|||
|
private SectorLevel level;
|
|||
|
|
|||
|
// Constructor
|
|||
|
public EffectBrightnessLevel(SectorData data, Linedef sourcelinedef) : base(data)
|
|||
|
{
|
|||
|
linedef = sourcelinedef;
|
|||
|
}
|
|||
|
|
|||
|
// 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();
|
|||
|
data.AddUpdateSector(linedef.Front.Sector, false);
|
|||
|
|
|||
|
if(level == null)
|
|||
|
{
|
|||
|
level = new SectorLevel(sd.Ceiling);
|
|||
|
data.AddSectorLevel(level);
|
|||
|
}
|
|||
|
|
|||
|
// Update level
|
|||
|
sd.Ceiling.CopyProperties(level);
|
|||
|
level.type = SectorLevelType.Light;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|