From d315a838bd144d7782eb6faa415a83a09be8b1dc Mon Sep 17 00:00:00 2001 From: mittorn Date: Sun, 31 Mar 2019 03:44:57 +0700 Subject: [PATCH] ref_soft: invalidata all caches on dlight rebuild --- r_surf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/r_surf.c b/r_surf.c index 1e306c65..533d7acf 100644 --- a/r_surf.c +++ b/r_surf.c @@ -1161,6 +1161,16 @@ surfcache_t *D_CacheSurface (msurface_t *surface, int miplevel) && cache->lightadj[3] == r_drawsurf.lightadj[3] ) return cache; + if( surface->dlightframe == r_framecount ) + { + int i; + // invalidate dlight cache + for( i = 0; i < 4; i++) + { + if( CACHESPOT(surface)[i] ) + CACHESPOT(surface)[i]->image = NULL; + } + } // // determine shape of surface //