From 4b948de22596b071a92e697731638d9cd7adc029 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 30 Jan 2012 18:41:27 +0900 Subject: [PATCH] Ensure the lightmap gets rebuilt when the dlights disappear. I didn't realize what that line was for when I copied the code from GL :/ --- libs/video/renderer/glsl/glsl_lightmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/video/renderer/glsl/glsl_lightmap.c b/libs/video/renderer/glsl/glsl_lightmap.c index 183fc448b..d1401c906 100644 --- a/libs/video/renderer/glsl/glsl_lightmap.c +++ b/libs/video/renderer/glsl/glsl_lightmap.c @@ -128,6 +128,10 @@ R_BuildLightMap_1 (msurface_t *surf) int i, t; byte *out; + // If we add dlights this frame, make sure they get removed next frame + // if the dlights disappear suddenly + surf->cached_dlight = (surf->dlightframe == r_framecount); + smax = (surf->extents[0] >> 4) + 1; tmax = (surf->extents[1] >> 4) + 1; size = smax * tmax;