2019-01-01 18:35:55 +00:00
|
|
|
class DynamicLight : Actor
|
2016-11-15 12:37:56 +00:00
|
|
|
{
|
2019-01-01 18:35:55 +00:00
|
|
|
double SpotInnerAngle;
|
|
|
|
double SpotOuterAngle;
|
|
|
|
private int lighttype;
|
|
|
|
private int lightflags;
|
2018-01-04 16:58:11 +00:00
|
|
|
|
|
|
|
property SpotInnerAngle: SpotInnerAngle;
|
|
|
|
property SpotOuterAngle: SpotOuterAngle;
|
2019-01-01 18:35:55 +00:00
|
|
|
|
|
|
|
flagdef subtractive: lightflags, 0;
|
|
|
|
flagdef additive: lightflags, 1;
|
|
|
|
flagdef dontlightself: lightflags, 2;
|
|
|
|
flagdef attenuate: lightflags, 3;
|
|
|
|
flagdef noshadowmap: lightflags, 4;
|
|
|
|
flagdef dontlightactors: lightflags, 5;
|
|
|
|
flagdef spot: lightflags, 6;
|
2018-01-04 16:58:11 +00:00
|
|
|
|
2017-01-18 18:10:25 +00:00
|
|
|
enum EArgs
|
|
|
|
{
|
|
|
|
LIGHT_RED = 0,
|
|
|
|
LIGHT_GREEN = 1,
|
|
|
|
LIGHT_BLUE = 2,
|
|
|
|
LIGHT_INTENSITY = 3,
|
|
|
|
LIGHT_SECONDARY_INTENSITY = 4,
|
|
|
|
LIGHT_SCALE = 3,
|
|
|
|
};
|
|
|
|
|
2019-07-07 07:50:02 +00:00
|
|
|
// These are for use in A_AttachLight calls.
|
|
|
|
enum LightFlag
|
|
|
|
{
|
|
|
|
LF_SUBTRACTIVE = 1,
|
|
|
|
LF_ADDITIVE = 2,
|
|
|
|
LF_DONTLIGHTSELF = 4,
|
|
|
|
LF_ATTENUATE = 8,
|
|
|
|
LF_NOSHADOWMAP = 16,
|
|
|
|
LF_DONTLIGHTACTORS = 32,
|
|
|
|
LF_SPOT = 64
|
|
|
|
};
|
|
|
|
|
2017-01-18 18:10:25 +00:00
|
|
|
enum ELightType
|
|
|
|
{
|
|
|
|
PointLight,
|
|
|
|
PulseLight,
|
|
|
|
FlickerLight,
|
|
|
|
RandomFlickerLight,
|
|
|
|
SectorLight,
|
2018-01-04 16:58:11 +00:00
|
|
|
DummyLight,
|
2017-01-18 18:10:25 +00:00
|
|
|
ColorPulseLight,
|
|
|
|
ColorFlickerLight,
|
|
|
|
RandomColorFlickerLight
|
|
|
|
};
|
2018-12-20 10:01:24 +00:00
|
|
|
|
|
|
|
native void SetOffset(Vector3 offset);
|
2019-01-01 18:35:55 +00:00
|
|
|
private native void AttachLight();
|
|
|
|
private native void ActivateLight();
|
|
|
|
private native void DeactivateLight();
|
2018-12-20 10:01:24 +00:00
|
|
|
|
2016-11-15 12:37:56 +00:00
|
|
|
Default
|
|
|
|
{
|
|
|
|
Height 0;
|
|
|
|
Radius 0.1;
|
|
|
|
FloatBobPhase 0;
|
2016-12-26 11:02:09 +00:00
|
|
|
RenderRadius -1;
|
2018-04-25 07:14:01 +00:00
|
|
|
DynamicLight.SpotInnerAngle 10;
|
|
|
|
DynamicLight.SpotOuterAngle 25;
|
2016-11-15 12:37:56 +00:00
|
|
|
+NOBLOCKMAP
|
|
|
|
+NOGRAVITY
|
|
|
|
+FIXMAPTHINGPOS
|
|
|
|
+INVISIBLE
|
|
|
|
}
|
2019-01-01 18:35:55 +00:00
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
override void Tick()
|
|
|
|
{
|
|
|
|
// Lights do not call the super method.
|
|
|
|
}
|
|
|
|
|
|
|
|
override void BeginPlay()
|
|
|
|
{
|
|
|
|
ChangeStatNum(STAT_DLIGHT);
|
|
|
|
AttachLight();
|
|
|
|
}
|
|
|
|
|
|
|
|
override void PostBeginPlay()
|
|
|
|
{
|
|
|
|
Super.PostBeginPlay();
|
|
|
|
|
|
|
|
if (!(SpawnFlags & MTF_DORMANT))
|
|
|
|
{
|
|
|
|
Activate(self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
override void Activate(Actor activator)
|
|
|
|
{
|
|
|
|
bDormant = false;
|
|
|
|
ActivateLight();
|
|
|
|
}
|
|
|
|
|
|
|
|
override void Deactivate(Actor activator)
|
|
|
|
{
|
|
|
|
bDormant = true;
|
|
|
|
DeactivateLight();
|
|
|
|
}
|
|
|
|
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class PointLight : DynamicLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
DynamicLight.Type "Point";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PointLightPulse : PointLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
DynamicLight.Type "Pulse";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PointLightFlicker : PointLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
DynamicLight.Type "Flicker";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SectorPointLight : PointLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
DynamicLight.Type "Sector";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PointLightFlickerRandom : PointLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
DynamicLight.Type "RandomFlicker";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-18 08:15:31 +00:00
|
|
|
// DYNAMICLIGHT.ADDITIVE and DYNAMICLIGHT.SUBTRACTIVE are used by the lights for additive and subtractive lights
|
2016-11-15 12:37:56 +00:00
|
|
|
|
|
|
|
class PointLightAdditive : PointLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.ADDITIVE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PointLightPulseAdditive : PointLightPulse
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.ADDITIVE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PointLightFlickerAdditive : PointLightFlicker
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.ADDITIVE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SectorPointLightAdditive : SectorPointLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.ADDITIVE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PointLightFlickerRandomAdditive :PointLightFlickerRandom
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.ADDITIVE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PointLightSubtractive : PointLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.SUBTRACTIVE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PointLightPulseSubtractive : PointLightPulse
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.SUBTRACTIVE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PointLightFlickerSubtractive : PointLightFlicker
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.SUBTRACTIVE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SectorPointLightSubtractive : SectorPointLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.SUBTRACTIVE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class PointLightFlickerRandomSubtractive : PointLightFlickerRandom
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.SUBTRACTIVE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 18:10:25 +00:00
|
|
|
class PointLightAttenuated : PointLight
|
2016-11-15 12:37:56 +00:00
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.ATTENUATE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 18:10:25 +00:00
|
|
|
class PointLightPulseAttenuated : PointLightPulse
|
2016-11-15 12:37:56 +00:00
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.ATTENUATE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 18:10:25 +00:00
|
|
|
class PointLightFlickerAttenuated : PointLightFlicker
|
2016-11-15 12:37:56 +00:00
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.ATTENUATE
|
2016-11-15 12:37:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 18:10:25 +00:00
|
|
|
class SectorPointLightAttenuated : SectorPointLight
|
2016-12-07 22:17:18 +00:00
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.ATTENUATE
|
2016-12-07 22:17:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 18:10:25 +00:00
|
|
|
class PointLightFlickerRandomAttenuated :PointLightFlickerRandom
|
2016-12-07 22:17:18 +00:00
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-06-18 08:15:31 +00:00
|
|
|
+DYNAMICLIGHT.ATTENUATE
|
2016-12-07 22:17:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-04 22:41:57 +00:00
|
|
|
class SpotLight : DynamicLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
DynamicLight.Type "Point";
|
|
|
|
+DYNAMICLIGHT.SPOT
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightPulse : SpotLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
DynamicLight.Type "Pulse";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightFlicker : SpotLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
DynamicLight.Type "Flicker";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SectorSpotLight : SpotLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
DynamicLight.Type "Sector";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightFlickerRandom : SpotLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
DynamicLight.Type "RandomFlicker";
|
|
|
|
}
|
|
|
|
}
|
2018-01-04 23:09:48 +00:00
|
|
|
|
|
|
|
class SpotLightAdditive : SpotLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.ADDITIVE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightPulseAdditive : SpotLightPulse
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.ADDITIVE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightFlickerAdditive : SpotLightFlicker
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.ADDITIVE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SectorSpotLightAdditive : SectorSpotLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.ADDITIVE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightFlickerRandomAdditive : SpotLightFlickerRandom
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.ADDITIVE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightSubtractive : SpotLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.SUBTRACTIVE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightPulseSubtractive : SpotLightPulse
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.SUBTRACTIVE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightFlickerSubtractive : SpotLightFlicker
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.SUBTRACTIVE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SectorSpotLightSubtractive : SectorSpotLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.SUBTRACTIVE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightFlickerRandomSubtractive : SpotLightFlickerRandom
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.SUBTRACTIVE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightAttenuated : SpotLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.ATTENUATE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightPulseAttenuated : SpotLightPulse
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.ATTENUATE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightFlickerAttenuated : SpotLightFlicker
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.ATTENUATE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SectorSpotLightAttenuated : SectorSpotLight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.ATTENUATE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SpotLightFlickerRandomAttenuated : SpotLightFlickerRandom
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+DYNAMICLIGHT.ATTENUATE
|
|
|
|
}
|
|
|
|
}
|
2017-01-18 18:10:25 +00:00
|
|
|
|
|
|
|
class VavoomLight : DynamicLight
|
2016-12-07 22:17:18 +00:00
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
2017-01-18 18:10:25 +00:00
|
|
|
DynamicLight.Type "Point";
|
|
|
|
}
|
|
|
|
|
|
|
|
override void BeginPlay ()
|
|
|
|
{
|
|
|
|
if (CurSector) AddZ(-CurSector.floorplane.ZatPoint(pos.XY), false); // z is absolute for Vavoom lights
|
|
|
|
Super.BeginPlay();
|
2016-12-07 22:17:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 18:10:25 +00:00
|
|
|
class VavoomLightWhite : VavoomLight
|
2016-12-07 22:17:18 +00:00
|
|
|
{
|
2017-01-18 18:10:25 +00:00
|
|
|
override void BeginPlay ()
|
2016-12-07 22:17:18 +00:00
|
|
|
{
|
2017-01-18 18:10:25 +00:00
|
|
|
args[LIGHT_INTENSITY] = args[0] * 4;
|
|
|
|
args[LIGHT_RED] = 128;
|
|
|
|
args[LIGHT_GREEN] = 128;
|
|
|
|
args[LIGHT_BLUE] = 128;
|
|
|
|
|
|
|
|
Super.BeginPlay();
|
2016-12-07 22:17:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 18:10:25 +00:00
|
|
|
class VavoomLightColor : VavoomLight
|
2016-12-07 22:17:18 +00:00
|
|
|
{
|
2017-01-18 18:10:25 +00:00
|
|
|
override void BeginPlay ()
|
2016-12-07 22:17:18 +00:00
|
|
|
{
|
2017-01-18 18:10:25 +00:00
|
|
|
int radius = args[0] * 4;
|
|
|
|
args[LIGHT_RED] = args[1] >> 1;
|
|
|
|
args[LIGHT_GREEN] = args[2] >> 1;
|
|
|
|
args[LIGHT_BLUE] = args[3] >> 1;
|
|
|
|
args[LIGHT_INTENSITY] = radius;
|
|
|
|
Super.BeginPlay();
|
2016-12-07 22:17:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-01-18 18:10:25 +00:00
|
|
|
|