aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--map/lvl_one.cub4
-rw-r--r--src/ft_exit.c13
-rw-r--r--src/ft_music.c5
-rw-r--r--src/ft_treat_args.c2
-rw-r--r--src/ft_warp_level.c2
5 files changed, 7 insertions, 19 deletions
diff --git a/map/lvl_one.cub b/map/lvl_one.cub
index 0151dc4..ae0f78c 100644
--- a/map/lvl_one.cub
+++ b/map/lvl_one.cub
@@ -15,8 +15,8 @@ LT ./media/img/crapaud.xpm
MU ./media/sound/DEVANT-LES-KAISSONS.wav
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-1 1 1 1 1 1 1 1 1 1 1 1 L 0 0 0 0 1
+1 1 1 1 1 1 1 1 1 1 1 1 L 0 0 0 W 1
1 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 0 1
-1 E 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
+1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
diff --git a/src/ft_exit.c b/src/ft_exit.c
index 40860e7..a19bff3 100644
--- a/src/ft_exit.c
+++ b/src/ft_exit.c
@@ -43,9 +43,6 @@ static void
int
ft_exit(uint8_t exit_code, t_cub *clist)
{
- uint8_t ismus;
- pthread_t ttid;
-
if (clist->walltexgood)
{
if (clist->tlist[0].img)
@@ -66,14 +63,12 @@ int
mlx_destroy_window(clist->wlist->wlx, clist->wlist->winptr);
clist->wlist->winptr = NULL;
}
- ismus = clist->mlist->ismusic;
- ttid = clist->tid;
- ft_free_lists(clist);
- if (ismus)
+ if (clist->mlist->ismusic)
{
- pthread_cancel(ttid);
- pthread_join(ttid, NULL);
+ pthread_cancel(clist->tid);
+ pthread_join(clist->tid, NULL);
}
+ ft_free_lists(clist);
ft_printf("Exiting program\n");
exit(exit_code);
return (0);
diff --git a/src/ft_music.c b/src/ft_music.c
index 8006928..5eed915 100644
--- a/src/ft_music.c
+++ b/src/ft_music.c
@@ -26,8 +26,3 @@ void
system(cl->mlist->music_cmd);
return (NULL);
}
-
-/* void */
-/* *ft_hooks_thread(void *vargp) */
-/* { */
-/* } */
diff --git a/src/ft_treat_args.c b/src/ft_treat_args.c
index dab29ac..6f8ef87 100644
--- a/src/ft_treat_args.c
+++ b/src/ft_treat_args.c
@@ -38,9 +38,7 @@ uint8_t
return (ft_exit(FT_RET_FAILED_MLX, clist));
ft_draw_scene(clist);
if (clist->mlist->ismusic)
- {
pthread_create(&clist->tid, NULL, ft_music_thread, clist);
- }
ft_hooks_and_loops(clist->wlist, clist);
}
else if (argc == 3 && !ft_strncmp("--save", argv[2], 7))
diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c
index 866bd69..41d1a45 100644
--- a/src/ft_warp_level.c
+++ b/src/ft_warp_level.c
@@ -62,7 +62,7 @@ static void
if (cl->mlist->ismusic)
{
pthread_cancel(cl->tid);
- pthread_exit(NULL);
+ pthread_join(cl->tid, NULL);
}
}