Commit 0a5b0cf1 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: shitcan nexttowardf use in polymost

This never did what I was trying to do and it wasn't really clear until recently how much of a perf hit it could be. Byeeeeee.
parent ccf3f5fd
......@@ -6515,22 +6515,22 @@ static int32_t polymost_bunchfront(const int32_t b1, const int32_t b2)
const float x2b2 = dxb2[bunchlast[b2]];
const float x1b1 = dxb1[b1f];
if (nexttowardf(x1b1, x2b2) >= x2b2)
if (x1b1 >= x2b2)
return -1;
int b2f = bunchfirst[b2];
const float x1b2 = dxb1[b2f];
if (nexttowardf(x1b2, dxb2[bunchlast[b1]]) >= dxb2[bunchlast[b1]])
if (x1b2 >= dxb2[bunchlast[b1]])
return -1;
if (nexttowardf(x1b1, x1b2) > x1b2)
if (x1b1 > x1b2)
{
while (nexttowardf(dxb2[b2f], x1b1) <= x1b1) b2f=bunchp2[b2f];
while (dxb2[b2f] <= x1b1) b2f=bunchp2[b2f];
return wallfront(b1f, b2f);
}
while (nexttowardf(dxb2[b1f], x1b2) <= x1b2) b1f=bunchp2[b1f];
while (dxb2[b1f] <= x1b2) b1f=bunchp2[b1f];
return wallfront(b1f, b2f);
}
......@@ -6635,7 +6635,7 @@ void polymost_scansector(int32_t sectnum)
}
//if wall is facing you...
if ((p1.y >= SCISDIST || p2.y >= SCISDIST) && (nexttoward(p1.x*p2.y, p2.x*p1.y) < p2.x*p1.y))
if ((p1.y >= SCISDIST || p2.y >= SCISDIST) && (p1.x*p2.y < p2.x*p1.y))
{
dxb1[numscans] = (p1.y >= SCISDIST) ? float(p1.x*ghalfx/p1.y + ghalfx) : -1e32f;
dxb2[numscans] = (p2.y >= SCISDIST) ? float(p2.x*ghalfx/p2.y + ghalfx) : 1e32f;
......@@ -6649,7 +6649,7 @@ void polymost_scansector(int32_t sectnum)
else if (dxb2[numscans] > xbr)
dxb2[numscans] = xbr;
if (nexttowardf(dxb1[numscans], dxb2[numscans]) < dxb2[numscans])
if (dxb1[numscans] < dxb2[numscans])
{
thesector[numscans] = sectnum;
thewall[numscans] = z;
......@@ -6667,7 +6667,7 @@ void polymost_scansector(int32_t sectnum)
for (bssize_t z=onumscans; z<numscans; z++)
{
if ((wall[thewall[z]].point2 != thewall[bunchp2[z]]) || (dxb2[z] > nexttowardf(dxb1[bunchp2[z]], dxb2[z])))
if ((wall[thewall[z]].point2 != thewall[bunchp2[z]]) || (dxb2[z] > dxb1[bunchp2[z]]))
{
bunchfirst[numbunches++] = bunchp2[z];
bunchp2[z] = -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment