From 46e0b16370c7c14a84ecfc35469bd3e6a8770ef7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 23 Mar 2021 19:20:06 +0100 Subject: [PATCH] - fixed ordering issues in drawer * do not check the clipper in the collection pass to reduce number of bunches. Clipping here brings no performance gain. * fixed the loop reset in FindClosestBunch to actually process the array's first element. --- source/core/rendering/scene/hw_bunchdrawer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/core/rendering/scene/hw_bunchdrawer.cpp b/source/core/rendering/scene/hw_bunchdrawer.cpp index c3383a141..87bb63304 100644 --- a/source/core/rendering/scene/hw_bunchdrawer.cpp +++ b/source/core/rendering/scene/hw_bunchdrawer.cpp @@ -40,7 +40,6 @@ #include "gamefuncs.h" - //========================================================================== // // @@ -238,8 +237,7 @@ void BunchDrawer::ProcessBunch(int bnch) SetupWall.Clock(); HWWall hwwall; - //Printf("Rendering wall %d\n", i); - hwwall.Process(di, &wall[i], §or[bunch->sectnum], wall[i].nextsector<0? nullptr : §or[wall[i].nextsector]); + hwwall.Process(di, &wall[i], §or[bunch->sectnum], wall[i].nextsector < 0 ? nullptr : §or[wall[i].nextsector]); rendered_lines++; SetupWall.Unclock(); @@ -401,7 +399,7 @@ int BunchDrawer::FindClosestBunch() closest = CompareData[i]; CompareData[i] = CompareData.Last(); CompareData.Pop(); - i = 0; // we need to recheck everything that's still marked. + i = -1; // we need to recheck everything that's still marked. -1 because this will get incremented before being used. continue; case 1: // is behind @@ -459,11 +457,13 @@ void BunchDrawer::ProcessSector(int sectnum) // Backside inbunch = false; } + /* disabled because it only fragments the bunches without any performance gain. else if (!clipper->SafeCheckRange(ang1, ang2)) { // is it visible? inbunch = false; } + */ else if (!inbunch || ang2.asbam() - startangle.asbam() >= ANGLE_180) { // don't let a bunch span more than 180° to avoid problems.