mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
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:
parent
4588a20a95
commit
c53ae816c1
2 changed files with 34 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
34
src/r_segs.c
34
src/r_segs.c
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue