From f707812826e0794fa7737bb5596a29bebf649026 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 8 Mar 2007 23:39:14 +0000 Subject: [PATCH] fixed bug in portal culling code that allowed a leaf to be revisited multiple times, causing it to be counted multiple times, and wasting a small amount of time marking surfaces redundantly git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6944 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rsurf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gl_rsurf.c b/gl_rsurf.c index 3c8302ec..d8e16f95 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -472,8 +472,10 @@ void R_View_WorldVisibility(void) leafstackpos = 1; while (leafstackpos) { - r_refdef.stats.world_leafs++; leaf = leafstack[--leafstackpos]; + if (r_viewcache.world_leafvisible[leaf - model->brush.data_leafs]) + continue; + r_refdef.stats.world_leafs++; r_viewcache.world_leafvisible[leaf - model->brush.data_leafs] = true; // mark any surfaces bounding this leaf if (leaf->numleafsurfaces) -- 2.39.2