diff options
author | admin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-11-06 10:23:20 +0100 |
---|---|---|
committer | admin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-11-06 10:23:20 +0100 |
commit | 36f7084e3fb4193676b14f302d0f961f2102e4ba (patch) | |
tree | b2e7d7c7d1854dbe484605b4054e707c0bd09cef /source/cChunk.cpp | |
parent | Finished most of piston class. Pistons should work when a redstone current with wire is lit up or extinguished near them but don't yet. There'sa bug to kill. (diff) | |
download | cuberite-36f7084e3fb4193676b14f302d0f961f2102e4ba.tar cuberite-36f7084e3fb4193676b14f302d0f961f2102e4ba.tar.gz cuberite-36f7084e3fb4193676b14f302d0f961f2102e4ba.tar.bz2 cuberite-36f7084e3fb4193676b14f302d0f961f2102e4ba.tar.lz cuberite-36f7084e3fb4193676b14f302d0f961f2102e4ba.tar.xz cuberite-36f7084e3fb4193676b14f302d0f961f2102e4ba.tar.zst cuberite-36f7084e3fb4193676b14f302d0f961f2102e4ba.zip |
Diffstat (limited to 'source/cChunk.cpp')
-rw-r--r-- | source/cChunk.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp index e9fd739eb..a8a579e96 100644 --- a/source/cChunk.cpp +++ b/source/cChunk.cpp @@ -337,7 +337,7 @@ void cChunk::Tick(float a_Dt) case E_BLOCK_GRASS:
{
char AboveBlock = GetBlock( Index+1 );
- if (!( (AboveBlock == 0) || (g_BlockOneHitDig[AboveBlock]) ) ) //changed to not allow grass if any one hit object is on top
+ if (!( (AboveBlock == 0) || (g_BlockOneHitDig[AboveBlock]) || (g_BlockTransparent[AboveBlock]) ) ) //changed to not allow grass if any one hit object is on top
{
FastSetBlock( m_BlockTickX, m_BlockTickY, m_BlockTickZ, E_BLOCK_DIRT, GetLight( m_BlockMeta, Index ) );
}
@@ -687,13 +687,13 @@ void cChunk::SpreadLight(char* a_LightBuffer) float GetNoise( float x, float y, cNoise & a_Noise )
{
- float oct1 = a_Noise.SSE_CubicNoise2D( x*cGenSettings::HeightFreq1, y*cGenSettings::HeightFreq1 )*cGenSettings::HeightAmp1;
- float oct2 = a_Noise.SSE_CubicNoise2D( x*cGenSettings::HeightFreq2, y*cGenSettings::HeightFreq2 )*cGenSettings::HeightAmp2;
- float oct3 = a_Noise.SSE_CubicNoise2D( x*cGenSettings::HeightFreq3, y*cGenSettings::HeightFreq3 )*cGenSettings::HeightAmp3;
+ float oct1 = a_Noise.CubicNoise2D( x*cGenSettings::HeightFreq1, y*cGenSettings::HeightFreq1 )*cGenSettings::HeightAmp1;
+ float oct2 = a_Noise.CubicNoise2D( x*cGenSettings::HeightFreq2, y*cGenSettings::HeightFreq2 )*cGenSettings::HeightAmp2;
+ float oct3 = a_Noise.CubicNoise2D( x*cGenSettings::HeightFreq3, y*cGenSettings::HeightFreq3 )*cGenSettings::HeightAmp3;
- float height = a_Noise.SSE_CubicNoise2D( x*0.1f, y*0.1f )*2;
+ float height = a_Noise.CubicNoise2D( x*0.1f, y*0.1f )*2;
- float flatness = ((a_Noise.SSE_CubicNoise2D( x*0.5f, y*0.5f ) + 1.f ) * 0.5f) * 1.1f; // 0 ... 1.5
+ float flatness = ((a_Noise.CubicNoise2D( x*0.5f, y*0.5f ) + 1.f ) * 0.5f) * 1.1f; // 0 ... 1.5
flatness *= flatness * flatness;
return (oct1 + oct2 + oct3) * flatness + height;
@@ -845,8 +845,8 @@ void cChunk::GenerateTerrain() // int yy = TopY;
int zz = z + m_PosZ*16;
- float val1 = m_Noise.SSE_CubicNoise2D( xx*0.1f, zz*0.1f );
- float val2 = m_Noise.SSE_CubicNoise2D( xx*0.01f, zz*0.01f );
+ float val1 = m_Noise.CubicNoise2D( xx*0.1f, zz*0.1f );
+ float val2 = m_Noise.CubicNoise2D( xx*0.01f, zz*0.01f );
if( m_BlockType[index] == SandID )
{
if( (val1 + val2 > 0.f) && (rand()%128) > 124 && m_BlockType[index] == E_BLOCK_SAND )
@@ -861,8 +861,8 @@ void cChunk::GenerateTerrain() }
else if( m_BlockType[index] == GrassID )
{
- float val3 = m_Noise.SSE_CubicNoise2D( xx*0.01f+10, zz*0.01f+10 );
- float val4 = m_Noise.SSE_CubicNoise2D( xx*0.05f+20, zz*0.05f+20 );
+ float val3 = m_Noise.CubicNoise2D( xx*0.01f+10, zz*0.01f+10 );
+ float val4 = m_Noise.CubicNoise2D( xx*0.05f+20, zz*0.05f+20 );
if( val1 + val2 > 0.2f && (rand()%128) > 124 )
m_World->GrowTree( xx, TopY, zz );
else if( val3 > 0.2f && (rand()%128) > 124 )
|