mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 14:05:45 +01:00
rename Colour8 to colour8
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user