summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/show.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-12-01 15:23:42 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-12-01 15:26:52 +0100
commite12f92d931dcef88c6890f9aef8629534bf859c8 (patch)
tree7c5e94c192640ddfa5dd4463439f2640c23fb7c0 /crawl-ref/source/show.cc
parent83436251ef251effc98348bcefd6e0590a4fdf04 (diff)
downloadcrawl-ref-e12f92d931dcef88c6890f9aef8629534bf859c8.tar.gz
crawl-ref-e12f92d931dcef88c6890f9aef8629534bf859c8.zip
Unify colour handling in env.show and env.map_knowledge.
Colour is now always precomputed, and only possibly overridden by travel information on display. It's quite unclear that storing the colour in env.show and env.map_knowledge is the right thing to do, but at least it's handled consistently now.
Diffstat (limited to 'crawl-ref/source/show.cc')
-rw-r--r--crawl-ref/source/show.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/crawl-ref/source/show.cc b/crawl-ref/source/show.cc
index 784eac2994..a28a5b5777 100644
--- a/crawl-ref/source/show.cc
+++ b/crawl-ref/source/show.cc
@@ -393,3 +393,19 @@ void show_def::init()
for (radius_iterator ri(&you.get_los()); ri; ++ri)
update_at(*ri, grid2show(*ri));
}
+
+show_type to_knowledge(show_type obj, bool emph)
+{
+ if (Options.item_colour && obj.cls == SH_ITEM)
+ return (obj);
+ if (obj.cls == SH_MONSTER)
+ {
+ obj.colour = DARKGREY;
+ return (obj);
+ }
+ const feature_def& fdef = get_feature_def(obj);
+ obj.colour = fdef.seen_colour;
+ if (emph && fdef.seen_em_colour)
+ obj.colour = fdef.seen_em_colour;
+ return (obj);
+}