From 16092c007e8767b32c107d74d3ea3d238f5e65ec Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 18:10:14 +0100 Subject: Preparing forks --- inc/cub3d_structs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index c74a9e0..7e49e14 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -177,7 +177,7 @@ typedef struct s_cub uint16_t i; char errmsg[64]; int32_t key_input[5]; - pthread_t tid; + pid_t mpid; int (*key_ptr[6])(struct s_cub*); int8_t (*get_ptr[11])(char**, struct s_cub*); struct s_win wlist; -- cgit v1.2.3 From a35b258841cde7884f5bb71d5ae0951d5e3f27b7 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 19:03:24 +0100 Subject: fork(3) going well, freed a leak --- inc/cub3d.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/cub3d.h b/inc/cub3d.h index 7b57942..ea55faf 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -119,7 +119,7 @@ uint8_t ft_use_args(int argc, const char *argv[], t_cub *clist); */ void ft_set_minimap_scale(t_cub *clist); -void *ft_music_thread(void *vargp); +void ft_music_fork(char *music_cmd); void ft_detect(t_cub *cl); void ft_castray(t_cub *cl); int8_t ft_save_to_bmp(t_cub *cl); -- cgit v1.2.3 From 6a89966eed6110d0e7a7ec53727c4473d18ad441 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 20:43:42 +0100 Subject: Fuck execve --- inc/cub3d.h | 2 +- inc/cub3d_structs.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/cub3d.h b/inc/cub3d.h index ea55faf..ef05364 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -119,7 +119,7 @@ uint8_t ft_use_args(int argc, const char *argv[], t_cub *clist); */ void ft_set_minimap_scale(t_cub *clist); -void ft_music_fork(char *music_cmd); +void ft_music_fork(char **mcmd_words); void ft_detect(t_cub *cl); void ft_castray(t_cub *cl); int8_t ft_save_to_bmp(t_cub *cl); diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index 7e49e14..d253b7b 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -152,6 +152,7 @@ typedef struct s_map char *music_cmd; char *mapl; char **map; + char **mcmd_words; int8_t x_step; int8_t y_step; size_t map_w; -- cgit v1.2.3 From 874d8d3bbafb3d1919cfc6f21fdb780382f0d015 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 21:03:07 +0100 Subject: boy --- inc/cub3d.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/cub3d.h b/inc/cub3d.h index ef05364..b552b38 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -112,14 +112,15 @@ size_t ft_get_line_len(char *line); */ uint8_t ft_check_map_arg(int argc, const char *argv[]); -uint8_t ft_use_args(int argc, const char *argv[], t_cub *clist); +uint8_t ft_use_args(int argc, const char *argv[], + char *const envp[], t_cub *clist); /* ** ====== OTHER ====== */ void ft_set_minimap_scale(t_cub *clist); -void ft_music_fork(char **mcmd_words); +void ft_music_fork(char **mcmd_words, char *const envp[]); void ft_detect(t_cub *cl); void ft_castray(t_cub *cl); int8_t ft_save_to_bmp(t_cub *cl); -- cgit v1.2.3 From 3048aae5d3f50359f19e0d440376ae422a16a7b7 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 21:47:09 +0100 Subject: Good enough --- inc/cub3d.h | 1 + inc/cub3d_structs.h | 1 + 2 files changed, 2 insertions(+) (limited to 'inc') diff --git a/inc/cub3d.h b/inc/cub3d.h index b552b38..6078801 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -120,6 +120,7 @@ uint8_t ft_use_args(int argc, const char *argv[], */ void ft_set_minimap_scale(t_cub *clist); +void ft_enable_music(t_cub *cl); void ft_music_fork(char **mcmd_words, char *const envp[]); void ft_detect(t_cub *cl); void ft_castray(t_cub *cl); diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index d253b7b..d53cdb9 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -176,6 +176,7 @@ typedef struct s_cub uint8_t isoldmus; uint16_t currlvl; uint16_t i; + char *const *envp; char errmsg[64]; int32_t key_input[5]; pid_t mpid; -- cgit v1.2.3 From d68996487117fee33bd6301f66c06611e57f0c71 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 6 Mar 2020 22:08:37 +0100 Subject: okok --- inc/cub3d_defines.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h index fb50474..1153225 100644 --- a/inc/cub3d_defines.h +++ b/inc/cub3d_defines.h @@ -83,9 +83,9 @@ enum */ # if FT_OS == 1 -# define FT_MUS_CMD "afplay --volume 0.2 %s" +# define FT_MUS_CMD "/usr/bin/afplay --volume 0.2 %s" # else -# define FT_MUS_CMD "aplay -f cd -t wav -q %s" +# define FT_MUS_CMD "/usr/bin/aplay -f cd -t wav -q %s" # endif /* -- cgit v1.2.3