Added ADDLIGHTLEVEL to add the sector light level to an actor's own defined light level, if desired.

This commit is contained in:
Major Cooke 2022-05-31 13:47:10 -05:00 committed by Christoph Oelckers
commit 3d14cec191
4 changed files with 23 additions and 3 deletions

View file

@ -956,7 +956,15 @@ namespace swrenderer
thingColormap = GetSpriteColorTable(thing->Sector->Colormap, thing->Sector->SpecialColors[sector_t::sprites], nc);
}
if (thing->LightLevel > -1)
{
thinglightlevel = thing->LightLevel;
if (thing->flags8 & MF8_ADDLIGHTLEVEL)
{
thinglightlevel += thing->Sector->GetTexture(sector_t::ceiling) == skyflatnum ? thing->Sector->GetCeilingLight() : thing->Sector->GetFloorLight();
thinglightlevel = clamp(thinglightlevel, 0, 255);
}
}
if ((sprite.renderflags & RF_SPRITETYPEMASK) == RF_WALLSPRITE)
{
RenderWallSprite::Project(Thread, thing, sprite.pos, sprite.tex, sprite.spriteScale, sprite.renderflags, thinglightlevel, foggy, thingColormap);