aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-14 18:09:33 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-14 18:09:33 +0100
commit05267f2bf7cbb6b7f05f65d63cc12bb9ca0d375a (patch)
treefbc37518f4a5ab7ae6309df52e39b9640c29dc20
parentNorme (diff)
download42-cub3d-05267f2bf7cbb6b7f05f65d63cc12bb9ca0d375a.tar.gz
42-cub3d-05267f2bf7cbb6b7f05f65d63cc12bb9ca0d375a.tar.bz2
42-cub3d-05267f2bf7cbb6b7f05f65d63cc12bb9ca0d375a.tar.xz
42-cub3d-05267f2bf7cbb6b7f05f65d63cc12bb9ca0d375a.tar.zst
42-cub3d-05267f2bf7cbb6b7f05f65d63cc12bb9ca0d375a.zip
Can't death hook
-rw-r--r--Makefile1
-rw-r--r--inc/cub3d.h1
-rw-r--r--src/ft_death_hooks.c26
-rw-r--r--src/ft_death_screen.c2
4 files changed, 29 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 751935f..a7ff053 100644
--- a/Makefile
+++ b/Makefile
@@ -95,6 +95,7 @@ SRCS_NAME += ft_sfx_death.c
SRCS_NAME += ft_sfx_trap.c
SRCS_NAME += ft_sfx_new_level.c
SRCS_NAME += ft_death_screen.c
+SRCS_NAME += ft_death_hooks.c
#--------------------------------------------------------------------------------------------------#
SRCS = $(addprefix ${SRCS_DIR},${SRCS_NAME})
#--------------------------------------------------------------------------------------------------#
diff --git a/inc/cub3d.h b/inc/cub3d.h
index 11f1a55..6c9a010 100644
--- a/inc/cub3d.h
+++ b/inc/cub3d.h
@@ -53,6 +53,7 @@ int ft_right_key(t_cub *clist);
int ft_click_close(int keycode, t_cub *clist);
int ft_key_loop(t_cub *cl);
int32_t ft_convert_keycode(const int32_t tmp_code);
+void ft_death_hooks(t_win *wl, t_cub *cl);
/*
** ====== TEXTURES ======
diff --git a/src/ft_death_hooks.c b/src/ft_death_hooks.c
new file mode 100644
index 0000000..ccf7741
--- /dev/null
+++ b/src/ft_death_hooks.c
@@ -0,0 +1,26 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_death_hooks.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/14 17:28:52 by rbousset #+# #+# */
+/* Updated: 2020/02/14 17:28:52 by rbousset ### ########lyon.fr */
+/* */
+/* ************************************************************************** */
+
+#include <libft.h>
+#include <cub3d.h>
+#include <mlx.h>
+
+void
+ ft_death_hooks(t_win *wl, t_cub *cl)
+{
+ /* mlx_hook(wl->winptr, 2, (1L << 0), ft_key_event, cl); */
+ /* mlx_hook(wl->winptr, 3, (1L << 1), ft_key_release, cl); */
+ /* mlx_loop_hook(wl->wlx, ft_key_loop, cl); */
+ /* mlx_hook(wl->winptr, 17, 0L, ft_click_close, cl); */
+ (void)cl;
+ (void)wl;
+}
diff --git a/src/ft_death_screen.c b/src/ft_death_screen.c
index de8bcc9..7afff98 100644
--- a/src/ft_death_screen.c
+++ b/src/ft_death_screen.c
@@ -71,7 +71,7 @@ void
ft_calc_death_screen(cl);
mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr,
cl->img.img, 0, 0);
- ft_hooks_and_loops(&cl->wlist, cl);
+ ft_death_hooks(&cl->wlist, cl);
sleep(8);
mlx_destroy_image(cl->wlist.wlx, cl->img.img);
mlx_destroy_image(cl->wlist.wlx, cl->death_screen.img);