diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-13 02:35:49 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-13 02:35:49 +0100 |
commit | 8d68891b9e6089cd29095c94d0a30f2a3ec0a2c7 (patch) | |
tree | 026b97aaa56ac87328d1fa7332872e86b1b15d32 /src/ft_suffer_animation.c | |
parent | Added sound effects files (diff) | |
download | 42-cub3d-8d68891b9e6089cd29095c94d0a30f2a3ec0a2c7.tar.gz 42-cub3d-8d68891b9e6089cd29095c94d0a30f2a3ec0a2c7.tar.bz2 42-cub3d-8d68891b9e6089cd29095c94d0a30f2a3ec0a2c7.tar.xz 42-cub3d-8d68891b9e6089cd29095c94d0a30f2a3ec0a2c7.tar.zst 42-cub3d-8d68891b9e6089cd29095c94d0a30f2a3ec0a2c7.zip |
Freed leaks
Diffstat (limited to 'src/ft_suffer_animation.c')
-rw-r--r-- | src/ft_suffer_animation.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/ft_suffer_animation.c b/src/ft_suffer_animation.c index bc8eb12..7df91cd 100644 --- a/src/ft_suffer_animation.c +++ b/src/ft_suffer_animation.c @@ -17,7 +17,36 @@ #include <unistd.h> void - ft_suffer_animation(t_cub *cl) + ft_linux_suffer_animation(t_cub *cl) +{ + int32_t x; + int32_t y; + + y = -1; + 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); + while (++y < (int32_t)cl->wlist.y_size) + { + x = -1; + while (++x < (int32_t)cl->wlist.x_size) + { + *(int*)(cl->img.ptr + + (x * 4 + (y * cl->img.sizeline))) = 0x00880404; + } + } + 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); + cl->plist.life -= 20; + if (cl->plist.life <= 0) + ft_warp_level(cl->mlist.filename, cl); + /* TODO death screen here */ +} + +void + ft_macos_suffer_animation(t_cub *cl) { int32_t x; int32_t y; |