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:
1 parent
01bf367ce1
commit
5f2a8acfa2
1 file changed
+4
-1
@@ -734,7 +734,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);
|
||||
|
||||
Reference in new issue
Block a user