summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/losparam.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-16 23:48:56 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-16 23:49:51 +0200
commitf6e6b6b7151af9290c0597acb1995ed157378529 (patch)
treec984c3816cc6a66118b8fc47b6e6984f1b1eba4d /crawl-ref/source/losparam.cc
parent756894ef3f3dd9c70af6115be117bb09e4374342 (diff)
downloadcrawl-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.cc')
-rw-r--r--crawl-ref/source/losparam.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc
index f24acf4551..132c2005f2 100644
--- a/crawl-ref/source/losparam.cc
+++ b/crawl-ref/source/losparam.cc
@@ -30,6 +30,14 @@ opacity_type opacity_default::operator()(const coord_def& p) const
return OPC_CLEAR;
}
+opacity_type opacity_fullyopaque::operator()(const coord_def& p) const
+{
+ if (grid_is_opaque(env.grid(p)))
+ return OPC_OPAQUE;
+ else
+ return OPC_CLEAR;
+}
+
// Make anything solid block in addition to normal LOS.
// XXX: Are trees, bushes solid?
opacity_type opacity_solid::operator()(const coord_def& p) const