From b151b68bd42450a4c6fccf4fbb295bd6e504f968 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Sat, 17 Oct 2009 17:20:30 +0200 Subject: Replace monster_los by calls to losight. los_param got a new opacity_monmove to help. The change compiles and the game runs, but I'm unsure how to test monster pathfinding. Please tell me if anything went wrong! Removes mon-los.{cc,h}, so I'm afraid I may have broken the non-Unix builds again. --- crawl-ref/source/losparam.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/losparam.h') diff --git a/crawl-ref/source/losparam.h b/crawl-ref/source/losparam.h index 8818f3a7d8..7a152a0225 100644 --- a/crawl-ref/source/losparam.h +++ b/crawl-ref/source/losparam.h @@ -52,6 +52,19 @@ struct opacity_solid : opacity_func }; static opacity_solid opc_solid; +// Opacity for monster movement, based on the late monster_los. +struct opacity_monmove : opacity_func +{ + const monsters& mon; + + opacity_monmove(const monsters& m) + : mon(m) + { + } + + opacity_type operator()(const coord_def& p) const; +}; + // LOS bounded by fixed presquared radius. struct bounds_radius_sq : bounds_func { @@ -60,8 +73,18 @@ struct bounds_radius_sq : bounds_func : radius_sq(r_sq) {} bool operator()(const coord_def& p) const; }; -static bounds_radius_sq bds_deflos = bounds_radius_sq(LOS_RADIUS_SQ); -static bounds_radius_sq bds_maxlos = bounds_radius_sq(LOS_MAX_RADIUS_SQ); + +// LOS bounded by fixed radius. +struct bounds_radius : bounds_radius_sq +{ + bounds_radius(int r) + : bounds_radius_sq(r * r + 1) + { + } +}; + +static bounds_radius bds_deflos = bounds_radius(LOS_RADIUS); +static bounds_radius bds_maxlos = bounds_radius(LOS_MAX_RADIUS); // LOS bounded by current global LOS radius. struct bounds_cur_los_radius : bounds_func -- cgit v1.2.3-54-g00ecf