Make colour initialisation on the integer

This commit is contained in:
Quinn
2024-08-14 15:04:20 +02:00
parent 315eaf1636
commit 4077379b47
2 changed files with 11 additions and 11 deletions

View File

@@ -1,9 +1,9 @@
typedef union {
struct {
unsigned char r;
unsigned char g;
unsigned char b;
unsigned char a;
};
unsigned packed;
struct {
unsigned char a;
unsigned char b;
unsigned char g;
unsigned char r;
};
} Colour;

View File

@@ -24,11 +24,11 @@ void level_init(Level* level) {
// initialize bricks
// define the colours of the brick rows
const Colour colours[BRICK_COLUMNS] = {
{0x5B, 0xCE, 0xFA, 0xFF},
{0xF5, 0xA9, 0xB8, 0xFF},
{0xFF, 0xFF, 0xFF, 0xFF},
{0xF5, 0xA9, 0xB8, 0xFF},
{0x5B, 0xCE, 0xFA, 0xFF}
{0x3DA542FF},
{0xA6D378FF},
{0xFFFFFFFF},
{0xA8A8A8FF},
{0x202020FF}
};
int brick_width = BRICK_WIDTH + BRICK_PADDING;