diff options
Diffstat (limited to 'src/main/game/game.c')
-rw-r--r-- | src/main/game/game.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/game/game.c b/src/main/game/game.c index 7d756a9..b813906 100644 --- a/src/main/game/game.c +++ b/src/main/game/game.c @@ -41,14 +41,18 @@ static void game_draw_field(TrisGame *game, float box_size); static char game_next_sign(TrisGame *game); static void -draw_sign(TrisGame *game, float x, float y) +draw_sign(TrisGame *game, Cell *cell) { + float x = cell->cx; + float y = cell->cy; float l = 0.20f; + char sign = game_next_sign(game); - if (game_next_sign(game) == SIGN_CIRCLE) { + cell_set_sign(cell, sign); + if (sign == SIGN_CIRCLE) { engine_draw_circle(x, y, l, 120, 1); game->sign = SIGN_CROSS; - } else if (game_next_sign(game) == SIGN_CROSS) { + } else if (sign == SIGN_CROSS) { engine_draw_line(x - l, y + l, x + l, y - l); engine_draw_line(x + l, y + l, x - l, y - l); game->sign = SIGN_CIRCLE; @@ -66,7 +70,7 @@ loop_cells(TrisGame *game, float x, float y) do { Cell *cell = current->data; if (!cell_is_filled(cell) && cell_within_bounds(cell, x, y)) { - draw_sign(game, cell->cx, cell->cy); + draw_sign(game, cell); cell_set_filled(cell, true); } current = current->next; |