Renderer: force Trip Wires to maximum brightness, ignore colormaps

Fixes sector light level and colormaps darkening Trip
Wires, especially in OpenGL.
This commit is contained in:
James R 2023-03-28 21:04:20 -07:00
parent 4588a20a95
commit c53ae816c1
2 changed files with 34 additions and 14 deletions

View file

@ -1008,10 +1008,12 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
fixed_t h, l; // 3D sides and 2s middle textures
fixed_t hS, lS;
FUINT lightnum = 255; // shut up compiler
FUINT lightnum = 255;
extracolormap_t *colormap;
FSurfaceInfo Surf;
boolean tripwire;
gl_sidedef = gl_curline->sidedef;
gl_linedef = gl_curline->linedef;
@ -1051,7 +1053,13 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
cliphigh = (float)(texturehpeg + (gl_curline->flength*FRACUNIT));
}
lightnum = HWR_CalcWallLight(gl_frontsector->lightlevel, gl_curline);
tripwire = P_IsLineTripWire(gl_linedef);
if (tripwire == false)
{
lightnum = HWR_CalcWallLight(gl_frontsector->lightlevel, gl_curline);
}
colormap = gl_frontsector->extra_colormap;
if (gl_frontsector)
@ -1427,7 +1435,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
// This will cause the midtexture appear on top, if a FOF overlaps with it.
blendmode |= PF_Decal;
if (gl_frontsector->numlights)
if (tripwire == false && gl_frontsector->numlights)
{
if (!(blendmode & PF_Masked))
HWR_SplitWall(gl_frontsector, wallVerts, gl_midtexture, &Surf, FOF_TRANSLUCENT, NULL, blendmode); // vanilla just uses PF_Masked here - if we run into any issues, maybe change to that

View file

@ -172,14 +172,16 @@ static void R_RenderMaskedSegLoop(drawseg_t *ds, INT32 x1, INT32 x2, INT32 texnu
INT32 range;
sector_t *front, *back;
INT32 times, repeats;
boolean tripwire;
ldef = curline->linedef;
tripwire = P_IsLineTripWire(ldef);
range = max(ds->x2-ds->x1, 1);
// Setup lighting based on the presence/lack-of 3D floors.
dc_numlights = 0;
if (frontsector->numlights)
if (tripwire == false && frontsector->numlights)
{
dc_numlights = frontsector->numlights;
if (dc_numlights >= dc_maxlights)
@ -226,19 +228,29 @@ static void R_RenderMaskedSegLoop(drawseg_t *ds, INT32 x1, INT32 x2, INT32 texnu
}
else
{
if ((R_CheckColumnFunc(COLDRAWFUNC_FUZZY) == false)
|| (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
if (tripwire)
{
lightnum = LIGHTLEVELS - 1; // tripwires are full bright
}
else
lightnum = LIGHTLEVELS - 1;
{
if ((R_CheckColumnFunc(COLDRAWFUNC_FUZZY) == false)
|| (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
{
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
}
else
{
lightnum = LIGHTLEVELS - 1;
if ((R_CheckColumnFunc(COLDRAWFUNC_FOG) == true)
|| (frontsector->extra_colormap && (frontsector->extra_colormap->flags & CMF_FOG)))
;
else if (P_ApplyLightOffset(lightnum))
lightnum += curline->lightOffset;
if (P_ApplyLightOffset(lightnum))
{
lightnum += curline->lightOffset;
}
}
lightnum = R_AdjustLightLevel(lightnum);
lightnum = R_AdjustLightLevel(lightnum);
}
if (lightnum < 0)
walllights = scalelight[0];