summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/coord-circle.h
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2010-03-28 22:29:40 +0200
committerRobert Vollmert <rvollmert@gmx.net>2010-03-28 22:33:16 +0200
commit2c5067f17ae98f947c2cba73f3f9402d17c84561 (patch)
tree69a4605aa1ab1c018cb443774610de1a18df5614 /crawl-ref/source/coord-circle.h
parent3e03aaea90a4e5b38385de29cb473898146e9add (diff)
downloadcrawl-ref-2c5067f17ae98f947c2cba73f3f9402d17c84561.tar.gz
crawl-ref-2c5067f17ae98f947c2cba73f3f9402d17c84561.zip
Fix horrible coord-circle origin hack.
It's now tracking whether to check map_bounds explicitly; this is enabled or not depending on the used constructor. Fixes issue #1191 (crash on Shoals 5 when drawing water tiles near (0,0), where (0,0) had been magically detected. I'm not confident this doesn't cause other issues, however, since it seems too easy.
Diffstat (limited to 'crawl-ref/source/coord-circle.h')
-rw-r--r--crawl-ref/source/coord-circle.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/crawl-ref/source/coord-circle.h b/crawl-ref/source/coord-circle.h
index 7c46926b9b..ee76c507cf 100644
--- a/crawl-ref/source/coord-circle.h
+++ b/crawl-ref/source/coord-circle.h
@@ -41,11 +41,7 @@ class circle_iterator;
/*
* Circles of different shapes; see circle_type for these.
*
- * Warnings: 1. Distinguishes between circles within map bounds
- * depending on whether origin is set:
- * origin == (0,0): map_bounds not checked
- * origin != (0,0): map_bounds checked
- * 2. radius/radius_sq don't have meaning when los_radius is set.
+ * radius/radius_sq don't have meaning when los_radius is set.
*/
class circle_def
{
@@ -55,16 +51,22 @@ class circle_def
shape_type shape;
coord_def origin;
+
+ // Check against map bounds for containment?
+ bool check_bounds;
+
int radius;
int radius_sq;
rect_def bbox;
public:
// Circle around (0,0) with radius that tracks global LOS radius.
+ // No bounds checking.
circle_def();
// Circle around origin with shape of given circle.
circle_def(const coord_def &origin_, const circle_def &bds);
// Circle around (0,0) of specified shape and size.
+ // No bounds checking.
explicit circle_def(int param, circle_type ctype = C_SQUARE);
// Circle around given origin of specified shape and size.
circle_def(const coord_def &origin_, int param, circle_type ctype = C_SQUARE);