Skip to content

Commit 3befb3f

Browse files
committed
limit light alpha mult to renderflag
1 parent eee9382 commit 3befb3f

File tree

5 files changed

+5
-2
lines changed

5 files changed

+5
-2
lines changed

src/playsim/actor.h

+1
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ enum ActorRenderFlag2
508508
RF2_ISOMETRICSPRITES = 0x0080,
509509
RF2_SQUAREPIXELS = 0x0100, // apply +ROLLSPRITE scaling math so that non rolling sprites get the same scaling
510510
RF2_STRETCHPIXELS = 0x0200, // don't apply SQUAREPIXELS for ROLLSPRITES
511+
RF2_LIGHTMULTALPHA = 0x0400, // attached lights use alpha as intensity multiplier
511512
};
512513

513514
// This translucency value produces the closest match to Heretic's TINTTAB.

src/rendering/hwrenderer/hw_dynlightdata.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void AddLightToList(FDynLightData &dld, int group, FDynamicLight * light, bool f
9292
cs = 1.0f;
9393
}
9494

95-
if (light->target)
95+
if (light->target && (light->target->renderflags2 & RF2_LIGHTMULTALPHA))
9696
cs *= (float)light->target->Alpha;
9797

9898
float r = light->GetRed() / 255.0f * cs;

src/rendering/hwrenderer/scene/hw_spritelight.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ void HWDrawInfo::GetDynSpriteLight(AActor *self, float x, float y, float z, FLig
177177
lg = light->GetGreen() / 255.0f;
178178
lb = light->GetBlue() / 255.0f;
179179

180-
if (light->target)
180+
if (light->target && (light->target->renderflags2 & RF2_LIGHTMULTALPHA))
181181
{
182182
float alpha = (float)light->target->Alpha;
183183
lr *= alpha;

src/scripting/thingdef_data.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ static FFlagDef ActorFlagDefs[]=
389389
DEFINE_FLAG(RF2, ISOMETRICSPRITES, AActor, renderflags2),
390390
DEFINE_FLAG(RF2, SQUAREPIXELS, AActor, renderflags2),
391391
DEFINE_FLAG(RF2, STRETCHPIXELS, AActor, renderflags2),
392+
DEFINE_FLAG(RF2, LIGHTMULTALPHA, AActor, renderflags2),
392393

393394
// Bounce flags
394395
DEFINE_FLAG2(BOUNCE_Walls, BOUNCEONWALLS, AActor, BounceFlags),

wadsrc/static/zscript/actors/shared/dynlights.zs

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class DynamicLight : Actor
7373
+FIXMAPTHINGPOS
7474
+INVISIBLE
7575
+NOTONAUTOMAP
76+
+LIGHTMULTALPHA
7677
}
7778

7879
//==========================================================================

0 commit comments

Comments
 (0)