aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_suffer_animation.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-03-11 14:38:52 +0100
committerRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-03-11 14:38:52 +0100
commit17906f353bb6e87528f552891d7d4c91bb3ac789 (patch)
tree402560ff18ab6e559662397e7205ce4f83994515 /src/ft_suffer_animation.c
parentTweaked suff animation (diff)
download42-cub3d-17906f353bb6e87528f552891d7d4c91bb3ac789.tar.gz
42-cub3d-17906f353bb6e87528f552891d7d4c91bb3ac789.tar.bz2
42-cub3d-17906f353bb6e87528f552891d7d4c91bb3ac789.tar.xz
42-cub3d-17906f353bb6e87528f552891d7d4c91bb3ac789.tar.zst
42-cub3d-17906f353bb6e87528f552891d7d4c91bb3ac789.zip
why macos
Diffstat (limited to 'src/ft_suffer_animation.c')
-rw-r--r--src/ft_suffer_animation.c43
1 files changed, 20 insertions, 23 deletions
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);
}
}