Techneck/code/source-c/default_terrain_generator.c

33 lines
939 B
C
Raw Normal View History

2023-10-11 08:10:06 +00:00
#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;
2023-10-12 06:18:43 +00:00
}