From 30c98bdd426e0421ea9b9b993e0eda4ddf16d07e Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 23 Feb 2020 16:48:23 +0100 Subject: life bar is fucked up but okok --- src/ft_draw_life_bar.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/ft_draw_life_bar.c') diff --git a/src/ft_draw_life_bar.c b/src/ft_draw_life_bar.c index ae02edb..bfe642b 100644 --- a/src/ft_draw_life_bar.c +++ b/src/ft_draw_life_bar.c @@ -2,15 +2,27 @@ #include void - ft_draw_life_bar(size_t map_w, uint16_t scale, int8_t life, t_cub *cl) + ft_draw_life_bar(size_t map_w, + const uint16_t scale, + const int8_t life, + t_cub *cl) { - (void)map_w; - (void)scale; - (void)life; - (void)cl; uint32_t x; uint32_t y; int32_t col; - col = 0x00229037; + (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++; + } } -- cgit v1.2.3