diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-01-20 22:27:07 +0100 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-01-20 22:27:57 +0100 |
commit | 06904755d9b2b1e56f1e53070a66101a12dddff9 (patch) | |
tree | 6a3ecea30757fb5966c1417a89740d568f718683 /src | |
parent | Atan2 and Sqrt (diff) | |
download | re3-06904755d9b2b1e56f1e53070a66101a12dddff9.tar re3-06904755d9b2b1e56f1e53070a66101a12dddff9.tar.gz re3-06904755d9b2b1e56f1e53070a66101a12dddff9.tar.bz2 re3-06904755d9b2b1e56f1e53070a66101a12dddff9.tar.lz re3-06904755d9b2b1e56f1e53070a66101a12dddff9.tar.xz re3-06904755d9b2b1e56f1e53070a66101a12dddff9.tar.zst re3-06904755d9b2b1e56f1e53070a66101a12dddff9.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/ZoneCull.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/src/core/ZoneCull.cpp b/src/core/ZoneCull.cpp index ab7fc9ac..b6929e86 100644 --- a/src/core/ZoneCull.cpp +++ b/src/core/ZoneCull.cpp @@ -507,27 +507,14 @@ float CCullZone::CalcDistToCullZoneSquared(float x, float y) { float rx, ry; - float temp; - - temp = minx; - if (temp <= x) { - temp = maxx; - if (x <= temp) - rx = 0.0f; - else - rx = sq(x - temp); - } else - rx = sq(x - temp); - - temp = miny; - if (temp <= y) { - temp = maxy; - if (y <= temp) - ry = 0.0f; - else - ry = sq(y - temp); - } else - ry = sq(y - temp); + + if (x < minx) rx = sq(x - minx); + else if (x > maxx) rx = sq(x - maxx); + else rx = 0.0f; + + if (y < miny) ry = sq(y - miny); + else if (y > maxy) ry = sq(y - maxy); + else ry = 0.0f; return rx + ry; } |