use "const" where able to + random readability changes

This commit is contained in:
2025-02-04 12:17:42 +01:00
parent c8d43d9564
commit be09d57a27
14 changed files with 84 additions and 92 deletions

View File

@@ -5,14 +5,14 @@
#include "../game/game.h"
#define PX_DENS 25 // pixel density; pixels per block
#define TET_PADDING 10 // padding around the tetris playing field
#define TET_WIDTH (COLUMNS * PX_DENS - TET_PADDING) // tetris playing field width
#define TET_HEIGHT (TET_WIDTH / COLUMNS * ROWS) // tetris playing field height
#define SCREEN_WIDTH ((COLUMNS + 6) * PX_DENS) // window width
#define SCREEN_HEIGHT ((COLUMNS ) * PX_DENS / COLUMNS * ROWS) // window height
#define BLOCK_WIDTH (TET_WIDTH / COLUMNS) // width of a block
#define BLOCK_HEIGHT (TET_HEIGHT / ROWS) // height of a block
#define PX_DENS 25 // pixel density; pixels per block
#define TET_PADDING 10 // padding around the tetris playing field
#define TET_WIDTH (COLUMNS * PX_DENS - TET_PADDING) // tetris playing field width
#define TET_HEIGHT (TET_WIDTH / COLUMNS * ROWS) // tetris playing field height
#define SCREEN_WIDTH ((COLUMNS + 6) * PX_DENS) // window width
#define SCREEN_HEIGHT ((COLUMNS) * PX_DENS / COLUMNS * ROWS) // window height
#define BLOCK_WIDTH (TET_WIDTH / COLUMNS) // width of a block
#define BLOCK_HEIGHT (TET_HEIGHT / ROWS) // height of a block
typedef struct {
SDL_Window* window;
@@ -21,4 +21,4 @@ typedef struct {
} RenderData;
int renderer_init(SDL_Window** window, SDL_Renderer** renderer);
void renderer_update(const RenderData* render_data);
void renderer_update(RenderData const* render_data);