From eacffc0c11ab4096def852a4aae6950e3239212e Mon Sep 17 00:00:00 2001 From: _N3m0 Date: Fri, 15 Mar 2024 18:19:18 +0100 Subject: [PATCH] fix unclickable menu --- main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index c0cba96..d3fced3 100644 --- a/main.c +++ b/main.c @@ -271,7 +271,7 @@ int main(void) SetConfigFlags(FLAG_WINDOW_RESIZABLE); #ifdef RELEASE - SetTraceLogLevel(LOG_ERROR); + // SetTraceLogLevel(LOG_ERROR); #endif // RELEASE InitWindow(screen_width, screen_height, "mineur"); @@ -478,18 +478,18 @@ int main(void) } } - mouse_x = ((mouse_x - grid.x) / grid.width) * game_size.x; - mouse_y = ((mouse_y - grid.y) / grid.height) * game_size.y; + int mouse_map_x = ((mouse_x - grid.x) / grid.width) * game_size.x; + int mouse_map_y = ((mouse_y - grid.y) / grid.height) * game_size.y; if (need_to_fill && mouse_pressed) { - fill_game(mouse_x, mouse_y); + fill_game(mouse_map_x, mouse_map_y); need_to_fill = 0; } if (mouse_in_grid && game_state == PLAYING) { - discover[mouse_y][mouse_x] = 1; + discover[mouse_map_y][mouse_map_x] = 1; - zero_click(mouse_x, mouse_y); + zero_click(mouse_map_x, mouse_map_y); int count_undiscovered_cell = 0; for (int x=0; x