mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 14:05:45 +01:00
convert colour to a 2 bit format
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user