summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-19 13:06:56 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-22 22:37:06 +0200
commit7afa089db8b01b1810c5903309f7302545638550 (patch)
tree1a917e2668faace0b9f41a930ac3eba7a90941fb /crawl-ref
parent1ad65d74a11df671d45d5dc8aa247e6e439ae1c8 (diff)
downloadcrawl-ref-7afa089db8b01b1810c5903309f7302545638550.tar.gz
crawl-ref-7afa089db8b01b1810c5903309f7302545638550.zip
Convert exclusions to los_def.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/travel.cc12
-rw-r--r--crawl-ref/source/travel.h11
2 files changed, 13 insertions, 10 deletions
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index 20b69c7919..c4dfb69420 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -301,9 +301,9 @@ int travel_exclude::radius_sq() const
return (radius > 0 ? radius*radius + 1 : 0);
}
-void travel_exclude::set_exclude_show()
+void travel_exclude::set_los()
{
- losight(show, pos, opc_excl, bounds_radius_sq(radius_sq()));
+ los.init(pos, opc_excl, bounds_radius_sq(radius_sq()));
uptodate = true;
}
@@ -312,13 +312,13 @@ bool travel_exclude::affects(const coord_def& p) const
if (!uptodate)
mprf(MSGCH_ERROR, "exclusion not up-to-date: e (%d,%d) p (%d,%d)",
pos.x, pos.y, p.x, p.y);
- return (see_cell(show, pos, p));
+ return (los.see_cell(p));
}
void init_exclusion_los()
{
for (unsigned int i = 0; i < curr_excludes.size(); i++)
- curr_excludes[i].set_exclude_show();
+ curr_excludes[i].set_los();
}
void _mark_excludes_non_updated(const coord_def &p)
@@ -332,7 +332,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_exclude_show();
+ curr_excludes[i].set_los();
}
/*
@@ -503,7 +503,7 @@ void set_exclude(const coord_def &p, int radius, bool autoexcl)
if (travel_exclude *exc = _find_exclude_root(p))
{
exc->radius = radius;
- exc->set_exclude_show();
+ exc->set_los();
}
else
{
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h
index a6fb14fc94..42232088f2 100644
--- a/crawl-ref/source/travel.h
+++ b/crawl-ref/source/travel.h
@@ -7,6 +7,9 @@
#define TRAVEL_H
#include "externs.h"
+
+#include "los.h"
+
#include <stdio.h>
#include <string>
#include <vector>
@@ -353,18 +356,18 @@ struct travel_exclude
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?
+ los_def los; // los from exclusion centre
+ bool uptodate; // Is los up to date?
int radius_sq() const;
- void set_exclude_show();
+ void set_los();
bool affects(const coord_def& p) const;
travel_exclude(const coord_def &p, int r = LOS_RADIUS,
bool autoexcl = false, int mons = NON_MONSTER)
: pos(p), radius(r), autoexclude(autoexcl), mon(mons)
{
- set_exclude_show();
+ set_los();
}
};