From 72869a4220ab321fd893e93fbec4532aa3892f8f Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 21 May 2021 21:08:30 +0200 Subject: GUI improvements and leak reduction --- apps/chess/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'apps/chess') diff --git a/apps/chess/main.c b/apps/chess/main.c index e5a8799..b0da8d1 100644 --- a/apps/chess/main.c +++ b/apps/chess/main.c @@ -68,14 +68,12 @@ static void load_image(struct piece *tile) icon); } -static void mouseclick(u32 widget_id, vec2 pos) +static void mouseclick(struct gui_event_mouse *event) { - UNUSED(pos); - vec2 clicked = vec2(0, 0); for (u32 x = 0; x < SIZE; x++) for (u32 y = 0; y < SIZE; y++) - if (tiles[x][y].widget == widget_id) + if (tiles[x][y].widget == event->widget) clicked = vec2(x, y); struct piece *clicked_piece = &tiles[clicked.x][clicked.y]; -- cgit v1.2.3