convert colour to a 2 bit format

This commit is contained in:
2025-01-24 16:29:22 +01:00
parent c80cf60d52
commit 23a27e3e10
5 changed files with 43 additions and 35 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include <SDL2/SDL.h>
#include <stdint.h>
#include "../game/game.h"
@@ -8,19 +9,6 @@
#define BLOCK_WIDTH (SCREEN_WIDTH / COLUMNS)
#define BLOCK_HEIGHT (SCREEN_HEIGHT / ROWS)
// fits colours in a 3 bit length
// 4th bit is unused
typedef enum {
BLACK = 0,
RED = 1,
GREEN = 2,
BLUE = 4,
YELLOW = RED | GREEN,
CYAN = GREEN | BLUE,
MAGENTA = BLUE | RED,
WHITE = RED | GREEN | BLUE,
} Colour;
typedef struct {
SDL_Window* window;
SDL_Renderer* renderer;