From a20244285334c5e6c207232c324f7c5e42cb5a86 Mon Sep 17 00:00:00 2001 From: Quinn Date: Wed, 25 Jun 2025 15:44:17 +0200 Subject: [PATCH] write some TODO comments --- src/game/tetromino/placing.c | 1 + src/io/audio.c | 1 + src/io/input.c | 1 + src/io/render.c | 1 + 4 files changed, 4 insertions(+) diff --git a/src/game/tetromino/placing.c b/src/game/tetromino/placing.c index 8406aae..c355b97 100644 --- a/src/game/tetromino/placing.c +++ b/src/game/tetromino/placing.c @@ -62,6 +62,7 @@ static void set_shape_i(row const* const row, u8 const id, int8_t const pos_x) { colour8 const colour = colour_from_id(id); for (int8_t y = 0; y < SHAPE_HEIGHT; y++) { u8 const shape_row = shape_get_row(shape, y); +// TODO: this is suboptimal, ditch the entire "representing shapes as binary-formatted data" and instead use a switch...case. if (shape_row == 0) continue; diff --git a/src/io/audio.c b/src/io/audio.c index fd41586..ddcdf54 100644 --- a/src/io/audio.c +++ b/src/io/audio.c @@ -1,3 +1,4 @@ +// TODO: audio stores audio buffers at indicies that the user specifies. (array growth is the next power of two from the idx) #include "audio.h" #include diff --git a/src/io/input.c b/src/io/input.c index bebcf67..d5965df 100644 --- a/src/io/input.c +++ b/src/io/input.c @@ -5,6 +5,7 @@ #include "window.h" +// TODO: this'll likely be insufficient, due to no code delays being applied, or it registers *just* the keydown event __attribute__((const)) static int procscancode(SDL_Scancode code) { switch (code) { case SDL_SCANCODE_Q: return MOVRL; diff --git a/src/io/render.c b/src/io/render.c index 415174c..e897322 100644 --- a/src/io/render.c +++ b/src/io/render.c @@ -84,6 +84,7 @@ static void draw_score_text(renderdata const* dat) { SDL_RenderCopy(renderer, cache->score_texture, NULL, &text_rect); } +// TODO: this is suboptimal, since each block will be 2 triangles, wasting perf. Consider using switch...case hard-coded drawing // draws a block at the specified position static inline int draw_block(SDL_Renderer* const renderer, int8_t const x, int8_t const y) { SDL_Rect const block = {get_column_pos(x), get_row_pos(y), BLOCK_WIDTH - 1, BLOCK_HEIGHT - 1};