summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/los.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-16 18:33:24 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-16 20:17:48 +0200
commitaf4b5015512fab9e409dc8ec4128c6f63ab967c9 (patch)
treefa6f259420e92fcef3f3d0466dfb22ced9c0e0f2 /crawl-ref/source/los.cc
parent564dac43f50543729d004dc1dfe905e81321837d (diff)
downloadcrawl-ref-af4b5015512fab9e409dc8ec4128c6f63ab967c9.tar.gz
crawl-ref-af4b5015512fab9e409dc8ec4128c6f63ab967c9.zip
Get rid of los_param outside of los.cc/losparam.cc.
The nicer interface to losight is now void losight(env_show_grid& sh, const coord_def& center, const opacity_func &opc = opc_default, const bounds_func &bds = bds_default); bounds_func provides the LOS boundary (usually just a circle with radius the current LOS radius). opacity_func is a mapping of grid coordinates to opacity values.
Diffstat (limited to 'crawl-ref/source/los.cc')
-rw-r--r--crawl-ref/source/los.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc
index 896ad452c9..08c3fe2d32 100644
--- a/crawl-ref/source/los.cc
+++ b/crawl-ref/source/los.cc
@@ -759,7 +759,7 @@ int num_feats_between(const coord_def& source, const coord_def& target,
bool cell_see_cell(const coord_def& p1, const coord_def& p2)
{
env_show_grid show;
- losight(show, los_param_nocloud(p1));
+ losight(show, p1);
return see_grid(show, p1, p2);
}
@@ -862,11 +862,11 @@ void losight(env_show_grid& sh, const los_param& dat)
struct los_param_funcs : public los_param
{
coord_def center;
- opacity_func opc;
- bounds_func bounds;
+ const opacity_func& opc;
+ const bounds_func& bounds;
los_param_funcs(const coord_def& c,
- opacity_func o, bounds_func b)
+ const opacity_func& o, const bounds_func& b)
: center(c), opc(o), bounds(b)
{
}
@@ -888,7 +888,7 @@ struct los_param_funcs : public los_param
};
void losight(env_show_grid& sh, const coord_def& center,
- opacity_func opc, bounds_func bounds)
+ const opacity_func& opc, const bounds_func& bounds)
{
losight(sh, los_param_funcs(center, opc, bounds));
}
@@ -908,12 +908,12 @@ void calc_show_los()
{
if (!crawl_state.arena && !crawl_state.arena_suspended)
{
- // Must be done first.
losight(env.show, you.pos());
// What would be visible, if all of the translucent walls were
// made opaque.
- losight(env.no_trans_show, los_param_solid(you.pos()));
+ // XXX: figure out what this should really do.
+ losight(env.no_trans_show, you.pos(), opc_solid);
}
else
{