From a90c6f5cafbc47c7380d932d8db7bffd9b8b72bf Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 13 Mar 2020 03:11:12 +0100 Subject: sounds --- inc/cub3d.h | 1 + inc/cub3d_defines.h | 24 +++++------------------- inc/cub3d_structs.h | 1 + 3 files changed, 7 insertions(+), 19 deletions(-) (limited to 'inc') diff --git a/inc/cub3d.h b/inc/cub3d.h index a2d050c..b0f91fd 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -34,6 +34,7 @@ int8_t ft_init_map(t_map *mlist); t_bmp_file ft_init_bmp(void); t_bmp_info ft_init_bmp_info(void); t_rgb ft_hex_to_og_rgb(uint32_t color); +int8_t ft_init_sfx(t_sfx *sfx); /* ** ====== HOOKS ====== diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h index ab3a910..7257108 100644 --- a/inc/cub3d_defines.h +++ b/inc/cub3d_defines.h @@ -83,6 +83,11 @@ enum ** ====== SOUNDS ====== */ +# if FT_OS == 1 +# define FT_SND_CMD "/usr/bin/afplay --volume 0.2 %s" +# else +# define FT_SND_CMD "/usr/bin/aplay -f cd -t wav -q %s" +# endif # 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" @@ -90,25 +95,6 @@ enum # define FT_SFX_SCR_ONE_PATH "./media/sound/sfx/scream_one.wav" # define FT_SFX_SCR_TWO_PATH "./media/sound/sfx/scream_two.wav" # define FT_SFX_TRAP_PATH "./media/sound/sfx/trap.wav" -# if FT_OS == 1 -# define FT_MUS_CMD "/usr/bin/afplay --volume 0.2 %s" -# define FT_SFX_DEATH "/usr/bin/afplay --volume 0.2 ./media/sound/sfx/death_screen.wav" -# define FT_SFX_FS_ONE "/usr/bin/afplay --volume 0.2 ./media/sound/sfx/footstep_one.wav" -# define FT_SFX_FS_TWO "/usr/bin/afplay --volume 0.2 ./media/sound/sfx/footstep_two.wav" -# define FT_SFX_N_LVL "/usr/bin/afplay --volume 0.2 ./media/sound/sfx/next_lvl.wav" -# define FT_SFX_PAIN_ONE "/usr/bin/afplay --volume 0.2 ./media/sound/sfx/scream_one.wav" -# define FT_SFX_PAIN_TWO "/usr/bin/afplay --volume 0.2 ./media/sound/sfx/scream_two.wav" -# define FT_SFX_TRAP "/usr/bin/afplay --volume 0.2 ./media/sound/sfx/trap.wav" -# else -# define FT_MUS_CMD "/usr/bin/aplay -f cd -t wav -q %s" -# define FT_SFX_DEATH "/usr/bin/aplay -f cd -t wav -q ./media/sound/sfx/death_screen.wav" -# define FT_SFX_FS_ONE "/usr/bin/aplay -f cd -t wav -q ./media/sound/sfx/footstep_one.wav" -# define FT_SFX_FS_TWO "/usr/bin/aplay -f cd -t wav -q ./media/sound/sfx/footstep_two.wav" -# define FT_SFX_N_LVL "/usr/bin/aplay -f cd -t wav -q ./media/sound/sfx/next_lvl.wav" -# define FT_SFX_PAIN_ONE "/usr/bin/aplay -f cd -t wav -q ./media/sound/sfx/scream_one.wav" -# define FT_SFX_PAIN_TWO "/usr/bin/aplay -f cd -t wav -q ./media/sound/sfx/scream_two.wav" -# define FT_SFX_TRAP "/usr/bin/aplay -f cd -t wav -q ./media/sound/sfx/trap.wav" -# endif /* ** ====== MOVE SPEED ====== diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index d5b3bf7..b28c5ec 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -242,6 +242,7 @@ typedef struct s_cub struct s_img tlist[16]; struct s_sprite sprites[8][4096]; struct s_sprite traps[512]; + struct s_sfx sfx; } t_cub; # endif -- cgit v1.2.3