summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/travel.h
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-15 18:00:27 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-15 18:06:07 +0200
commit85cb24e611061807818fbb6be250f9f770d3433b (patch)
tree03cd65e7b2441aea77ba49ac70108fcd7c9a13de /crawl-ref/source/travel.h
parent42edbf7d41749125122c9b2cfe8d7bcd0357641f (diff)
downloadcrawl-ref-85cb24e611061807818fbb6be250f9f770d3433b.tar.gz
crawl-ref-85cb24e611061807818fbb6be250f9f770d3433b.zip
Rewrite part of the exclusion code.
* Exclusion radius 0 no longer encodes "no exclusion". * toggle_exclusion split into set_exclusion and del_exclusion: It was never used as a toggle. * Exclusion updates for changed cells unified in void update_exclusion_los(std::vector coord_def changed). Now doesn't leave invalidly non-uptodate exclusions laying around. Still need to find out why off-level exclusions aren't updated after restore.
Diffstat (limited to 'crawl-ref/source/travel.h')
-rw-r--r--crawl-ref/source/travel.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h
index a035b29f74..7370d49d44 100644
--- a/crawl-ref/source/travel.h
+++ b/crawl-ref/source/travel.h
@@ -58,8 +58,8 @@ void init_travel_terrain_check(bool check_race_equip = true);
void stop_running(void);
void travel_init_new_level();
void cycle_exclude_radius(const coord_def &p);
-void toggle_exclude(const coord_def &p, bool autoexcl = false);
-void set_exclude(const coord_def &p, int radius2, bool autoexcl = false);
+void del_exclude(const coord_def &p);
+void set_exclude(const coord_def &p, int radius = LOS_RADIUS, bool autoexcl = false);
void maybe_remove_autoexclusion(const coord_def &p);
std::string get_exclusion_desc();
void clear_excludes();
@@ -347,8 +347,7 @@ public:
};
void init_exclusion_los();
-void update_exclusion_los(const coord_def &p);
-void mark_all_excludes_non_updated();
+void update_exclusion_los(std::vector<coord_def> changed);
struct travel_exclude
{
@@ -359,7 +358,9 @@ struct travel_exclude
env_show_grid show; // los from exclusion centre
bool uptodate; // Is show up to date?
+ int radius_sq() const;
void set_exclude_show();
+ bool affects(const coord_def& p) const;
travel_exclude(const coord_def &p, int r = LOS_RADIUS,
bool autoexcl = false, int mons = NON_MONSTER)
@@ -367,11 +368,6 @@ struct travel_exclude
{
set_exclude_show();
}
-
- int radius_sq() const
- {
- return (radius * radius + 1);
- }
};
// Information on a level that interlevel travel needs.