From 93594e31acfa50fdcb93d7dad7233c71f6222471 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 22 Mar 2020 14:20:24 +0100 Subject: Removed bloat --- src/ft_check_missing_sfx.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/ft_check_missing_sfx.c (limited to 'src/ft_check_missing_sfx.c') diff --git a/src/ft_check_missing_sfx.c b/src/ft_check_missing_sfx.c new file mode 100644 index 0000000..f8a32b1 --- /dev/null +++ b/src/ft_check_missing_sfx.c @@ -0,0 +1,56 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_check_missing_sfx.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:28:42 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:28:42 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include + +static int + ft_check_missing_weapon_sfx(t_cub *clist) +{ + if (ft_check_not_found(FT_SFX_W_ONE_LOAD_PATH) < 0 || + ft_check_ext(FT_SFX_W_ONE_LOAD_PATH, ".wav") < 0) + return (ft_missing_error(FT_ERR_MISS_SFX_W_ONE_LOAD, clist)); + if (ft_check_not_found(FT_SFX_W_ONE_FIRE_PATH) < 0 || + ft_check_ext(FT_SFX_W_ONE_FIRE_PATH, ".wav") < 0) + return (ft_missing_error(FT_ERR_MISS_SFX_W_ONE_FIRE, clist)); + if (ft_check_not_found(FT_SFX_W_TWO_LOAD_PATH) < 0 || + ft_check_ext(FT_SFX_W_TWO_LOAD_PATH, ".wav") < 0) + return (ft_missing_error(FT_ERR_MISS_SFX_W_TWO_LOAD, clist)); + if (ft_check_not_found(FT_SFX_W_TWO_FIRE_PATH) < 0 || + ft_check_ext(FT_SFX_W_TWO_FIRE_PATH, ".wav") < 0) + return (ft_missing_error(FT_ERR_MISS_SFX_W_TWO_FIRE, clist)); + return (0); +} + +int + ft_check_missing_sfx(t_cub *clist) +{ + if (ft_check_not_found(FT_SFX_DEATH_PATH) < 0 || + ft_check_ext(FT_SFX_DEATH_PATH, ".wav") < 0) + return (ft_missing_error(FT_ERR_MISS_SFX_DEATH, clist)); + if (ft_check_not_found(FT_SFX_N_LVL_PATH) < 0 || + ft_check_ext(FT_SFX_N_LVL_PATH, ".wav") < 0) + return (ft_missing_error(FT_ERR_MISS_SFX_N_LVL, clist)); + if (ft_check_not_found(FT_SFX_SCR_ONE_PATH) < 0 || + ft_check_ext(FT_SFX_SCR_ONE_PATH, ".wav") < 0) + return (ft_missing_error(FT_ERR_MISS_SFX_SCR_ONE, clist)); + if (ft_check_not_found(FT_SFX_SCR_TWO_PATH) < 0 || + ft_check_ext(FT_SFX_SCR_TWO_PATH, ".wav") < 0) + return (ft_missing_error(FT_ERR_MISS_SFX_SCR_TWO, clist)); + if (ft_check_not_found(FT_SFX_TRAP_PATH) < 0 || + ft_check_ext(FT_SFX_TRAP_PATH, ".wav") < 0) + return (ft_missing_error(FT_ERR_MISS_SFX_TRAP, clist)); + if (ft_check_not_found(FT_SFX_HEAL_PATH) < 0 || + ft_check_ext(FT_SFX_HEAL_PATH, ".wav") < 0) + return (ft_missing_error(FT_ERR_MISS_SFX_HEAL, clist)); + return (ft_check_missing_weapon_sfx(clist)); +} -- cgit v1.2.3