From 0aa67c68ab44ee79dbbad27765ae41e18d41256d Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 7 Aug 2014 17:23:06 -0500 Subject: [PATCH] Redo lighting for each wall sprite - Because previously it just reused whatever the most recently drawn wall used. --- src/r_things.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/r_things.cpp b/src/r_things.cpp index 72ebcf8c49..84ce18b64d 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -409,7 +409,6 @@ void R_DrawWallSprite(vissprite_t *spr) { int x1, x2; fixed_t yscale; - int shade = LIGHT2SHADE(140); x1 = MAX(spr->x1, spr->wallc.sx1); x2 = MIN(spr->x2, spr->wallc.sx2 + 1); @@ -440,6 +439,10 @@ void R_DrawWallSprite(vissprite_t *spr) rereadcolormap = false; } + int shade = LIGHT2SHADE(spr->sector->lightlevel + r_actualextralight); + GlobVis = r_WallVisibility; + rw_lightleft = SafeDivScale12(GlobVis, spr->wallc.sz1); + rw_lightstep = (SafeDivScale12(GlobVis, spr->wallc.sz2) - rw_lightleft) / (spr->wallc.sx2 - spr->wallc.sx1); rw_light = rw_lightleft + (x1 - spr->wallc.sx1) * rw_lightstep; if (fixedlightlev >= 0) dc_colormap = usecolormap->Maps + fixedlightlev;