aboutsummaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-13 03:11:12 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-13 03:11:12 +0100
commita90c6f5cafbc47c7380d932d8db7bffd9b8b72bf (patch)
tree4e7044b92a3e97a338aaf769fe2b55d63e69338b /inc
parentRemoved beta minilibx make options (diff)
download42-cub3d-a90c6f5cafbc47c7380d932d8db7bffd9b8b72bf.tar.gz
42-cub3d-a90c6f5cafbc47c7380d932d8db7bffd9b8b72bf.tar.bz2
42-cub3d-a90c6f5cafbc47c7380d932d8db7bffd9b8b72bf.tar.xz
42-cub3d-a90c6f5cafbc47c7380d932d8db7bffd9b8b72bf.tar.zst
42-cub3d-a90c6f5cafbc47c7380d932d8db7bffd9b8b72bf.zip
sounds
Diffstat (limited to 'inc')
-rw-r--r--inc/cub3d.h1
-rw-r--r--inc/cub3d_defines.h24
-rw-r--r--inc/cub3d_structs.h1
3 files changed, 7 insertions, 19 deletions
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