aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_treat_args.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-02 00:56:03 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-02 00:56:03 +0100
commitd812df80d26f879d4d49ec45453866574e995839 (patch)
treed6c143d0356d72a4274dc125e354b4e51acf0f4b /src/ft_treat_args.c
parentin progress (diff)
download42-cub3d-d812df80d26f879d4d49ec45453866574e995839.tar.gz
42-cub3d-d812df80d26f879d4d49ec45453866574e995839.tar.bz2
42-cub3d-d812df80d26f879d4d49ec45453866574e995839.tar.xz
42-cub3d-d812df80d26f879d4d49ec45453866574e995839.tar.zst
42-cub3d-d812df80d26f879d4d49ec45453866574e995839.zip
trying to thread
Diffstat (limited to 'src/ft_treat_args.c')
-rw-r--r--src/ft_treat_args.c10
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))