diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-12-04 18:06:10 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-12-04 18:06:10 +0100 |
commit | ff921f5e14ace24dfff646f0cffcebc0d9ac9762 (patch) | |
tree | e74b2aef7351e74e97b0698aff86b81abede86cd /crawl-ref/source/view.cc | |
parent | 9bf71eb23e7e7650f060883d53da92dd05b7b22d (diff) | |
download | crawl-ref-ff921f5e14ace24dfff646f0cffcebc0d9ac9762.tar.gz crawl-ref-ff921f5e14ace24dfff646f0cffcebc0d9ac9762.zip |
Drop map_shadow, use a bitmap and update it incrementally.
Copying the whole map_knowledge every turn was really costly. We don't care
about any fields of the map other than the "seen" flag, too. Thus, we can
move it into a bitmap and update only changes rather than everything.
This means we need to update the entire bitmap once exploration starts, but
that's a small fraction of the cost:
qw profiles:
before:
9.55% check_for_interesting_features()
0.18% start_explore(bool)
after:
0.29% start_explore(bool)
0.10% check_for_interesting_features()
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r-- | crawl-ref/source/view.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 751c4df3f1..bb5fb3997d 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -452,7 +452,10 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, } if (env.map_knowledge(*ri).changed()) + { env.map_knowledge(*ri).clear(); + env.map_seen.set(*ri, false); + } if (!wizard_map && (env.map_knowledge(*ri).seen() || env.map_knowledge(*ri).mapped())) continue; |