/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_key_loop.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/17 20:06:26 by rbousset #+# #+# */ /* Updated: 2020/02/17 20:06:29 by rbousset ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include #include #include void ft_suffer_animation(t_cub *cl) { int32_t x; int32_t y; int8_t i; int32_t col; i = -1; col = 0x00ce2524; while (++i < 100) { cl->red_scr.img = mlx_new_image(cl->wlist.wlx, cl->wlist.x_size, cl->wlist.y_size); cl->red_scr.ptr = mlx_get_data_addr(cl->red_scr.img, &cl->red_scr.bpp, &cl->red_scr.sizeline, &cl->red_scr.endian); x = -1; y = -1; while (++y < (int32_t)cl->wlist.y_size) { while (++x < (int32_t)cl->wlist.x_size) *(int*)(cl->red_scr.ptr + (x * 4 + (y * cl->red_scr.sizeline))) = col; x = -1; } mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr, cl->red_scr.img, 0, 0); mlx_destroy_image(cl->wlist.wlx, cl->red_scr.img); } }