diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-15 01:43:08 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-15 01:46:46 -0800 |
commit | 370dc08f2832bbbdae426ea35a0de6b2bd31a804 (patch) | |
tree | 8d1e363744f35e49e92e00d9cfa75cbbc40c60b6 /crawl-ref/source/travel.h | |
parent | e4ea11efbb6154a89dfd13c8d58167de28e83ea9 (diff) | |
download | crawl-ref-370dc08f2832bbbdae426ea35a0de6b2bd31a804.tar.gz crawl-ref-370dc08f2832bbbdae426ea35a0de6b2bd31a804.zip |
Travel exclude speedup
Speed up is_excluded() by making the class exclude_set, which caches the
set of excluded points, calculating the set only when exclusions are
added or removed (or when an old level is loaded).
NOTE: This recomputes the set of excluded points once upon entering
level-map mode and once upon exiting it. If this takes to long on slow
machines, this can be improved.
Diffstat (limited to 'crawl-ref/source/travel.h')
-rw-r--r-- | crawl-ref/source/travel.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h index 739d4a5fac..87216aa6e1 100644 --- a/crawl-ref/source/travel.h +++ b/crawl-ref/source/travel.h @@ -375,7 +375,7 @@ struct LevelInfo void clear_distances(); void set_level_excludes(); - const std::vector<travel_exclude> &get_excludes() const + const exclude_set &get_excludes() const { return excludes; } @@ -413,7 +413,7 @@ private: std::vector<stair_info> stairs; // Squares that are not safe to travel to. - std::vector<travel_exclude> excludes; + exclude_set excludes; std::vector<short> stair_distances; // Dist between stairs level_id id; |