diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-16 23:48:56 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-16 23:49:51 +0200 |
commit | f6e6b6b7151af9290c0597acb1995ed157378529 (patch) | |
tree | c984c3816cc6a66118b8fc47b6e6984f1b1eba4d /crawl-ref/source/losparam.h | |
parent | 756894ef3f3dd9c70af6115be117bb09e4374342 (diff) | |
download | crawl-ref-f6e6b6b7151af9290c0597acb1995ed157378529.tar.gz crawl-ref-f6e6b6b7151af9290c0597acb1995ed157378529.zip |
Rewrite cell_see_cell using exists_ray.
For this, add new opacity_func that disregards half-opaque things.
Diffstat (limited to 'crawl-ref/source/losparam.h')
-rw-r--r-- | crawl-ref/source/losparam.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/crawl-ref/source/losparam.h b/crawl-ref/source/losparam.h index 505d0989ff..4d5bc141e1 100644 --- a/crawl-ref/source/losparam.h +++ b/crawl-ref/source/losparam.h @@ -34,7 +34,15 @@ struct opacity_default : opacity_func { opacity_type operator()(const coord_def& p) const; }; -static opacity_default opc_default = opacity_default(); +static opacity_default opc_default; + +// Default LOS rules, but only consider fully opaque features blocking. +// In particular, clouds don't affect the result. +struct opacity_fullyopaque : opacity_func +{ + opacity_type operator()(const coord_def& p) const; +}; +static opacity_fullyopaque opc_fullyopaque; // Make anything solid block in addition to normal LOS. // XXX: Are trees, bushes solid? @@ -42,7 +50,7 @@ struct opacity_solid : opacity_func { opacity_type operator()(const coord_def& p) const; }; -static opacity_solid opc_solid = opacity_solid(); +static opacity_solid opc_solid; // LOS bounded by fixed presquared radius. struct bounds_radius_sq : bounds_func @@ -58,7 +66,7 @@ struct bounds_los_radius : bounds_func { bool operator()(const coord_def& p) const; }; -static bounds_los_radius bds_default = bounds_los_radius(); +static bounds_los_radius bds_default; // Subclasses of this are passed to losight() to modify the // LOS calculation. Implementations will have to translate between |