summaryrefslogtreecommitdiffstats
path: root/src/VoronoiMap.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-06-26 15:49:53 +0200
committerHowaner <franzi.moos@googlemail.com>2014-06-26 15:49:53 +0200
commiteaf36766f60662a0aa7829ae3d96f47fd91b408d (patch)
tree3075c09f947dfbaff163c405c74f518a8064ea89 /src/VoronoiMap.h
parentderp (diff)
parentMerge pull request #1126 from mc-server/BlockInfoInit (diff)
downloadcuberite-eaf36766f60662a0aa7829ae3d96f47fd91b408d.tar
cuberite-eaf36766f60662a0aa7829ae3d96f47fd91b408d.tar.gz
cuberite-eaf36766f60662a0aa7829ae3d96f47fd91b408d.tar.bz2
cuberite-eaf36766f60662a0aa7829ae3d96f47fd91b408d.tar.lz
cuberite-eaf36766f60662a0aa7829ae3d96f47fd91b408d.tar.xz
cuberite-eaf36766f60662a0aa7829ae3d96f47fd91b408d.tar.zst
cuberite-eaf36766f60662a0aa7829ae3d96f47fd91b408d.zip
Diffstat (limited to 'src/VoronoiMap.h')
-rw-r--r--src/VoronoiMap.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/VoronoiMap.h b/src/VoronoiMap.h
index bcd37f9cf..84cf206e9 100644
--- a/src/VoronoiMap.h
+++ b/src/VoronoiMap.h
@@ -29,15 +29,34 @@ public:
/// Returns the value in the cell into which the specified point lies, and the distance to the nearest Voronoi seed
int GetValueAt(int a_X, int a_Y, int & a_MinDistance);
- /// Returns the value in the cell into which the specified point lies, and the distances to the 2 nearest Voronoi seeds
+ /// Returns the value in the cell into which the specified point lies, and the distances to the 2 nearest Voronoi seeds. Uses a cache
int GetValueAt(int a_X, int a_Y, int & a_MinDistance1, int & a_MinDistance2);
-
+
protected:
/// The noise used for generating Voronoi seeds
- cNoise m_Noise;
+ cNoise m_Noise1;
+ cNoise m_Noise2;
+ cNoise m_Noise3;
/// Size of the Voronoi cells (avg X/Y distance between the seeds)
int m_CellSize;
+
+ /** The X coordinate of the currently cached cell neighborhood */
+ int m_CurrentCellX;
+
+ /** The Z coordinate of the currently cached cell neighborhood */
+ int m_CurrentCellZ;
+
+ /** The seeds of cells around m_CurrentCellX, m_CurrentCellZ, X-coords */
+ int m_SeedX[5][5];
+
+ /** The seeds of cells around m_CurrentCellX, m_CurrentCellZ, X-coords */
+ int m_SeedZ[5][5];
+
+
+ /** Updates the cached cell seeds to match the specified cell. Noop if cell pos already matches.
+ Updates m_SeedX and m_SeedZ. */
+ void UpdateCell(int a_CellX, int a_CellZ);
} ;