diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_suffer_animation.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/ft_suffer_animation.c b/src/ft_suffer_animation.c index 3d3595a..2a1beb4 100644 --- a/src/ft_suffer_animation.c +++ b/src/ft_suffer_animation.c @@ -14,6 +14,7 @@ #include <cub3d.h> #include <mlx.h> #include <stdint.h> +#include <unistd.h> void ft_suffer_animation(t_cub *cl) @@ -22,24 +23,22 @@ void int32_t y; int8_t i; - i = -1; - while (++i < 15) + /* 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); */ + y = -1; + while (++y < (int32_t)cl->wlist.y_size) { - 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))) = 0x00ce2524; - 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); + while (++x < (int32_t)cl->wlist.x_size) + *(int*)(cl->img.ptr + + (x * 4 + (y * cl->img.sizeline))) = 0x00ffffff; } + i = -1; + mlx_put_image_to_window(cl->wlist.wlx, + cl->wlist.winptr, cl->img.img, 0, 0); + sleep(5); + /* while (++i < 120) */ + /* mlx_destroy_image(cl->wlist.wlx, cl->red_scr.img); */ } |