diff options
author | Luca Barbieri <luca@luca-barbieri.com> | 2010-06-07 02:52:28 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2010-07-29 00:43:58 +0200 |
commit | 7184b88d886d74490447b01699bd2f95dc9cc804 (patch) | |
tree | 45a5acc8744c2dfd96aff8ecd0e764f0c4cb2964 /crawl-ref/source/exclude.cc | |
parent | 698259e9db09aea1c2bf60375daed4200dd25987 (diff) | |
download | crawl-ref-7184b88d886d74490447b01699bd2f95dc9cc804.tar.gz crawl-ref-7184b88d886d74490447b01699bd2f95dc9cc804.zip |
Remove env.show in favor of using env.map_knowledge
Currently env.show stores information about the LOS rectangle, while
env.map_knowledge stores the rest of the map.
This unnecessarily complicates the code, makes serialization harder,
and makes it hard to change the LOS model.
This code uses map_knowledge for both kinds of data.
Regressions are quite possible.
Signed-off-by: Robert Vollmert <rvollmert@gmx.net>
Diffstat (limited to 'crawl-ref/source/exclude.cc')
-rw-r--r-- | crawl-ref/source/exclude.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/exclude.cc b/crawl-ref/source/exclude.cc index 2cf04ae7a5..255d28c006 100644 --- a/crawl-ref/source/exclude.cc +++ b/crawl-ref/source/exclude.cc @@ -112,9 +112,9 @@ public: opacity_type operator()(const coord_def& p) const { - if (!is_terrain_seen(p)) + if (!env.map_knowledge(p).seen()) return OPC_CLEAR; - else if (!is_terrain_changed(p)) + else if (!env.map_knowledge(p).changed()) return _feat_opacity(env.grid(p)); else if (env.map_knowledge(p).object.cls == SH_FEATURE) return _feat_opacity(env.map_knowledge(p).object.feat); @@ -481,11 +481,11 @@ void set_exclude(const coord_def &p, int radius, bool autoexcl, bool vaultexcl, { // Don't list a monster in the exclusion annotation if the // exclusion was triggered by e.g. the flamethrowers' lua check. - const show_type& obj = get_map_knowledge_obj(p); + const show_type& obj = env.map_knowledge(p).object; if (obj.cls == SH_MONSTER) { desc = mons_type_name(obj.mons, DESC_PLAIN); - if (is_map_knowledge_detected_mons(p)) + if (env.map_knowledge(p).detected_monster()) desc += " (detected)"; } else |