summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-08 18:25:19 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-08 18:31:55 +0200
commitc7a9fecd4bc075e9b7b05f132a32aeaed7ff7c1e (patch)
treef0f8b48bd0691ca02bc173e621679f052704c810
parente7fe416eb697676ab40f279b8e5d1364d9614d81 (diff)
downloadcrawl-ref-c7a9fecd4bc075e9b7b05f132a32aeaed7ff7c1e.tar.gz
crawl-ref-c7a9fecd4bc075e9b7b05f132a32aeaed7ff7c1e.zip
Add los_param_permissive.
This was intended for the arena; keeping as example or test case.
-rw-r--r--crawl-ref/source/losparam.cc27
-rw-r--r--crawl-ref/source/losparam.h9
2 files changed, 36 insertions, 0 deletions
diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc
index dc22990ee0..cb4171c622 100644
--- a/crawl-ref/source/losparam.cc
+++ b/crawl-ref/source/losparam.cc
@@ -13,6 +13,9 @@ REVISION("$Rev$");
#include "stuff.h"
#include "terrain.h"
+
+/* los_param_trans */
+
los_param_trans::los_param_trans(const coord_def& c)
: center(c)
{
@@ -28,6 +31,27 @@ bool los_param_trans::map_bounds(const coord_def& p) const
return ::map_bounds(trans(p));
}
+
+/* los_param_permissive */
+
+los_param_permissive::los_param_permissive(const coord_def& c)
+ : los_param_trans(c)
+{
+}
+
+unsigned los_param_permissive::appearance(const coord_def& p) const
+{
+ return env.grid(trans(p));
+}
+
+opacity_type los_param_permissive::opacity(const coord_def& p) const
+{
+ return OPC_CLEAR;
+}
+
+
+/* los_param_base */
+
los_param_base::los_param_base(const coord_def& c)
: los_param_trans(c)
{
@@ -59,6 +83,9 @@ opacity_type los_param_base::opacity(const coord_def& p) const
return OPC_CLEAR;
}
+
+/* los_param_compat */
+
los_param_compat::los_param_compat(const feature_grid& gr, const coord_def& c,
bool sb, bool ic)
: los_param_base(c), grid(gr), solid_blocks(sb), ignore_clouds(ic)
diff --git a/crawl-ref/source/losparam.h b/crawl-ref/source/losparam.h
index a31fbb46f5..15f1cc860a 100644
--- a/crawl-ref/source/losparam.h
+++ b/crawl-ref/source/losparam.h
@@ -45,6 +45,15 @@ struct los_param_trans : los_param
bool map_bounds(const coord_def& p) const;
};
+// Everything is visible.
+struct los_param_permissive : los_param_trans
+{
+ los_param_permissive(const coord_def& c);
+
+ unsigned appearance(const coord_def& p) const;
+ opacity_type opacity(const coord_def& p) const;
+};
+
// A complete base implementation that does standard visibility
// based on env.grid.
struct los_param_base : los_param_trans