mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 05:55:46 +01:00
write some TODO comments
This commit is contained in:
@@ -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);
|
colour8 const colour = colour_from_id(id);
|
||||||
for (int8_t y = 0; y < SHAPE_HEIGHT; y++) {
|
for (int8_t y = 0; y < SHAPE_HEIGHT; y++) {
|
||||||
u8 const shape_row = shape_get_row(shape, 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)
|
if (shape_row == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -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 "audio.h"
|
||||||
|
|
||||||
#include <SDL_audio.h>
|
#include <SDL_audio.h>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "window.h"
|
#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) {
|
__attribute__((const)) static int procscancode(SDL_Scancode code) {
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case SDL_SCANCODE_Q: return MOVRL;
|
case SDL_SCANCODE_Q: return MOVRL;
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ static void draw_score_text(renderdata const* dat) {
|
|||||||
SDL_RenderCopy(renderer, cache->score_texture, NULL, &text_rect);
|
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
|
// draws a block at the specified position
|
||||||
static inline int draw_block(SDL_Renderer* const renderer, int8_t const x, int8_t const y) {
|
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};
|
SDL_Rect const block = {get_column_pos(x), get_row_pos(y), BLOCK_WIDTH - 1, BLOCK_HEIGHT - 1};
|
||||||
|
|||||||
Reference in New Issue
Block a user