From 656d93856f5ee7ae433bebf2d21edb0be594bb6f Mon Sep 17 00:00:00 2001 From: julesgrc0 Date: Fri, 24 May 2024 12:04:36 +0200 Subject: [PATCH] update TODO comments and fix code formatting --- src/screens/loading/loading.c | 2 +- src/screens/menu/menu.c | 16 ++++++++++++---- src/screens/menu/views/home.h | 0 src/screens/menu/views/maps.h | 0 src/screens/menu/views/settings.h | 0 src/terrain/terrain_data.h | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 src/screens/menu/views/home.h create mode 100644 src/screens/menu/views/maps.h create mode 100644 src/screens/menu/views/settings.h diff --git a/src/screens/loading/loading.c b/src/screens/loading/loading.c index 3c74c7c..bf19820 100644 --- a/src/screens/loading/loading.c +++ b/src/screens/loading/loading.c @@ -91,7 +91,7 @@ void loading_screen(w_state *state) { const char *loading_text = "Loading..."; const char *error_text = "Failed to load resources !"; - // TODO: use gui label + /// TODO: use gui label Vector2 loading_pos = { .x = (GetScreenWidth() - MeasureText(loading_text, text_size)) / 2.f, diff --git a/src/screens/menu/menu.c b/src/screens/menu/menu.c index 4aa92d0..5516fa3 100644 --- a/src/screens/menu/menu.c +++ b/src/screens/menu/menu.c @@ -40,13 +40,18 @@ void menu_screen(w_state *state) { ctx, Vector2Add(title_text->position, VEC(0, title_text->font_size + 10)), (char *)TextFormat("made by @julesgrc0 - %s", WISPY_VERSION), 20, WHITE); - // TODO: pre-render the cubes to a texture + + + /// TODO: pre-render to a texture unsigned int cubes[RENDER_CUBE_COUNT * RENDER_CUBE_COUNT] = {0}; for (unsigned int y = 0; y < RENDER_CUBE_COUNT; y++) { for (unsigned int x = 0; x < RENDER_CUBE_COUNT; x++) { - cubes[x + y * RENDER_CUBE_COUNT] = GetRandomValue(0, 2); + /// TODO: fix sin wave + cubes[x + y * RENDER_CUBE_COUNT] = (int)(sin(x / 100.0f) * 1.5f + 1.5f); } } + + while (!WindowShouldClose() && is_active) { BeginTextureMode(state->render); @@ -65,21 +70,24 @@ void menu_screen(w_state *state) { } } + /// TODO: move to home view (start) if (update_button(play_button)) { is_active = false; } if (update_button(setting_button)) { - // TODO: Implement settings screen + /// TODO: Implement settings screen } if (update_button(exit_button)) { state->state = FS_EXIT; break; } - + update_text(title_text); update_text(credit_text); + EndTextureMode(); + BeginDrawing(); ClearBackground(BLACK); draw_render_texture(state); diff --git a/src/screens/menu/views/home.h b/src/screens/menu/views/home.h new file mode 100644 index 0000000..e69de29 diff --git a/src/screens/menu/views/maps.h b/src/screens/menu/views/maps.h new file mode 100644 index 0000000..e69de29 diff --git a/src/screens/menu/views/settings.h b/src/screens/menu/views/settings.h new file mode 100644 index 0000000..e69de29 diff --git a/src/terrain/terrain_data.h b/src/terrain/terrain_data.h index 7df0dfd..98aa2a6 100644 --- a/src/terrain/terrain_data.h +++ b/src/terrain/terrain_data.h @@ -9,6 +9,6 @@ char *get_terrain_path_folder(); char *get_terrain_path_config(); char *get_terrain_path_chunk(unsigned int position); -// TODO: compress chunk files +/// TODO: compress chunk files bool read_chunk_file(unsigned int position, w_block *blocks); bool write_chunk_file(unsigned int position, w_block *blocks); \ No newline at end of file