blob: b800a399a2dc3336c61b05cb24dbea0a6d325af9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_key_loop.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/17 20:06:26 by rbousset #+# #+# */
/* Updated: 2020/02/17 20:06:29 by rbousset ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include <libft.h>
#include <cub3d.h>
#include <mlx.h>
#include <stdint.h>
#include <unistd.h>
void
ft_suffer_animation(t_cub *cl)
{
int32_t x;
int32_t y;
t_rgb rgb;
y = -1;
while (++y < (int32_t)cl->wlist.y_size)
{
x = -1;
while (++x < (int32_t)cl->wlist.x_size)
{
rgb = ft_hex_to_og_rgb(*(int*)(cl->img.ptr +
(x * 4 + (y * cl->img.sizeline))));
rgb.r += 150;
rgb.g += 20;
rgb.b += 20;
*(int*)(cl->img.ptr +
(x * 4 + (y * cl->img.sizeline))) = ft_rgb_to_hex(rgb);
}
}
cl->plist.life -= 20;
if (cl->plist.life <= 0)
ft_exit(0, cl);
/* TODO death screen here */
cl->doicast = 0;
}
|