diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-09-05 13:39:13 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-09-05 13:53:07 +0200 |
commit | ac3794658015080437b42042a57a635531be578f (patch) | |
tree | 0a0b3281ecff9972187e01e7cc492a1a4418252e /crawl-ref/source/coord.cc | |
parent | 476362cd7ce3225a80da69f66d2b07983b9cb2c8 (diff) | |
download | crawl-ref-ac3794658015080437b42042a57a635531be578f.tar.gz crawl-ref-ac3794658015080437b42042a57a635531be578f.zip |
Inline in_bounds().
It's a tiny function called from many tight loops. Inlining it gives ~1%
speedup in non-flto builds.
Diffstat (limited to 'crawl-ref/source/coord.cc')
-rw-r--r-- | crawl-ref/source/coord.cc | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/crawl-ref/source/coord.cc b/crawl-ref/source/coord.cc index f9537a6213..203fdc09b5 100644 --- a/crawl-ref/source/coord.cc +++ b/crawl-ref/source/coord.cc @@ -28,30 +28,6 @@ bool adjacent(const coord_def& p1, const coord_def& p2) return grid_distance(p1, p2) <= 1; } -bool in_bounds_x(int x) -{ - return (x > X_BOUND_1 && x < X_BOUND_2); -} - -bool in_bounds_y(int y) -{ - return (y > Y_BOUND_1 && y < Y_BOUND_2); -} - -// Returns true if inside the area the player can move and dig (ie exclusive). -bool in_bounds(int x, int y) -{ - return (x > X_BOUND_1 && x < X_BOUND_2 && y > Y_BOUND_1 && y < Y_BOUND_2); -} - -// Returns true if inside the area the player can map (ie inclusive). -// Note that terrain features should be in_bounds() leaving an outer -// ring of rock to frame the level. -bool map_bounds(int x, int y) -{ - return (x >= X_BOUND_1 && x <= X_BOUND_2 && y >= Y_BOUND_1 && y <= Y_BOUND_2); -} - bool map_bounds_with_margin(coord_def p, int margin) { return (p.x >= X_BOUND_1 + margin && p.x <= X_BOUND_2 - margin |