aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_key_events.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-02-09 14:55:43 +0100
committerRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-02-09 14:55:43 +0100
commit7768d43410b72815c241b74e46476a4896f12b41 (patch)
tree4af3ea7bc2dd203040fb1e8d543506c9d5d90332 /src/ft_key_events.c
parentNorme (diff)
download42-cub3d-7768d43410b72815c241b74e46476a4896f12b41.tar.gz
42-cub3d-7768d43410b72815c241b74e46476a4896f12b41.tar.bz2
42-cub3d-7768d43410b72815c241b74e46476a4896f12b41.tar.xz
42-cub3d-7768d43410b72815c241b74e46476a4896f12b41.tar.zst
42-cub3d-7768d43410b72815c241b74e46476a4896f12b41.zip
Smooth
Diffstat (limited to 'src/ft_key_events.c')
-rw-r--r--src/ft_key_events.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ft_key_events.c b/src/ft_key_events.c
index 1b4b738..168d6c0 100644
--- a/src/ft_key_events.c
+++ b/src/ft_key_events.c
@@ -76,7 +76,7 @@ static int
}
int
- ft_key_event(int keycode, void *param)
+ ft_key_event(int keycode, t_cub *clist)
{
int (*fun_ptr[4])(t_cub*);
const int8_t tmp_code = keycode;
@@ -90,8 +90,9 @@ int
(tmp_code == FT_A_KEY) ? (keycode = 1) : 0;
(tmp_code == FT_S_KEY) ? (keycode = 2) : 0;
(tmp_code == FT_D_KEY) ? (keycode = 3) : 0;
- (keycode <= 3) ? ((*fun_ptr[keycode])((t_cub*)param)) : 0;
+ if (keycode <= 3)
+ return (*fun_ptr[keycode])(clist);
if (keycode == FT_ESC_KEY)
- ft_exit(0, ((t_cub*)param));
+ return (ft_exit(0, (clist)));
return (0);
}