From a41dc24086c673dd975965f2dbeb188f7307796b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 29 Jan 2016 14:55:31 +0100 Subject: [PATCH] - fixed: 3D lights should override the sidedef's regular light completely, that includes relative light added by UDMF's 'light' property. - Renamed the 'noabsolute' parameter in side_t::GetLightLevel to 'is3dlight', what it actually is, to avoid the confusion that caused the abovementioned error. - fixed: The Down2Up render path for sides of 3D floors had the 'is3dlight' check inverted. --- src/p_sectors.cpp | 6 +++--- src/r_segs.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index 8ee5c280be..a1cf2077f3 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -1024,9 +1024,9 @@ CUSTOM_CVAR(Int, r_fakecontrast, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) // //========================================================================== -int side_t::GetLightLevel (bool foggy, int baselight, bool noabsolute, int *pfakecontrast) const +int side_t::GetLightLevel (bool foggy, int baselight, bool is3dlight, int *pfakecontrast) const { - if (!noabsolute && (Flags & WALLF_ABSLIGHTING)) + if (!is3dlight && (Flags & WALLF_ABSLIGHTING)) { baselight = Light; } @@ -1066,7 +1066,7 @@ int side_t::GetLightLevel (bool foggy, int baselight, bool noabsolute, int *pfak } } } - if (!(Flags & WALLF_ABSLIGHTING) && (!foggy || (Flags & WALLF_LIGHT_FOG))) + if (!is3dlight && !(Flags & WALLF_ABSLIGHTING) && (!foggy || (Flags & WALLF_LIGHT_FOG))) { baselight += this->Light; } diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 7bcfec13a2..ebf525569f 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -829,7 +829,7 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2) { lightlist_t *lit = &backsector->e->XFloor.lightlist[j]; basecolormap = lit->extra_colormap; - wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *lit->p_lightlevel, lit->lightsource == NULL) + r_actualextralight); + wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *lit->p_lightlevel, lit->lightsource != NULL) + r_actualextralight); break; } } @@ -842,7 +842,7 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2) { lightlist_t *lit = &frontsector->e->XFloor.lightlist[j]; basecolormap = lit->extra_colormap; - wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *lit->p_lightlevel, lit->lightsource == NULL) + r_actualextralight); + wallshade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, *lit->p_lightlevel, lit->lightsource != NULL) + r_actualextralight); break; } }