From 499745c1c7a865941b3c102532777c19dfb92ca4 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 18 Feb 2012 17:53:22 +0000 Subject: Thread-safe chunk generation, storage and generator are queried for progress while initializing server Note that this commit breaks foliage generation - there are no trees in the chunks generated! git-svn-id: http://mc-server.googlecode.com/svn/trunk@292 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWorldGenerator_Test.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'source/cWorldGenerator_Test.cpp') diff --git a/source/cWorldGenerator_Test.cpp b/source/cWorldGenerator_Test.cpp index 08e649fb9..1ffcdbfbe 100644 --- a/source/cWorldGenerator_Test.cpp +++ b/source/cWorldGenerator_Test.cpp @@ -9,24 +9,27 @@ -void cWorldGenerator_Test::GenerateTerrain( cChunkPtr a_Chunk ) +void cWorldGenerator_Test::GenerateTerrain(int a_ChunkX, int a_ChunkY, int a_ChunkZ, char * a_BlockData) { - char* BlockType = a_Chunk->pGetType(); - + memset(a_BlockData, E_BLOCK_DIRT, cChunk::c_NumBlocks); for(int x = 0; x < 16; x++) { for(int z = 0; z < 16; z++) { - for( int y = 1; y < 128; ++y ) - { - unsigned int idx = cChunk::MakeIndex(x, y, z); - BlockType[idx] = E_BLOCK_DIRT; - } + a_BlockData[MakeIndex(x, 0, z)] = E_BLOCK_BEDROCK; } } } -void cWorldGenerator_Test::GenerateFoliage( cChunkPtr a_Chunk ) + + + + +void cWorldGenerator_Test::GenerateFoliage( cChunkPtr & a_Chunk ) { (void)a_Chunk; -} \ No newline at end of file +} + + + + -- cgit v1.2.3