aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_init_sfx.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-31 18:45:25 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-31 18:45:25 +0200
commitc12dc3125cda5599fcbadfe2492ef0015e8093f2 (patch)
tree90edcf38579ef621f75768c5ffecb4062a28257d /src/ft_init_sfx.c
parentAlright sounds (diff)
download42-cub3d-c12dc3125cda5599fcbadfe2492ef0015e8093f2.tar.gz
42-cub3d-c12dc3125cda5599fcbadfe2492ef0015e8093f2.tar.bz2
42-cub3d-c12dc3125cda5599fcbadfe2492ef0015e8093f2.tar.xz
42-cub3d-c12dc3125cda5599fcbadfe2492ef0015e8093f2.tar.zst
42-cub3d-c12dc3125cda5599fcbadfe2492ef0015e8093f2.zip
Better sound balance, now hardgimping
Diffstat (limited to '')
-rw-r--r--src/ft_init_sfx.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/ft_init_sfx.c b/src/ft_init_sfx.c
index 697f3f9..1725c91 100644
--- a/src/ft_init_sfx.c
+++ b/src/ft_init_sfx.c
@@ -101,11 +101,9 @@ static void
cl->sfx[15].sfx_play = ft_sfx_bb_fire;
}
-int8_t
- ft_init_sfx(t_cub *cl)
+static int8_t
+ ft_init_sfx_cmds(t_cub *cl)
{
- uint8_t i;
-
if (ft_init_sfx_cmd(&cl->sfx[0].cmd, FT_SFX_DEATH_PATH) < 0 ||
ft_init_sfx_cmd(&cl->sfx[1].cmd, FT_SFX_FS_ONE_PATH) < 0 ||
ft_init_sfx_cmd(&cl->sfx[1].cmd_alt, FT_SFX_FS_TWO_PATH) < 0 ||
@@ -126,6 +124,16 @@ int8_t
ft_init_sfx_cmd(&cl->sfx[14].cmd_alt, FT_SFX_ENMY_SCR_TWO_PATH) < 0 ||
ft_init_sfx_cmd(&cl->sfx[15].cmd, FT_SFX_ENMY_FIRE_PATH) < 0)
return (-1);
+ return (0);
+}
+
+int8_t
+ ft_init_sfx(t_cub *cl)
+{
+ uint8_t i;
+
+ if (ft_init_sfx_cmds(cl) < 0)
+ return (-1);
i = -1;
while (++i < 16)
pthread_mutex_init(&cl->sfx[i].mutex, NULL);