From 17906f353bb6e87528f552891d7d4c91bb3ac789 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Wed, 11 Mar 2020 14:38:52 +0100 Subject: why macos --- inc/cub3d_structs.h | 1 + map/lvl_one.cub | 2 +- map/map_one.cub | 4 ++-- src/ft_suffer_animation.c | 43 ++++++++++++++++++++----------------------- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index 7665e96..310ba90 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -222,6 +222,7 @@ typedef struct s_cub struct s_map mlist; struct s_ray rlist; struct s_img img; + struct s_img red_scr; struct s_rgb f_rgb; struct s_rgb c_rgb; struct s_img tlist[16]; diff --git a/map/lvl_one.cub b/map/lvl_one.cub index 2c52287..d0ce0a2 100644 --- a/map/lvl_one.cub +++ b/map/lvl_one.cub @@ -1,4 +1,4 @@ -R 1440 1000 +R 1600 1000 NO ./media/img/BRIQUASSE_3.xpm SO ./media/img/BRIQUASSE_3.xpm diff --git a/map/map_one.cub b/map/map_one.cub index 0b0cbd5..285fbf0 100644 --- a/map/map_one.cub +++ b/map/map_one.cub @@ -14,7 +14,7 @@ SH 4 111111111111111111 120000000011000001 -10010E000000000201 +100100000000000201 101100000111000001 111111111111110011 1000001 100001 @@ -23,7 +23,7 @@ SH 4 111101111111110111 110000001101010111 100020T00000000011 -100000T00000000011 +100000T00000W00011 110000T01101010111 111101111111010111 11111 1 1111 diff --git a/src/ft_suffer_animation.c b/src/ft_suffer_animation.c index 4e77ca7..a2ce3b1 100644 --- a/src/ft_suffer_animation.c +++ b/src/ft_suffer_animation.c @@ -18,33 +18,30 @@ void ft_suffer_animation(t_cub *cl) { - uint16_t x; - uint16_t y; - uint8_t i; + int32_t x; + int32_t y; + int8_t i; + int32_t col; - i = 0; - while (i < 8) + i = -1; + col = 0x00ce2524; + while (++i < 100) { - 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); - x = 0; - y = 0; - while (y < 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 < cl->wlist.x_size) - { - *(int*)(cl->img.ptr + - (x * 4 + (y * cl->img.sizeline))) = 0x00ce1212; - x++; - } - x = 0; - y++; + 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->img.img, 0, 0); - mlx_destroy_image(cl->wlist.wlx, cl->img.img); - i++; + cl->wlist.winptr, cl->red_scr.img, 0, 0); + mlx_destroy_image(cl->wlist.wlx, cl->red_scr.img); } } -- cgit v1.2.3