From 259c727658485ea00d6ef8617ecab579be871470 Mon Sep 17 00:00:00 2001 From: venomade Date: Thu, 27 Feb 2025 17:25:46 +0000 Subject: Initial Commit --- src/simulator/rendering.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/simulator/rendering.h (limited to 'src/simulator/rendering.h') diff --git a/src/simulator/rendering.h b/src/simulator/rendering.h new file mode 100644 index 0000000..a899cc2 --- /dev/null +++ b/src/simulator/rendering.h @@ -0,0 +1,36 @@ +#ifndef RENDERING_H +#define RENDERING_H + +#include +#include "../game.h" + +#define SCREEN_WIDTH 600 +#define SCREEN_HEIGHT 600 + +#define CELL_WIDTH ((float) SCREEN_WIDTH / (float) BOARD_WIDTH) +#define CELL_HEIGHT ((float) SCREEN_HEIGHT / (float) BOARD_HEIGHT) + +#define BACKGROUND_COLOR 0x190A0FFF +#define GRID_COLOR 0xEBCBF4FF +#define WALL_COLOR (GRID_COLOR) +#define AGENT_COLOR_ALIVE 0x8447FFFF +// #define AGENT_COLOR_DEAD 0x392A2FFF +#define AGENT_COLOR_DEAD (BACKGROUND_COLOR) +#define FOOD_COLOR 0xE1F0C4FF + + +#define HEX_COLOR(hex) \ + ((hex) >> (3 * 8)) & 0xFF, \ + ((hex) >> (2 * 8)) & 0xFF, \ + ((hex) >> (1 * 8)) & 0xFF, \ + ((hex) >> (0 * 8)) & 0xFF + +int scc(int code); + +void *scp(void *ptr); + +void render_board_grid(SDL_Renderer *renderer); + +void render_game(SDL_Renderer *renderer, const Game *game); + +#endif -- cgit 1.4.1-2-gfad0