diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-22 23:23:46 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-22 23:23:46 +0100 |
commit | 5947a6256086352dc96bd289a495ed81957302c9 (patch) | |
tree | d5ffb891ee65bc30b2098386094be4f31eac9203 /src/ft_draw_hud.c | |
parent | Secured weird screen size % 10 bug (diff) | |
download | 42-cub3d-5947a6256086352dc96bd289a495ed81957302c9.tar.gz 42-cub3d-5947a6256086352dc96bd289a495ed81957302c9.tar.bz2 42-cub3d-5947a6256086352dc96bd289a495ed81957302c9.tar.xz 42-cub3d-5947a6256086352dc96bd289a495ed81957302c9.tar.zst 42-cub3d-5947a6256086352dc96bd289a495ed81957302c9.zip |
Norme
Diffstat (limited to 'src/ft_draw_hud.c')
-rw-r--r-- | src/ft_draw_hud.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ft_draw_hud.c b/src/ft_draw_hud.c index 68cdac5..bd2bf37 100644 --- a/src/ft_draw_hud.c +++ b/src/ft_draw_hud.c @@ -37,7 +37,7 @@ static void } static void - ft_draw_hud_back_top(size_t map_h, size_t map_w, t_win *wl, t_cub *cl) + ft_draw_hud_back_top_r(size_t map_h, size_t map_w, t_win *wl, t_cub *cl) { const uint16_t scl = cl->mlist->scale; uint32_t x; @@ -56,7 +56,17 @@ static void y = wl->y_size - (map_h * scl) - 20; x++; } +} + +static void + ft_draw_hud_back_top_l(size_t map_h, size_t map_w, t_win *wl, t_cub *cl) +{ + const uint16_t scl = cl->mlist->scale; + uint32_t x; + uint32_t y; + x = wl->x_size - (map_w * scl) + 20; + y = wl->y_size - (map_h * scl) - 20; while (x < wl->x_size) { while (y < wl->y_size - (map_h * scl)) @@ -74,7 +84,9 @@ void ft_draw_hud(t_cub *clist) { ft_draw_hud_back(clist->wlist, clist); - ft_draw_hud_back_top(clist->mlist->map_h, + ft_draw_hud_back_top_r(clist->mlist->map_h, + clist->mlist->map_w, clist->wlist, clist); + ft_draw_hud_back_top_l(clist->mlist->map_h, clist->mlist->map_w, clist->wlist, clist); ft_draw_map(clist->mlist->map, clist); } |