From f8ae3e6f62fd6d86b56ace38599727c53c0ce1ee Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 20 Mar 2013 20:41:19 +0000 Subject: HeiGenBiomal: added a fast but ugly-looking optimization, disabled by default. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1292 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Generating/HeiGen.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source') 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++) { -- cgit v1.2.3