diff options
Diffstat (limited to 'src/ft_draw_hud.c')
-rw-r--r-- | src/ft_draw_hud.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/ft_draw_hud.c b/src/ft_draw_hud.c index a10b2f3..ca553f0 100644 --- a/src/ft_draw_hud.c +++ b/src/ft_draw_hud.c @@ -12,6 +12,7 @@ #include <cub3d.h> #include <stdint.h> +#include <pthread.h> static void ft_draw_stage_back(t_cub *clist) @@ -44,13 +45,22 @@ static void int8_t ft_draw_hud(t_cub *clist) { - ft_draw_ammo_back(clist); - ft_draw_minimap_back(clist); - ft_draw_map(clist->mlist.map, clist); - ft_draw_life_bar(clist); - ft_draw_ammo_bar(clist); - ft_draw_health_caption(clist); - ft_draw_ammo_caption(clist); + pthread_t tid[7]; + + pthread_create(&tid[0], 0x0, ft_ammo_back_thread, (void*)clist); + pthread_create(&tid[1], 0x0, ft_minimap_back_thread, (void*)clist); + pthread_join(tid[0], 0x0); + pthread_join(tid[1], 0x0); + pthread_create(&tid[2], 0x0, ft_map_thread, (void*)clist); + pthread_create(&tid[3], 0x0, ft_life_bar_thread, (void*)clist); + pthread_create(&tid[4], 0x0, ft_ammo_bar_thread, (void*)clist); + pthread_create(&tid[5], 0x0, ft_health_cap_thread, (void*)clist); + pthread_create(&tid[6], 0x0, ft_ammo_cap_thread, (void*)clist); + pthread_join(tid[2], 0x0); + pthread_join(tid[3], 0x0); + pthread_join(tid[4], 0x0); + pthread_join(tid[5], 0x0); + pthread_join(tid[6], 0x0); if (clist->mlist.isnlvl) { ft_draw_stage_back(clist); |