From 7242a0ef94234fa1c789ce2ddbe8d1b651c47835 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 29 Feb 2016 10:26:07 +0100 Subject: [PATCH] - fixed: Rendering 2-sided walls with 3D floor light effects had the 'is3dfloor' flag of GetLightLevel inverted. --- src/r_defs.h | 2 +- src/r_segs.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/r_defs.h b/src/r_defs.h index 6ad406eca..f325f0861 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -978,7 +978,7 @@ struct side_t BYTE Flags; int Index; // needed to access custom UDMF fields which are stored in loading order. - int GetLightLevel (bool foggy, int baselight, bool noabsolute=false, int *pfakecontrast_usedbygzdoom=NULL) const; + int GetLightLevel (bool foggy, int baselight, bool is3dlight=false, int *pfakecontrast_usedbygzdoom=NULL) const; void SetLight(SWORD l) { diff --git a/src/r_segs.cpp b/src/r_segs.cpp index ae38b3978..0448cf6aa 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -272,17 +272,17 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) if (fixedlightlev < 0) { + if (!(fake3D & FAKE3D_CLIPTOP)) + { + sclipTop = sec->ceilingplane.ZatPoint(viewx, viewy); + } for (i = frontsector->e->XFloor.lightlist.Size() - 1; i >= 0; i--) { - if (!(fake3D & FAKE3D_CLIPTOP)) - { - sclipTop = sec->ceilingplane.ZatPoint(viewx, viewy); - } - if (sclipTop <= frontsector->e->XFloor.lightlist[i].plane.ZatPoint(viewx, viewy)) + if (sclipTop <= frontsector->e->XFloor.lightlist[i].plane.Zat0()) { lightlist_t *lit = &frontsector->e->XFloor.lightlist[i]; 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; } }