diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-25 16:33:16 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-25 16:33:41 +0100 |
commit | 5e1b1aeec721082e65edba8538c7293f922fa030 (patch) | |
tree | 0808140f27a1417a51a16a493f352bb863cd1ad2 /crawl-ref | |
parent | 21060a38ec5f533d3cfc5614418c7ff8fecfabb1 (diff) | |
download | crawl-ref-5e1b1aeec721082e65edba8538c7293f922fa030.tar.gz crawl-ref-5e1b1aeec721082e65edba8538c7293f922fa030.zip |
Revert "Convert exclusions to los_def."
This reverts commit 7afa089db8b01b1810c5903309f7302545638550.
los_def is currently buggy, leading to weird behaviour when
deleting exclusions.
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/travel.cc | 12 | ||||
-rw-r--r-- | crawl-ref/source/travel.h | 19 |
2 files changed, 14 insertions, 17 deletions
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 83ac8e9363..c42131916b 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -301,11 +301,11 @@ int travel_exclude::radius_sq() const return (radius > 0 ? radius*radius + 1 : 0); } -void travel_exclude::set_los() +void travel_exclude::set_exclude_show() { uptodate = true; if (radius > 0) - los.init(pos, opc_excl, bounds_radius_sq(radius_sq())); + losight(show, pos, opc_excl, bounds_radius_sq(radius_sq())); } bool travel_exclude::affects(const coord_def& p) const @@ -315,13 +315,13 @@ bool travel_exclude::affects(const coord_def& p) const pos.x, pos.y, p.x, p.y); if (radius == 0) return (p == pos); - return (los.see_cell(p)); + return (see_cell(show, pos, p)); } void init_exclusion_los() { for (unsigned int i = 0; i < curr_excludes.size(); i++) - curr_excludes[i].set_los(); + curr_excludes[i].set_exclude_show(); } void _mark_excludes_non_updated(const coord_def &p) @@ -335,7 +335,7 @@ void _update_exclusion_los(bool all=false) { for (unsigned int i = 0; i < curr_excludes.size(); i++) if (all || !curr_excludes[i].uptodate) - curr_excludes[i].set_los(); + curr_excludes[i].set_exclude_show(); } /* @@ -502,7 +502,7 @@ void set_exclude(const coord_def &p, int radius, bool autoexcl, bool vaultexcl) if (travel_exclude *exc = _find_exclude_root(p)) { exc->radius = radius; - exc->set_los(); + exc->set_exclude_show(); } else { diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h index e23c5a3c05..78b21b23b6 100644 --- a/crawl-ref/source/travel.h +++ b/crawl-ref/source/travel.h @@ -7,9 +7,6 @@ #define TRAVEL_H #include "externs.h" - -#include "los.h" - #include <stdio.h> #include <string> #include <vector> @@ -355,16 +352,16 @@ void update_exclusion_los(std::vector<coord_def> changed); struct travel_exclude { - coord_def pos; // exclusion centre - int radius; // exclusion radius - bool autoexclude; // Was set automatically. - int mon; // Monster around which exclusion is centered. - los_def los; // los from exclusion centre - bool uptodate; // Is los up to date? + coord_def pos; // exclusion centre + int radius; // exclusion radius + bool autoexclude; // Was set automatically. + int mon; // Monster around which exclusion is centered. + env_show_grid show; // los from exclusion centre + bool uptodate; // Is show up to date? bool vaultexclude; // Is this exclusion set by a vault? int radius_sq() const; - void set_los(); + void set_exclude_show(); bool affects(const coord_def& p) const; travel_exclude(const coord_def &p, int r = LOS_RADIUS, @@ -372,7 +369,7 @@ struct travel_exclude bool vaultexcl = false) : pos(p), radius(r), autoexclude(autoexcl), mon(mons), vaultexclude(vaultexcl) { - set_los(); + set_exclude_show(); } }; |