diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-11-13 05:06:50 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-11-13 13:09:27 +0100 |
commit | d4ec7f300b6086c5a3a6b80eb006e7a11098db53 (patch) | |
tree | 9db1058e7df6dc45986e7f61a2c642d0e0fef260 /crawl-ref/source/coord-circle.cc | |
parent | d3257a5d2d64c1e7316d4c89696c4c3c0679b9bb (diff) | |
download | crawl-ref-d4ec7f300b6086c5a3a6b80eb006e7a11098db53.tar.gz crawl-ref-d4ec7f300b6086c5a3a6b80eb006e7a11098db53.zip |
Replace a bunch of floating-point sqrt()s by integer ones.
Diffstat (limited to 'crawl-ref/source/coord-circle.cc')
-rw-r--r-- | crawl-ref/source/coord-circle.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crawl-ref/source/coord-circle.cc b/crawl-ref/source/coord-circle.cc index 1701a14734..12cd79a14a 100644 --- a/crawl-ref/source/coord-circle.cc +++ b/crawl-ref/source/coord-circle.cc @@ -3,10 +3,9 @@ #include "coord-circle.h" #include "coordit.h" +#include "libutil.h" #include "los.h" -#include <cmath> - bool rect_def::contains(const coord_def& p) const { return (p.x >= min.x && p.x <= max.x && p.y >= min.y && p.y <= max.y); @@ -67,7 +66,7 @@ void circle_def::init(int param, circle_type ctype) case C_CIRCLE: shape = SH_CIRCLE; radius_sq = param; - radius = ceil(sqrt((float)radius_sq)); + radius = isqrt_ceil(radius_sq); break; case C_ROUND: shape = SH_CIRCLE; |