summaryrefslogtreecommitdiffstats
path: root/source/Generating/HeiGen.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-06 14:20:25 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-06 14:20:25 +0200
commit7004622e8b99c56ef4cc8c528fbe510b36d604ed (patch)
tree12abd33e558e18db32dddbc2d20b9087bd418e3f /source/Generating/HeiGen.cpp
parentDistortedHeightmap: Slight speed increase (diff)
downloadcuberite-7004622e8b99c56ef4cc8c528fbe510b36d604ed.tar
cuberite-7004622e8b99c56ef4cc8c528fbe510b36d604ed.tar.gz
cuberite-7004622e8b99c56ef4cc8c528fbe510b36d604ed.tar.bz2
cuberite-7004622e8b99c56ef4cc8c528fbe510b36d604ed.tar.lz
cuberite-7004622e8b99c56ef4cc8c528fbe510b36d604ed.tar.xz
cuberite-7004622e8b99c56ef4cc8c528fbe510b36d604ed.tar.zst
cuberite-7004622e8b99c56ef4cc8c528fbe510b36d604ed.zip
Diffstat (limited to 'source/Generating/HeiGen.cpp')
-rw-r--r--source/Generating/HeiGen.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/Generating/HeiGen.cpp b/source/Generating/HeiGen.cpp
index d012792bb..99fe5bd32 100644
--- a/source/Generating/HeiGen.cpp
+++ b/source/Generating/HeiGen.cpp
@@ -116,6 +116,23 @@ void cHeiGenCache::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap
+bool cHeiGenCache::GetHeightAt(int a_ChunkX, int a_ChunkZ, int a_RelX, int a_RelZ, HEIGHTTYPE & a_Height)
+{
+ for (int i = 0; i < m_CacheSize; i++)
+ {
+ if ((m_CacheData[i].m_ChunkX == a_ChunkX) && (m_CacheData[i].m_ChunkZ == a_ChunkZ))
+ {
+ a_Height = cChunkDef::GetHeight(m_CacheData[i].m_HeightMap, a_RelX, a_RelZ);
+ return true;
+ }
+ } // for i - m_CacheData[]
+ return false;
+}
+
+
+
+
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cHeiGenClassic: