From 98cbacfe9df97fae5a7627a973cea48108c13690 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 26 Apr 2022 07:14:03 +0900 Subject: [PATCH] [renderer] Remove redundant calls to visit_leaf I doubt the calls were ever actually made in a normal map due to the node actually being a node when breaking out of the loop, but when I experimented with an empty world model (no nodes, one infinite empty leaf) I found that visit_leaf was getting called twice instead of once. --- libs/video/renderer/gl/gl_rsurf.c | 2 -- libs/video/renderer/glsl/glsl_bsp.c | 2 -- libs/video/renderer/sw/sw_rbsp.c | 2 -- libs/video/renderer/vulkan/vulkan_bsp.c | 2 -- 4 files changed, 8 deletions(-) diff --git a/libs/video/renderer/gl/gl_rsurf.c b/libs/video/renderer/gl/gl_rsurf.c index c9c143c08..a796c1462 100644 --- a/libs/video/renderer/gl/gl_rsurf.c +++ b/libs/video/renderer/gl/gl_rsurf.c @@ -712,8 +712,6 @@ R_VisitWorldNodes (glbspctx_t *bctx) } break; } - if (node->contents < 0 && node->contents != CONTENTS_SOLID) - visit_leaf ((mleaf_t *) node); } void diff --git a/libs/video/renderer/glsl/glsl_bsp.c b/libs/video/renderer/glsl/glsl_bsp.c index cfdcec3b9..a4bd95182 100644 --- a/libs/video/renderer/glsl/glsl_bsp.c +++ b/libs/video/renderer/glsl/glsl_bsp.c @@ -831,8 +831,6 @@ R_VisitWorldNodes (glslbspctx_t *bctx) } break; } - if (node->contents < 0 && node->contents != CONTENTS_SOLID) - visit_leaf ((mleaf_t *) node); } static void diff --git a/libs/video/renderer/sw/sw_rbsp.c b/libs/video/renderer/sw/sw_rbsp.c index 81c8efc44..1362f9436 100644 --- a/libs/video/renderer/sw/sw_rbsp.c +++ b/libs/video/renderer/sw/sw_rbsp.c @@ -513,8 +513,6 @@ R_VisitWorldNodes (swbspctx_t *bctx, int clipflags) } break; } - if (node->contents < 0 && node->contents != CONTENTS_SOLID) - visit_leaf ((mleaf_t *) node); } void diff --git a/libs/video/renderer/vulkan/vulkan_bsp.c b/libs/video/renderer/vulkan/vulkan_bsp.c index 336c4b08a..c7ee0cd2e 100644 --- a/libs/video/renderer/vulkan/vulkan_bsp.c +++ b/libs/video/renderer/vulkan/vulkan_bsp.c @@ -746,8 +746,6 @@ R_VisitWorldNodes (mod_brush_t *brush, vulkan_ctx_t *ctx) } break; } - if (node->contents < 0 && node->contents != CONTENTS_SOLID) - visit_leaf ((mleaf_t *) node); } static void