summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-22 00:29:04 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-22 00:29:04 +0200
commit9d25cfc7fa3a93cb4bee41a6aab9b76d86ad7298 (patch)
tree9822836086beeb208ad238de74a1459d2e0e7bad
parentd69c230773d63f33dccf5425c6f789fc2f447dab (diff)
downloadtris-9d25cfc7fa3a93cb4bee41a6aab9b76d86ad7298.tar.gz
tris-9d25cfc7fa3a93cb4bee41a6aab9b76d86ad7298.zip
Remove parameters x, y from draw_field function
-rw-r--r--src/main/game/game.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/game/game.c b/src/main/game/game.c
index f61671a..7d756a9 100644
--- a/src/main/game/game.c
+++ b/src/main/game/game.c
@@ -37,7 +37,7 @@ init_log(void)
log = log_create("Game");
}
-static void game_draw_field(TrisGame *game, float box_size, float x, float y);
+static void game_draw_field(TrisGame *game, float box_size);
static char game_next_sign(TrisGame *game);
static void
@@ -100,7 +100,7 @@ game_init(int width, int height)
ui_set_title("Tris Game");
engine_set_mouse_button_listener(game_mouse_button_pressed, game);
- game_draw_field(game, 0.5, 0, 0);
+ game_draw_field(game, 0.5f);
return game;
}
@@ -112,8 +112,11 @@ game_start()
}
static void
-game_draw_field(TrisGame *game, float box_size, float x, float y)
+game_draw_field(TrisGame *game, float box_size)
{
+ float x = 0.0f;
+ float y = 0.0f;
+
float half_box = box_size / 2;
engine_draw_line(x - half_box, y + half_box * 3, x - half_box, y - half_box * 3);
engine_draw_line(x + half_box, y + half_box * 3, x + half_box, y - half_box * 3);