summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ray.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-11 09:24:25 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-11 09:24:25 +0200
commitbdb4df70e835b9991b6ddfff03377db2dde7b6d3 (patch)
tree54d1ed35c2ceb0749d428779c058aaea65272349 /crawl-ref/source/ray.cc
parent58f42dec260dc9d186ff8b6453a989930723eba4 (diff)
downloadcrawl-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.cc5
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;
}