From 9f35e7fab50809cd74e3bfffff67a81023abc837 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 15 Mar 2020 01:02:32 +0100 Subject: I need a macOS --- inc/cub3d_structs.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'inc') diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index 7545f3b..aaf8498 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -14,9 +14,9 @@ # define CUB3D_STRUCTS_H #include -#include #include #include +#include typedef struct s_win { @@ -189,7 +189,6 @@ typedef struct s_map char *mapl; char **sprite_path; char **map; - char **mcmd_words; int8_t x_step; int8_t y_step; size_t map_w; @@ -230,7 +229,7 @@ typedef struct s_cub char *const *envp; char errmsg[64]; int32_t key_input[5]; - pid_t mpid; + pthread_t mtid; int (*key_ptr[6])(struct s_cub*); int8_t (*get_ptr[14])(char**, struct s_cub*); char ref[22][3]; -- cgit v1.2.3 From b992ca41965edf663f99bae19a95d59f2fd1ed97 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 15 Mar 2020 02:15:01 +0100 Subject: okok --- inc/cub3d.h | 4 +++- inc/cub3d_structs.h | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'inc') diff --git a/inc/cub3d.h b/inc/cub3d.h index 6c9a010..a2c2aba 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -150,8 +150,10 @@ void ft_floor_cast_inits(uint16_t y, t_ray *rl, t_cub *cl); */ void ft_sfx_death(t_cub *cl); -void ft_sfx_trap(t_cub *cl); void ft_sfx_new_level(t_cub *cl); +void ft_sfx_pain(t_cub *cl); +void ft_sfx_trap(t_cub *cl); +void *ft_sfx_pain_thread(void *vargp); /* ** ====== OTHER ====== diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index aaf8498..01c9b07 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -59,13 +59,14 @@ typedef struct s_sfx { char **death; char **new_lvl; - char **pain_one; - char **pain_two; + char *pain_one; + char *pain_two; char **trap; pid_t death_pid; pid_t new_lvl_pid; - pid_t pain_pid; + pthread_t pain_tid; pid_t trap_pid; + pthread_mutex_t pain_mutex; } t_sfx; typedef struct s_bmp_rgb -- cgit v1.2.3 From e22ae5588bf27756fe157f0bab363478136f3030 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 15 Mar 2020 02:17:56 +0100 Subject: Character is now FAT --- inc/cub3d_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h index c931b2d..d4979a7 100644 --- a/inc/cub3d_defines.h +++ b/inc/cub3d_defines.h @@ -114,7 +114,7 @@ enum ** ====== COLLISION ====== */ -# define FT_COLL_MULT 0.225 +# define FT_COLL_MULT 0.3 /* ** ====== SCREEN ====== -- cgit v1.2.3 From bcbe3db5345f86fcacb039039382f3130c933eea Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 15 Mar 2020 14:26:29 +0100 Subject: Sounds have been threaded --- inc/cub3d.h | 3 +++ inc/cub3d_structs.h | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'inc') diff --git a/inc/cub3d.h b/inc/cub3d.h index a2c2aba..6905688 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -153,7 +153,10 @@ void ft_sfx_death(t_cub *cl); void ft_sfx_new_level(t_cub *cl); void ft_sfx_pain(t_cub *cl); void ft_sfx_trap(t_cub *cl); +void *ft_sfx_new_lvl_thread(void *vargp); +void *ft_sfx_death_thread(void *vargp); void *ft_sfx_pain_thread(void *vargp); +void *ft_sfx_trap_thread(void *vargp); /* ** ====== OTHER ====== diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index 01c9b07..473fe9f 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -57,16 +57,19 @@ typedef struct s_bmp_info typedef struct s_sfx { - char **death; - char **new_lvl; + char *death; + char *new_lvl; char *pain_one; char *pain_two; - char **trap; - pid_t death_pid; - pid_t new_lvl_pid; + char *trap; + pthread_t death_tid; + pthread_t new_lvl_tid; pthread_t pain_tid; - pid_t trap_pid; + pthread_t trap_tid; + pthread_mutex_t death_mutex; + pthread_mutex_t new_lvl_mutex; pthread_mutex_t pain_mutex; + pthread_mutex_t trap_mutex; } t_sfx; typedef struct s_bmp_rgb -- cgit v1.2.3 From 163bed0c8988ff020b746bf96dc01dd2058dc4f9 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 15 Mar 2020 15:09:59 +0100 Subject: Footsteps are bav --- inc/cub3d.h | 4 +++- inc/cub3d_defines.h | 2 ++ inc/cub3d_structs.h | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/cub3d.h b/inc/cub3d.h index 6905688..aafe288 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -150,11 +150,13 @@ void ft_floor_cast_inits(uint16_t y, t_ray *rl, t_cub *cl); */ void ft_sfx_death(t_cub *cl); +void ft_sfx_footstep(t_cub *cl); void ft_sfx_new_level(t_cub *cl); void ft_sfx_pain(t_cub *cl); void ft_sfx_trap(t_cub *cl); -void *ft_sfx_new_lvl_thread(void *vargp); void *ft_sfx_death_thread(void *vargp); +void *ft_sfx_footstep_thread(void *vargp); +void *ft_sfx_new_lvl_thread(void *vargp); void *ft_sfx_pain_thread(void *vargp); void *ft_sfx_trap_thread(void *vargp); diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h index d4979a7..286dbef 100644 --- a/inc/cub3d_defines.h +++ b/inc/cub3d_defines.h @@ -86,6 +86,8 @@ enum */ # define FT_SFX_DEATH_PATH "./media/sound/sfx/death_screen.wav" +# define FT_SFX_FS_ONE_PATH "./media/sound/sfx/footstep_one.wav" +# define FT_SFX_FS_TWO_PATH "./media/sound/sfx/footstep_two.wav" # define FT_SFX_N_LVL_PATH "./media/sound/sfx/next_lvl.wav" # define FT_SFX_SCR_ONE_PATH "./media/sound/sfx/scream_one.wav" # define FT_SFX_SCR_TWO_PATH "./media/sound/sfx/scream_two.wav" diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index 473fe9f..2d1d00d 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -58,15 +58,19 @@ typedef struct s_bmp_info typedef struct s_sfx { char *death; + char *footstep_one; + char *footstep_two; char *new_lvl; char *pain_one; char *pain_two; char *trap; pthread_t death_tid; + pthread_t footstep_tid; pthread_t new_lvl_tid; pthread_t pain_tid; pthread_t trap_tid; pthread_mutex_t death_mutex; + pthread_mutex_t footstep_mutex; pthread_mutex_t new_lvl_mutex; pthread_mutex_t pain_mutex; pthread_mutex_t trap_mutex; -- cgit v1.2.3