From 5026a1be87655357367b9ae66db018c08899e572 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Sat, 7 Nov 2009 09:14:53 +0100 Subject: Split los_def implementation out into los_def.cc. --- crawl-ref/source/los.cc | 76 ------------------------------------------------- 1 file changed, 76 deletions(-) (limited to 'crawl-ref/source/los.cc') diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc index 7d692ca6be..98b9169d36 100644 --- a/crawl-ref/source/los.cc +++ b/crawl-ref/source/los.cc @@ -915,82 +915,6 @@ void losight(env_show_grid& sh, const coord_def& center, } -// class los_def - -los_def::los_def() - : show(0), opc(opc_default.clone()), bds(bds_default.clone()) -{ -} - -los_def::los_def(const coord_def& c, const opacity_func &o, - const bounds_func &b) - : show(0), center(c), opc(o.clone()), bds(b.clone()) -{ -} - -los_def::los_def(const los_def& los) - : show(los.show), center(los.center), - opc(los.opc->clone()), bds(los.bds->clone()) -{ -} - -los_def& los_def::operator=(const los_def& los) -{ - init(los.center, *los.opc, *los.bds); - show = los.show; - return (*this); -} - -void los_def::init(const coord_def &c, const opacity_func &o, - const bounds_func &b) -{ - show.init(0); - set_center(c); - set_opacity(o); - set_bounds(b); -} - -los_def::~los_def() -{ - delete opc; - delete bds; -} - -void los_def::update() -{ - losight(show, center, *opc, *bds); -} - -void los_def::set_center(const coord_def& c) -{ - center = c; -} - -void los_def::set_opacity(const opacity_func &o) -{ - delete opc; - opc = o.clone(); -} - -void los_def::set_bounds(const bounds_func &b) -{ - delete bds; - bds = b.clone(); -} - -bool los_def::in_bounds(const coord_def& p) const -{ - return ((*bds)(p)); -} - -bool los_def::see_cell(const coord_def& p) const -{ - return (::see_cell(show, center, p)); -} - -// end los_def - - void losight_permissive(env_show_grid &sh, const coord_def& center) { for (int x = -ENV_SHOW_OFFSET; x <= ENV_SHOW_OFFSET; ++x) -- cgit v1.2.3-54-g00ecf