From 1abf62e9295de4eff29b70368bcb828123df5e65 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 16 Feb 2025 15:37:43 +0100 Subject: [PATCH] skip checking sectors and lines multiple times --- src/hardware/hw_cache.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index b416a11e3..1735fce9f 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -568,6 +568,12 @@ static void HWR_PrecacheLevelFlats(void) { sector_t *sec = §ors[i]; + // sector checked already? + if (sec->validcount == validcount) + continue; + + sec->validcount = validcount; + // gotta check sector floor and ceiling for (j = 0; j < 2; j++) { @@ -633,6 +639,12 @@ static void HWR_PrecacheLevelTextures(void) const int noencoremap = 1; #endif + // line checked already? + if (line->validcount == validcount) + continue; + + line->validcount = validcount; + // two sides for (j = 0; j < 2; j++) {