diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_treat_args.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ft_treat_args.c b/src/ft_treat_args.c index aee2776..cc1391a 100644 --- a/src/ft_treat_args.c +++ b/src/ft_treat_args.c @@ -12,7 +12,9 @@ #include <libft.h> #include <cub3d.h> +#include <stddef.h> #include <stdint.h> +#include <pthread.h> #include <unistd.h> uint8_t @@ -30,12 +32,18 @@ uint8_t uint8_t ft_use_args(int argc, const char *argv[], t_cub *clist) { + pthread_t tid; + if (argc < 3) { if (ft_init_winptr(clist) < 0) return (ft_exit(FT_RET_FAILED_MLX, clist)); ft_draw_scene(clist); - /* ft_music(clist); */ + if (clist->mlist->ismusic) + { + pthread_create(&tid, NULL, ft_music, clist); + pthread_join(tid, NULL); + } ft_hooks_and_loops(clist->wlist, clist); } else if (argc == 3 && !ft_strncmp("--save", argv[2], 7)) |