From 6f505e5f2144f637a5a73916da3b3b3719751003 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sat, 14 Mar 2020 17:31:33 +0100 Subject: Trying death screen --- src/ft_death_screen.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/ft_death_screen.c (limited to 'src/ft_death_screen.c') diff --git a/src/ft_death_screen.c b/src/ft_death_screen.c new file mode 100644 index 0000000..80ba23c --- /dev/null +++ b/src/ft_death_screen.c @@ -0,0 +1,59 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_death_screen.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:20:05 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:20:06 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include +#include +#include + +static void + ft_draw_death_screen(t_cub *cl) +{ + uint16_t x; + uint16_t y; + + x = 0; + y = 0; + while (x < cl->wlist.x_size) + { + while (y < cl->wlist.y_size) + { + /* cl->death_screen.tex_x = ; */ + /* cl->death_screen.tex_y = ; */ + x++; + } + x = 0; + y++; + } +} + +void + ft_death_screen(t_cub *cl) +{ + cl->death_screen.img = mlx_xpm_file_to_image(cl->wlist.wlx, + FT_DEATH_SCREEN_PATH, &cl->death_screen.img_w, &cl->death_screen.img_h); + cl->death_screen.ptr = mlx_get_data_addr(cl->death_screen.img, + &cl->death_screen.bpp, &cl->death_screen.sizeline, + &cl->death_screen.endian); + cl->img.img = mlx_new_image(cl->wlist.wlx, + cl->wlist.x_size, cl->wlist.y_size); + cl->img.ptr = mlx_get_data_addr(cl->img.img, &cl->img.bpp, + &cl->img.sizeline, &cl->img.endian); + ft_draw_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); + mlx_destroy_image(cl->wlist.wlx, cl->img.img); + mlx_destroy_image(cl->wlist.wlx, cl->death_screen.img); + while (1) + sleep(4); +} -- cgit v1.2.3