summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/losparam.h
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-08 22:40:29 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-08 22:45:29 +0200
commitd87a308f449bb959db24495e2a1dc307924bc8ae (patch)
tree0f8a71bea75914d2351e45daa08345aba547121b /crawl-ref/source/losparam.h
parent9cc7466db06f418c165ed79fd6bfdfe334a6a568 (diff)
downloadcrawl-ref-d87a308f449bb959db24495e2a1dc307924bc8ae.tar.gz
crawl-ref-d87a308f449bb959db24495e2a1dc307924bc8ae.zip
Split and correct grid_see_grid.
There's now cell_see_cell which tests for visibility correctly, albeit slowly. That's only used for placing features in the abyss currently, but needs to be improved if it gets used more. The second function used in monster movement was left as is, but renamed to can_go_straight. This remains unreliable but probably serves its purpose. The grid_see_grid test is adapted to cell_see_cell; the grid_see_grid lua binding is now actually useful. Also reduce the number of tests in los_csc and los_symm.
Diffstat (limited to 'crawl-ref/source/losparam.h')
-rw-r--r--crawl-ref/source/losparam.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/crawl-ref/source/losparam.h b/crawl-ref/source/losparam.h
index fba1506b42..1d6b579565 100644
--- a/crawl-ref/source/losparam.h
+++ b/crawl-ref/source/losparam.h
@@ -54,14 +54,21 @@ struct los_param_permissive : los_param_trans
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
+// Standard visibility disregarding clouds.
+struct los_param_nocloud : los_param_trans
{
- los_param_base(const coord_def& c);
+ los_param_nocloud(const coord_def& c);
dungeon_feature_type feature(const coord_def& p) const;
unsigned appearance(const coord_def& p) const;
+ opacity_type opacity(const coord_def& p) const;
+};
+
+// Standard visibility.
+struct los_param_base : los_param_nocloud
+{
+ los_param_base(const coord_def& c);
+
unsigned short cloud_idx(const coord_def& p) const;
opacity_type opacity(const coord_def& p) const;
};