From dc4f3ae04215eee1e20146ea54105639be75dbb6 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 27 Nov 2025 16:21:24 +0100 Subject: [PATCH] HWR_Subsector: avoid calling HWR_AddSprites on already processed sectors --- src/hardware/hw_main.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index 7e1658e84..b98d7afe9 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -3184,12 +3184,15 @@ doaddline: // hurdler: false: we only add the sprites, the walls are drawn first if (line) { - // draw sprites first, coz they are clipped to the solidsegs of - // subsectors more 'in front' - if (cv_drawdist.value || current_bsp_culling_distance) - HWR_AddSprites(gl_frontsector); - else - HWR_AddSprites(gl_frontsector); + if (sub->sector->validcount != validcount) + { + // draw sprites first, coz they are clipped to the solidsegs of + // subsectors more 'in front' + if (cv_drawdist.value || current_bsp_culling_distance) + HWR_AddSprites(gl_frontsector); + else + HWR_AddSprites(gl_frontsector); + } //Hurdler: at this point validcount must be the same, but is not because // gl_frontsector doesn't point anymore to sub->sector due to