From 961e6d9e6c387781ec5bf0c1db9caa1203bb60bc Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 17 Mar 2022 17:46:25 +0900 Subject: [PATCH] [gl] Remove unnecessary light map update code gl_overbright_f shouldn't need to run through any entity queues to update the light maps as only the world model has light maps, and hitting the world model should hit all its sub-models. --- libs/video/renderer/gl/gl_lightmap.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/libs/video/renderer/gl/gl_lightmap.c b/libs/video/renderer/gl/gl_lightmap.c index 49469067c..a2ce210da 100644 --- a/libs/video/renderer/gl/gl_lightmap.c +++ b/libs/video/renderer/gl/gl_lightmap.c @@ -529,7 +529,6 @@ void gl_overbright_f (cvar_t *var) { int num; - model_t *m; mod_brush_t *brush; if (!var) @@ -576,29 +575,6 @@ gl_overbright_f (cvar_t *var) if (!gl_R_BuildLightMap) return; - for (size_t i = 0; i < r_ent_queue->ent_queues[mod_brush].size; i++) { \ - entity_t *ent = r_ent_queue->ent_queues[mod_brush].a[i]; \ - m = ent->renderer.model; - if (m->path[0] == '*') - continue; - - brush = &m->brush; - for (unsigned j = 0; j < brush->numsurfaces; j++) { - msurface_t *surf = brush->surfaces + j; - if (surf->flags & (SURF_DRAWTURB | SURF_DRAWSKY)) - continue; - - num = surf->lightmaptexturenum; - gl_lightmap_modified[num] = true; - gl_lightmap_rectchange[num].l = 0; - gl_lightmap_rectchange[num].t = 0; - gl_lightmap_rectchange[num].w = BLOCK_WIDTH; - gl_lightmap_rectchange[num].h = BLOCK_HEIGHT; - - gl_R_BuildLightMap (0, brush, surf); - } - } - brush = &r_refdef.worldmodel->brush; for (unsigned i = 0; i < brush->numsurfaces; i++) {