diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-11-08 01:25:43 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-11-08 01:41:41 +0100 |
commit | b33014e5510ddaf3a5088c934bbb53aa406b451c (patch) | |
tree | dde4379a3ad2a0b8eb10179029d4acac6aa88a76 /crawl-ref/source/losparam.h | |
parent | dbb39bdfc8ddc1c4b06b07f09d626791e46ed4bb (diff) | |
download | crawl-ref-b33014e5510ddaf3a5088c934bbb53aa406b451c.tar.gz crawl-ref-b33014e5510ddaf3a5088c934bbb53aa406b451c.zip |
Replace bounds_func with circle_def.
The various LOS objects and functions now accept a circle_def
instead of a bounds_func. This is a little less generic, but
should eventually help with iterating over coordinates in
any los_def.
Diffstat (limited to 'crawl-ref/source/losparam.h')
-rw-r--r-- | crawl-ref/source/losparam.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/crawl-ref/source/losparam.h b/crawl-ref/source/losparam.h index 1986e460a5..31a7f4bc1a 100644 --- a/crawl-ref/source/losparam.h +++ b/crawl-ref/source/losparam.h @@ -24,20 +24,12 @@ struct opacity_func virtual opacity_func* clone() const = 0; }; -struct bounds_func -{ - virtual ~bounds_func() {} - virtual bool operator()(const coord_def& p) const = 0; - virtual bounds_func* clone() const = 0; -}; - #define CLONE(typename) \ typename* clone() const \ { \ return (new typename(*this)); \ } - // Default LOS rules. struct opacity_default : opacity_func { @@ -82,41 +74,6 @@ struct opacity_monmove : opacity_func opacity_type operator()(const coord_def& p) const; }; -// LOS bounded by fixed presquared radius. -struct bounds_radius_sq : bounds_func -{ - int radius_sq; - bounds_radius_sq(int r_sq) - : radius_sq(r_sq) {} - - CLONE(bounds_radius_sq) - - bool operator()(const coord_def& p) const; -}; - -// LOS bounded by fixed radius. -struct bounds_radius : bounds_radius_sq -{ - bounds_radius(int r) - : bounds_radius_sq(r * r + 1) - { - } - - CLONE(bounds_radius) -}; - -static bounds_radius bds_deflos = bounds_radius(LOS_RADIUS); -static bounds_radius bds_maxlos = bounds_radius(LOS_MAX_RADIUS); - -// LOS bounded by current global LOS radius. -struct bounds_cur_los_radius : bounds_func -{ - CLONE(bounds_cur_los_radius) - - bool operator()(const coord_def& p) const; -}; -static bounds_cur_los_radius bds_default; - // Subclasses of this are passed to losight() to modify the // LOS calculation. Implementations will have to translate between // relative coordinates (-8,-8)..(8,8) and real coordinates, |