aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_hud.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_draw_hud.c')
-rw-r--r--src/ft_draw_hud.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/ft_draw_hud.c b/src/ft_draw_hud.c
index 486112d..eb329c6 100644
--- a/src/ft_draw_hud.c
+++ b/src/ft_draw_hud.c
@@ -11,10 +11,38 @@
/* ************************************************************************** */
#include <cub3d.h>
-#include <mlx.h>
#include <stdint.h>
static void
+ ft_draw_life_back(t_win *wl, t_cub *cl)
+{
+ const uint16_t scl = cl->mlist.scale;
+ uint32_t x;
+ uint32_t y;
+ int32_t col;
+
+ col = 0x00353535;
+ x = (cl->mlist.map_w * scl) + 20;
+ y = wl->y_size - (cl->mlist.map_h * scl) - 20;
+ while (x < ((cl->mlist.map_w * scl) + 20) + (3 * scl))
+ {
+ while (y < wl->y_size)
+ {
+ *(int*)(cl->img.ptr + (x * 4 + (y * cl->img.sizeline))) = col;
+ if (!(y % 3))
+ {
+ if (col < 0x00aaaaaa)
+ col += 0x00010101;
+ }
+ y++;
+ }
+ col = 0x00353535;
+ y = wl->y_size - (cl->mlist.map_h * scl) - 20;
+ x++;
+ }
+}
+
+static void
ft_draw_minimap_back(size_t map_h, size_t map_w, t_win *wl, t_cub *cl)
{
const uint16_t scl = cl->mlist.scale;
@@ -79,6 +107,8 @@ int8_t
ft_draw_minimap_back(clist->mlist.map_h,
clist->mlist.map_w, &clist->wlist, clist);
ft_draw_map(clist->mlist.map, clist);
+ ft_draw_life_back(&clist->wlist, clist);
+ ft_draw_life_bar(&clist->wlist, clist);
if (clist->mlist.isnlvl)
{
ft_draw_stage_back(clist);