diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-11 09:24:25 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-11 09:24:25 +0200 |
commit | bdb4df70e835b9991b6ddfff03377db2dde7b6d3 (patch) | |
tree | 54d1ed35c2ceb0749d428779c058aaea65272349 /crawl-ref/source/ray.cc | |
parent | 58f42dec260dc9d186ff8b6453a989930723eba4 (diff) | |
download | crawl-ref-bdb4df70e835b9991b6ddfff03377db2dde7b6d3.tar.gz crawl-ref-bdb4df70e835b9991b6ddfff03377db2dde7b6d3.zip |
Convert LOS algorithm to use coord_def instead of separate x,y.
Diffstat (limited to 'crawl-ref/source/ray.cc')
-rw-r--r-- | crawl-ref/source/ray.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crawl-ref/source/ray.cc b/crawl-ref/source/ray.cc index b52d7401ef..e87950178d 100644 --- a/crawl-ref/source/ray.cc +++ b/crawl-ref/source/ray.cc @@ -322,7 +322,7 @@ int ray_def::raw_advance() // slope, bounded by the given pre-squared LOS radius. // Store the visited cells in xpos[] and ypos[], and // return the number of cells visited. -int ray_def::footprint(int radius2, int xpos[], int ypos[]) const +int ray_def::footprint(int radius2, coord_def cpos[]) const { // copy starting point double ax = accx; @@ -337,8 +337,7 @@ int ray_def::footprint(int radius2, int xpos[], int ypos[]) const if (curx*curx + cury*cury > radius2) break; - xpos[cellnum] = curx; - ypos[cellnum] = cury; + cpos[cellnum] = coord_def(curx, cury); } return cellnum; } |