1
0

Speed-up. I got about 40 extra ch/s

This commit is contained in:
STRWarrior 2014-01-08 22:23:26 +01:00
parent 5aa34cf77d
commit d462085108

View File

@ -589,18 +589,23 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc)
for (int y = 0; y < SEGMENT_HEIGHT; y++)
{
int Val = Lo + (Hi - Lo) * y / SEGMENT_HEIGHT;
BLOCKTYPE Block = E_BLOCK_AIR;
if (Val < m_Threshold) // Don't calculate if the block should be Netherrack or Soulsand when it's already decided that it's air.
{
NOISE_DATATYPE NoiseX = ((NOISE_DATATYPE)(BaseX * cChunkDef::Width + x)) / 8;
NOISE_DATATYPE NoiseY = ((NOISE_DATATYPE)(BaseZ * cChunkDef::Width + z)) / 8;
NOISE_DATATYPE CompBlock = m_Noise1.CubicNoise3D(NoiseX, (float) y, NoiseY);
if (CompBlock < -0.5)
{
a_ChunkDesc.SetBlockType(x, y + Segment, z, (Val < m_Threshold) ? E_BLOCK_SOULSAND : E_BLOCK_AIR);
Block = E_BLOCK_SOULSAND;
}
else
{
a_ChunkDesc.SetBlockType(x, y + Segment, z, (Val < m_Threshold) ? E_BLOCK_NETHERRACK : E_BLOCK_AIR);
Block = E_BLOCK_NETHERRACK;
}
}
a_ChunkDesc.SetBlockType(x, y + Segment, z, Block);
}
}
// Swap the floors: