fix: key autorepeat on at program end *
This commit is contained in:
parent
e37b38b1ca
commit
bdb258f6b2
3 changed files with 5 additions and 5 deletions
|
@ -7,4 +7,3 @@
|
|||
- walls all around
|
||||
- a possible way to exit
|
||||
- Program takes the map file
|
||||
- Re-enable repeating keys at end of program
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/26 16:05:21 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/02 17:56:31 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/09 14:16:15 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -14,6 +14,8 @@
|
|||
|
||||
static void end(int no)
|
||||
{
|
||||
if (g_env.mlx)
|
||||
mlx_do_key_autorepeaton(g_env.mlx);
|
||||
display_destroyall();
|
||||
mem_freeall(g_env.mc);
|
||||
exit(no);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/26 15:28:34 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/08 17:18:03 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/04/09 14:16:56 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -20,7 +20,6 @@ int expose_hook(void)
|
|||
|
||||
int close_hook(void)
|
||||
{
|
||||
mlx_do_key_autorepeaton(g_env.mlx);
|
||||
success();
|
||||
return (0);
|
||||
}
|
||||
|
@ -44,10 +43,10 @@ int main(void)
|
|||
{
|
||||
g_env.max_ketchup = 0;
|
||||
g_env.moves = 0;
|
||||
g_env.mc = mem_newclass(error_err);
|
||||
g_env.mlx = mlx_init();
|
||||
if (!g_env.mlx)
|
||||
error_err("mlx_init() failed");
|
||||
g_env.mc = mem_newclass(error_err);
|
||||
display_init();
|
||||
g_env.win = mlx_new_window(g_env.mlx, WINDOW_WIDTH, WINDOW_HEIGHT,
|
||||
WINDOW_TITLE);
|
||||
|
|
Loading…
Add table
Reference in a new issue