summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/los.cc2
-rw-r--r--crawl-ref/source/ray.cc8
2 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc
index 656f3b4717..394ee1d96a 100644
--- a/crawl-ref/source/los.cc
+++ b/crawl-ref/source/los.cc
@@ -523,7 +523,7 @@ static bool _superior_ray(int shortest, int imbalance,
// in the ray. This is a reasonable measure of deviation from
// the Bresenham line between our selected source and
// destination.
-int _imbalance(const std::vector<coord_def>& ray)
+static int _imbalance(const std::vector<coord_def>& ray)
{
int imb = 0;
int diags = 0, straights = 0;
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()