diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-16 10:22:11 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-16 10:22:11 +0200 |
commit | e0f64f36d01badee2d42839f467b0cfbc8867da5 (patch) | |
tree | 314442a4c878d9ddd4645713f1ec0c23c82a145a /crawl-ref | |
parent | 70c41610927b7f9adfc3a0fd6c72c7af6756427e (diff) | |
download | crawl-ref-e0f64f36d01badee2d42839f467b0cfbc8867da5.tar.gz crawl-ref-e0f64f36d01badee2d42839f467b0cfbc8867da5.zip |
Comments.
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/los.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc index b30bac7249..95b05bf9e1 100644 --- a/crawl-ref/source/los.cc +++ b/crawl-ref/source/los.cc @@ -542,16 +542,8 @@ static int _imbalance(const std::vector<coord_def>& ray) return imb; } -// Find a nonblocked ray from source to target. Return false if no -// such ray could be found, otherwise return true and fill ray -// appropriately. -// if range is too great or all rays are blocked. -// If cycle_dir is 0, find the first fitting ray. If it is 1 or -1, -// assume that ray is appropriately filled in, and look for the next -// ray in that cycle direction. -// If find_shortest is true, examine all rays that hit the target and -// take the shortest (starting at ray.fullray_idx). - +// Coordinate transformation so we can find_ray quadrant-by-quadrant. +// TODO: Unify with los_params. struct trans { coord_def source; @@ -662,6 +654,15 @@ bool _find_ray_se(const coord_def& target, ray_def& ray, return (found); } +// Find a nonblocked ray from source to target. Return false if no +// such ray could be found, otherwise return true and fill ray +// appropriately. +// if range is too great or all rays are blocked. +// If cycle_dir is 0, find the first fitting ray. If it is 1 or -1, +// assume that ray is appropriately filled in, and look for the next +// ray in that cycle direction. +// If find_shortest is true, examine all rays that hit the target and +// take the shortest (starting at ray.fullray_idx). bool find_ray(const coord_def& source, const coord_def& target, ray_def& ray, int cycle_dir, bool find_best, bool ignore_solid) @@ -706,6 +707,7 @@ bool find_ray(const coord_def& source, const coord_def& target, return true; } +// Returns a straight ray from source to target. void fallback_ray(const coord_def& source, const coord_def& target, ray_def& ray) { |