1
0

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
This commit is contained in:
madmaxoft@gmail.com 2013-03-20 20:41:19 +00:00
parent d627e3a2e5
commit f8ae3e6f62

View File

@ -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++)
{