summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ray.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-14 12:25:27 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-14 15:06:35 +0200
commitb4a349bc6f6c9b4e3800dccc36468b94cb0fab62 (patch)
treecdad050c63ff6f759b1a559864b8bb08ce8cc01c /crawl-ref/source/ray.cc
parent5be236ddc641b85da8fca663271770cc86fa9e29 (diff)
downloadcrawl-ref-b4a349bc6f6c9b4e3800dccc36468b94cb0fab62.tar.gz
crawl-ref-b4a349bc6f6c9b4e3800dccc36468b94cb0fab62.zip
Clean up.
Made some functions "static" and improved quadrant flipping.
Diffstat (limited to 'crawl-ref/source/ray.cc')
-rw-r--r--crawl-ref/source/ray.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/ray.cc b/crawl-ref/source/ray.cc
index 6fea3ec663..2d6ebfcabe 100644
--- a/crawl-ref/source/ray.cc
+++ b/crawl-ref/source/ray.cc
@@ -13,7 +13,7 @@ REVISION("$Rev$");
#include "los.h"
#include "terrain.h"
-int ifloor(double d)
+static int ifloor(double d)
{
return static_cast<int>(floor(d));
}
@@ -38,7 +38,7 @@ coord_def ray_def::pos() const
return coord_def(x(), y());
}
-double _reflect(double p, double c)
+static double _reflect(double p, double c)
{
return (c + c - p);
}
@@ -309,8 +309,8 @@ void ray_def::flip()
{
int signx[] = {1, -1, -1, 1};
int signy[] = {1, 1, -1, -1};
- accx *= signx[quadrant];
- accy *= signy[quadrant];
+ accx = 0.5 + signx[quadrant] * (accx - 0.5);
+ accy = 0.5 + signy[quadrant] * (accy - 0.5);
}
adv_type ray_def::raw_advance()