32 lines
949 B
C
32 lines
949 B
C
|
#include "world.h"
|
||
|
|
||
|
bool tc_generate_default_terrain_chunk(tc_worldgen_s *gen, tc_chunk_s *chunk)
|
||
|
{
|
||
|
tc_block_s block;
|
||
|
block.type_identifier = 1;
|
||
|
block.position.x = 0.0f;
|
||
|
block.position.y = 0.0f;
|
||
|
block.position.z = 0.0f;
|
||
|
|
||
|
uint32_t x_in_chunk = 0;
|
||
|
uint32_t y_in_chunk = 0;
|
||
|
uint32_t z_in_chunk = 0;
|
||
|
while(x_in_chunk < 32)
|
||
|
{
|
||
|
y_in_chunk = 0;
|
||
|
while(y_in_chunk < 32)
|
||
|
{
|
||
|
z_in_chunk = 0;
|
||
|
while(z_in_chunk < 32)
|
||
|
{
|
||
|
tc_set_block_in_chunk(chunk, x_in_chunk, y_in_chunk, z_in_chunk, block);
|
||
|
++z_in_chunk;
|
||
|
}
|
||
|
++y_in_chunk;
|
||
|
}
|
||
|
++x_in_chunk;
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
}
|