match software slope contrast inversal in opengl
This commit is contained in:
1 parent
18a72d617d
commit
033e0cd416
1 file changed
+3
-3
@@ -529,7 +529,7 @@ static FUINT HWR_CalcWallLight(FUINT lightnum, seg_t *seg, extracolormap_t *colo
|
||||
return (FUINT)finallight;
|
||||
}
|
||||
|
||||
static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t *sector, const boolean fof)
|
||||
static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t *sector, const boolean reverseLight)
|
||||
{
|
||||
INT16 finallight = lightnum;
|
||||
|
||||
@@ -539,7 +539,7 @@ static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t
|
||||
if (slope != NULL && sector != NULL && HWR_ApplyLightOffset(lightnum, sector))
|
||||
{
|
||||
const INT16 offset = (cv_glfakecontrast.value == 2) ? slope->hwLightOffset : ((INT16)slope->lightOffset * 8);
|
||||
finallight += (fof ? -offset : offset);
|
||||
finallight += ((reverseLight && maplighting.directional) ? -offset : offset);
|
||||
finallight = CLAMP(finallight, 0, 255);
|
||||
}
|
||||
|
||||
@@ -703,7 +703,7 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
|
||||
SETUP3DVERT(v3d, pv->x, pv->y);
|
||||
|
||||
if (slope)
|
||||
lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector != NULL));
|
||||
lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector && !isceiling) || (!FOFsector && isceiling));
|
||||
|
||||
HWR_Lighting(&Surf, lightlevel, planecolormap, P_SectorUsesDirectionalLighting(gl_frontsector));
|
||||
|
||||
|
||||
Reference in new issue
Block a user