summaryrefslogtreecommitdiff
path: root/src/main/game
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-21 18:15:12 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-21 18:15:12 +0200
commit1855ae04c490270d9b255df7a082528b1e4922cf (patch)
treef13fa94859bc3c8719e2090ff3b9b2384ff43630 /src/main/game
parent0e8e745f88617fe5933eb7981198ac24cb7b1ee4 (diff)
downloadtris-1855ae04c490270d9b255df7a082528b1e4922cf.tar.gz
tris-1855ae04c490270d9b255df7a082528b1e4922cf.zip
Add logic to get the game in mouse button pressed event
Diffstat (limited to 'src/main/game')
-rw-r--r--src/main/game/game.c4
1 files changed, 2 insertions, 2 deletions
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);