diff options
Diffstat (limited to 'src/ft_draw_hud.c')
-rw-r--r-- | src/ft_draw_hud.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/ft_draw_hud.c b/src/ft_draw_hud.c index fe73af8..4ae497a 100644 --- a/src/ft_draw_hud.c +++ b/src/ft_draw_hud.c @@ -10,7 +10,6 @@ /* */ /* ************************************************************************** */ -#include <libft.h> #include <cub3d.h> #include <mlx.h> #include <stdint.h> @@ -23,7 +22,7 @@ static void uint32_t y; int32_t col; - col = 0x00373737; + col = 0x00353535; x = 0; y = wl->y_size - (map_h * scl) - 20; while (x < (map_w * scl) + 20) @@ -44,11 +43,45 @@ static void } } +static void + ft_draw_stage_back(t_cub *clist) +{ + float x; + uint32_t y; + int32_t col; + uint16_t x_dest; + const uint16_t scl = clist->mlist.scale; + + col = 0x00353535; + x = 0; + y = clist->wlist.y_size - (clist->mlist.map_h * scl) - 45; + x_dest = 1.5 * clist->mlist.scale + 70; + while (x_dest > (clist->mlist.map_w * scl) + 20) + { + x_dest--; + } + while (x < x_dest) + { + while (y < clist->wlist.y_size - (clist->mlist.map_h * scl) - 20) + { + *(int*)(clist->img.ptr + + ((uint8_t)x * 4 + (y * clist->img.sizeline))) = col; + y++; + } + y = clist->wlist.y_size - (clist->mlist.map_h * scl) - 45; + x += 1.0; + } +} + int8_t ft_draw_hud(t_cub *clist) { ft_draw_minimap_back(clist->mlist.map_h, clist->mlist.map_w, &clist->wlist, clist); ft_draw_map(clist->mlist.map, clist); + if (clist->mlist.isnlvl) + { + ft_draw_stage_back(clist); + } return (0); } |