diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-20 21:41:19 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-20 21:41:19 +0100 |
commit | f8ae3e6f62fd6d86b56ace38599727c53c0ce1ee (patch) | |
tree | 2b4bf008668522bfbbf619be7b859573d86d2f3e | |
parent | Alpha-sorted the generators in ComposableGenerator (diff) | |
download | cuberite-f8ae3e6f62fd6d86b56ace38599727c53c0ce1ee.tar cuberite-f8ae3e6f62fd6d86b56ace38599727c53c0ce1ee.tar.gz cuberite-f8ae3e6f62fd6d86b56ace38599727c53c0ce1ee.tar.bz2 cuberite-f8ae3e6f62fd6d86b56ace38599727c53c0ce1ee.tar.lz cuberite-f8ae3e6f62fd6d86b56ace38599727c53c0ce1ee.tar.xz cuberite-f8ae3e6f62fd6d86b56ace38599727c53c0ce1ee.tar.zst cuberite-f8ae3e6f62fd6d86b56ace38599727c53c0ce1ee.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Generating/HeiGen.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/Generating/HeiGen.cpp b/source/Generating/HeiGen.cpp index c7f867f50..085459ad7 100644 --- a/source/Generating/HeiGen.cpp +++ b/source/Generating/HeiGen.cpp @@ -228,6 +228,31 @@ void cHeiGenBiomal::GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMa } // for x } // for z + /* + // Linearly interpolate 4x4 blocks of heightmap: + // This is fast, but really ugly! Do not use! + const int STEPZ = 4; // Must be a divisor of 16 + const int STEPX = 4; // Must be a divisor of 16 + int Height[17 * 17]; + for (int z = 0; z < 17; z += STEPZ) + { + for (int x = 0; x < 17; x += STEPX) + { + Height[x + 17 * z] = GetHeightAt(x, z, a_ChunkX, a_ChunkZ, Biomes); + } + } + IntArrayLinearInterpolate2D(Height, 17, 17, STEPX, STEPZ); + + // Copy into the heightmap + for (int z = 0; z < cChunkDef::Width; z++) + { + for (int x = 0; x < cChunkDef::Width; x++) + { + cChunkDef::SetHeight(a_HeightMap, x, z, Height[x + 17 * z]); + } + } + */ + // For each height, go through neighboring biomes and add up their idea of height: for (int z = 0; z < cChunkDef::Width; z++) { |