Optimze horizonline check

noticed during profiling due to how it was checked R_PointOnSegSide was called extremely often even if the less expensive check  returned false
This commit is contained in:
Alug committed 2025-04-06 08:43:40 +02:00
1 parent 0f3be26c42
commit 0ec286b9f4
1 file changed
+4 -1
+4 -1
View File
@@ -768,7 +768,10 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
for (i = 0; i < subsector->numlines; i++, line++)
{
if (!(line->linedef->special == HORIZONSPECIAL && R_PointOnSegSide(viewx, viewy, line) == 0))
if (line->linedef->special != HORIZONSPECIAL)
continue;
if (R_PointOnSegSide(viewx, viewy, line) != 0)
continue;
P_ClosestPointOnLine(viewx, viewy, line->linedef, &v);