diff --git a/code/source-c/chunk_loader.c b/code/source-c/chunk_loader.c index 0b3fa6e..3ae68ae 100644 --- a/code/source-c/chunk_loader.c +++ b/code/source-c/chunk_loader.c @@ -72,8 +72,6 @@ tc_chunk_s * tc_load_chunk_of_loader(tc_chunkloader_s *loader, tc_vec3i_s coord) if(chunk == NULL) { - printf("Creating chunk at: %d %d %d\n", coord.x, coord.y, coord.z); - chunk = tc_allocate_chunk(loader->world); chunk->position = coord; diff --git a/code/source-c/default_terrain_generator.c b/code/source-c/default_terrain_generator.c index 1b79b57..282b173 100644 --- a/code/source-c/default_terrain_generator.c +++ b/code/source-c/default_terrain_generator.c @@ -28,6 +28,9 @@ bool tc_generate_default_terrain_chunk(tc_worldgen_s *gen, tc_chunk_s *chunk) } ++x_in_chunk; } + tc_block_s air; + block.type_identifier = 0; + tc_set_block_in_chunk(chunk, 6, 8, 14, air); return true; } diff --git a/code/source-c/main.c b/code/source-c/main.c index 779a80e..6d8d302 100644 --- a/code/source-c/main.c +++ b/code/source-c/main.c @@ -110,7 +110,12 @@ void render() float depth = 10000000.0f; glClearBufferfv(GL_DEPTH, 0, &depth); - mat4x4_perspective(projection_matrix, 120, 1200 / 800, 0.0001f, 1000.0f); + int fb_width = 0; + int fb_height = 0; + SDL_GetWindowSize(tc_game_state_g.renderer.window, &fb_width, &fb_height); + + glViewport(0, 0, fb_width, fb_height); + mat4x4_perspective(projection_matrix, 120, ((float) fb_width) / ((float) fb_height), 0.0001f, 1000.0f); mat4x4_identity(view_matrix); mat4x4_rotate_X(view_matrix, view_matrix, tc_camera_rotation.x); @@ -160,7 +165,7 @@ bool update() { if(event.window.event == SDL_WINDOWEVENT_RESIZED) { - puts("RESIZED"); + } } break; case SDL_KEYDOWN: diff --git a/code/source-c/world.c b/code/source-c/world.c index 7b386d0..d8100b4 100644 --- a/code/source-c/world.c +++ b/code/source-c/world.c @@ -158,7 +158,7 @@ tc_world_s * tc_new_world(tc_worldgen_s *generator) world->pool = tc_new_chunk_pool(128); world->worldgen = &tc_default_terrain_generator_g; // world->center_chunk = tc_new_chunk(world, 0, 0, 0); - world->load_radius = 1; + world->load_radius = 3; world->num_loaders = 1; world->loaders = malloc(sizeof(tc_chunkloader_s) * world->num_loaders); world->loaders[0] = tc_create_spawn_loader(world);