summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/coordit.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-11-03 21:59:02 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-11-05 05:14:15 +0100
commitd339b15e38cbd685024deb0e420d3ab4c74661a0 (patch)
tree929665a53d0ff0be737c4cff9b8172d7eb08e8c7 /crawl-ref/source/coordit.h
parente9ffe704a2bdd1ef3475b72759a7715bc0319f25 (diff)
downloadcrawl-ref-d339b15e38cbd685024deb0e420d3ab4c74661a0.tar.gz
crawl-ref-d339b15e38cbd685024deb0e420d3ab4c74661a0.zip
Implement a prototype for a new version of radius_iterator.
During conversion, use the old code. My target will have only two types of functionality: * iterating over a circle of a given radius * as above, with a LOS check towards the center The current radius_iterator/circle_def/los_base tangle either takes a majority of CPU time or at least a sizeable chunk in profile runs, due to a bad case of OOP abuse in tight loops. This badly needs a rewrite. The ability to pass it a square or someone else's los can be done using a different iterator or checking los manually later, respectively.
Diffstat (limited to 'crawl-ref/source/coordit.h')
-rw-r--r--crawl-ref/source/coordit.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/coordit.h b/crawl-ref/source/coordit.h
index 9c9695882a..966f6e0779 100644
--- a/crawl-ref/source/coordit.h
+++ b/crawl-ref/source/coordit.h
@@ -88,6 +88,11 @@ public:
radius_iterator(const los_base* los,
bool exclude_center = false);
+ radius_iterator(const coord_def center, int param, circle_type ctype,
+ los_type los, bool exclude_center = false);
+ radius_iterator(const coord_def center, los_type los,
+ bool exclude_center = false);
+
operator bool() const PURE;
coord_def operator *() const PURE;
const coord_def *operator->() const PURE;
@@ -103,6 +108,7 @@ private:
circle_iterator iter;
bool exclude_center;
const los_base* los; // restrict to the los if not NULL
+ unique_ptr<los_base> used_los;
coord_def current; // storage for operator->
};