Refactor CCullZone::CalcDistToCullZoneSquared

This commit is contained in:
Sergeanur 2020-01-20 23:27:07 +02:00
parent 7857590990
commit 06904755d9

View File

@ -507,27 +507,14 @@ float
CCullZone::CalcDistToCullZoneSquared(float x, float y) CCullZone::CalcDistToCullZoneSquared(float x, float y)
{ {
float rx, ry; float rx, ry;
float temp;
temp = minx; if (x < minx) rx = sq(x - minx);
if (temp <= x) { else if (x > maxx) rx = sq(x - maxx);
temp = maxx; else rx = 0.0f;
if (x <= temp)
rx = 0.0f;
else
rx = sq(x - temp);
} else
rx = sq(x - temp);
temp = miny; if (y < miny) ry = sq(y - miny);
if (temp <= y) { else if (y > maxy) ry = sq(y - maxy);
temp = maxy; else ry = 0.0f;
if (y <= temp)
ry = 0.0f;
else
ry = sq(y - temp);
} else
ry = sq(y - temp);
return rx + ry; return rx + ry;
} }