From 1855ae04c490270d9b255df7a082528b1e4922cf Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 21 May 2025 18:15:12 +0200 Subject: Add logic to get the game in mouse button pressed event --- src/main/game/game.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/game/game.c') diff --git a/src/main/game/game.c b/src/main/game/game.c index 5ec3652..e1a193a 100644 --- a/src/main/game/game.c +++ b/src/main/game/game.c @@ -61,7 +61,7 @@ draw_sign(float x, float y) } static void -game_mouse_button_pressed(float x, float y) +game_mouse_button_pressed(float x, float y, void *data) { /* Click inside the field */ if (x >= xmin && x <= xmax && y >= ymin && y <= ymax) { @@ -117,7 +117,7 @@ game_init(int width, int height) engine_init(width, height); ui_set_title("Tris Game"); - engine_set_mouse_button_listener(game_mouse_button_pressed); + engine_set_mouse_button_listener(game_mouse_button_pressed, game); game_draw_field(game, 0.5, 0, 0); -- cgit v1.2.3