summaryrefslogtreecommitdiffstats
path: root/src/VoronoiMap.cpp
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2016-02-06 11:37:34 +0100
commit6fdd7194c81be7234a126bdc3b48f0291fce3567 (patch)
tree7d5ac74b7385ce4ebf77588d80549c884c2b993c /src/VoronoiMap.cpp
parentMerge pull request #2958 from LogicParrot/fence (diff)
parentBulk clearing of whitespace (diff)
downloadcuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.gz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.bz2
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.lz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.xz
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.tar.zst
cuberite-6fdd7194c81be7234a126bdc3b48f0291fce3567.zip
Diffstat (limited to 'src/VoronoiMap.cpp')
-rw-r--r--src/VoronoiMap.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/VoronoiMap.cpp b/src/VoronoiMap.cpp
index 5ad634fe4..4c0aab61a 100644
--- a/src/VoronoiMap.cpp
+++ b/src/VoronoiMap.cpp
@@ -87,9 +87,9 @@ int cVoronoiMap::GetValueAt(
{
int CellX = a_X / m_CellSize;
int CellY = a_Y / m_CellSize;
-
+
UpdateCell(CellX, CellY);
-
+
// Get 5x5 neighboring cell seeds, compare distance to each. Return the value in the minumim-distance cell
int NearestSeedX = 0, NearestSeedY = 0;
int MinDist = m_CellSize * m_CellSize * 16; // There has to be a cell closer than this
@@ -101,7 +101,7 @@ int cVoronoiMap::GetValueAt(
{
int SeedX = m_SeedX[x][y];
int SeedY = m_SeedZ[x][y];
-
+
int Dist = (SeedX - a_X) * (SeedX - a_X) + (SeedY - a_Y) * (SeedY - a_Y);
if (Dist < MinDist)
{
@@ -187,7 +187,7 @@ void cVoronoiMap::UpdateCell(int a_CellX, int a_CellZ)
{
return;
}
-
+
// Update the cell cache for the new cell position:
int NoiseBaseX = a_CellX - 2;
int NoiseBaseZ = a_CellZ - 2;