aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_suffer_animation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_suffer_animation.c')
-rw-r--r--src/ft_suffer_animation.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/ft_suffer_animation.c b/src/ft_suffer_animation.c
index bb69b4b..4e77ca7 100644
--- a/src/ft_suffer_animation.c
+++ b/src/ft_suffer_animation.c
@@ -20,25 +20,31 @@ void
{
uint16_t x;
uint16_t y;
+ uint8_t i;
- 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)
+ i = 0;
+ while (i < 8)
{
- while (x < cl->wlist.x_size)
+ 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)
{
- *(int*)(cl->img.ptr +
- (x * 4 + (y * cl->img.sizeline))) = 0x00ce1212;
- x++;
+ while (x < cl->wlist.x_size)
+ {
+ *(int*)(cl->img.ptr +
+ (x * 4 + (y * cl->img.sizeline))) = 0x00ce1212;
+ x++;
+ }
+ x = 0;
+ y++;
}
- x = 0;
- y++;
+ 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++;
}
- 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);
}