aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_life_bar.c
blob: bfe642be578623b3b894ed548d74534b3cbebbce (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
#include <cub3d.h>
#include <stdint.h>

void
	ft_draw_life_bar(size_t map_w,
					const uint16_t scale,
					const int8_t life,
					t_cub *cl)
{
	uint32_t		x;
	uint32_t		y;
	int32_t			col;

	(void)life;
	col = 0x0022fa38;
	x = (map_w * scale) + (scale * 15);
	y = cl->wlist->y_size - (scale * 4);
	while (x < cl->wlist->x_size - (map_w * scale) - (scale  * 15))
	{
		while (y < cl->wlist->y_size - (scale * 2))
		{
			*(int*)(cl->img.ptr + (x * 4 + (y * cl->img.sizeline))) = col;
			y++;
		}
		y = cl->wlist->y_size - (scale * 4);
		x++;
	}
}