rename Colour8 to colour8

This commit is contained in:
2025-02-10 11:58:00 +01:00
parent 94ff2d200a
commit 94ca7e3d08
7 changed files with 20 additions and 20 deletions

View File

@@ -48,7 +48,7 @@ void game_init(GameData* const game_data) {
// allocate size for each row
for (int8_t i = 0; i < ROWS; i++) {
game_data->rows[i] = calloc(COLUMNS, sizeof(Colour8));
game_data->rows[i] = calloc(COLUMNS, sizeof(colour8));
// game_data->rows[i][0] = (colour8){(uint8_t)((((i + 1) ^ ((i + 1) >> 3)) * 0x27) & 0xFF)}; // for debugging rows
}

View File

@@ -10,8 +10,8 @@
#define COLUMNS ((int8_t)10)
#define ROWS ((int8_t)24)
typedef const Colour8* const CRow;
typedef Colour8* Row;
typedef const colour8* const CRow;
typedef colour8* Row;
typedef struct {
Row rows[ROWS];

View File

@@ -59,7 +59,7 @@ static void clear_rows(Row* const rows, uint16_t* const score) {
// sets a shape to the screen
static void set_shape_i(Row const* const row, ShapeId const id, int8_t const pos_x) {
Shape const shape = shape_from_id(id);
Colour8 const colour = colour_from_id(id);
colour8 const colour = colour_from_id(id);
for (int8_t y = 0; y < SHAPE_HEIGHT; y++) {
ShapeRow const shape_row = shape_get_row(shape, y);

View File

@@ -53,7 +53,7 @@ Shape shape_from_id(ShapeId const id) {
return shapes[id & 7][id >> 3];
}
Colour8 colour_from_id(ShapeId const id) {
colour8 colour_from_id(ShapeId const id) {
switch (id & 7) {
case TETROMINO_O: return COLOUR_YELLOW;
case TETROMINO_I: return COLOUR_CYAN;

View File

@@ -36,4 +36,4 @@ static inline bool is_set(ShapeRow const row, uint8_t const index) {
}
Shape shape_from_id(ShapeId id);
Colour8 colour_from_id(ShapeId id);
colour8 colour_from_id(ShapeId id);