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,18 +1,16 @@
#pragma once
#include <SDL2/SDL.h>
#include "../window/colour.h"
typedef uint32_t PackedRow;
// stores the data used in the game
#define COLUMNS ((uint8_t)(sizeof(PackedRow) * 8 / 3))
#define ROWS ((uint8_t)(COLUMNS * 2))
typedef union {
// NOTE: this has packing issues
struct {
uint8_t block : 3;
} columns[COLUMNS];
PackedRow val;
typedef struct {
Colour columns[COLUMNS];
} Row;
typedef struct {