From 42ce1f1a8676a266337f05af386d1d48f5ed31b6 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 6 Aug 2023 00:21:54 +0900 Subject: [PATCH] [renderer] Fix a silly double set test No wonder the final changes didn't make as much difference as I expected. --- libs/video/renderer/r_bsp.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/libs/video/renderer/r_bsp.c b/libs/video/renderer/r_bsp.c index 993709a2e..4195fa11d 100644 --- a/libs/video/renderer/r_bsp.c +++ b/libs/video/renderer/r_bsp.c @@ -53,24 +53,22 @@ R_MarkLeavesPVS (visstate_t *visstate, const set_t *pvs) auto face_visframes = visstate->face_visframes; for (auto li = set_first (pvs); li; li = set_next (li)) { unsigned i = li->element; - if (set_is_member (pvs, i)) { - auto leaf = &brush->leafs[i + 1]; - int c; - if ((c = leaf->nummarksurfaces)) { - auto mark = brush->marksurfaces + leaf->firstmarksurface; - do { - face_visframes[*mark - brush->surfaces] = visframecount; - mark++; - } while (--c); - } - leaf_visframes[i + 1] = visframecount; - int node_id = brush->leaf_parents[leaf - brush->leafs]; - while (node_id >= 0) { - if (node_visframes[node_id] == visframecount) - break; - node_visframes[node_id] = visframecount; - node_id = brush->node_parents[node_id]; - } + auto leaf = &brush->leafs[i + 1]; + int c; + if ((c = leaf->nummarksurfaces)) { + auto mark = brush->marksurfaces + leaf->firstmarksurface; + do { + face_visframes[*mark - brush->surfaces] = visframecount; + mark++; + } while (--c); + } + leaf_visframes[i + 1] = visframecount; + int node_id = brush->leaf_parents[leaf - brush->leafs]; + while (node_id >= 0) { + if (node_visframes[node_id] == visframecount) + break; + node_visframes[node_id] = visframecount; + node_id = brush->node_parents[node_id]; } } }