/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_check_missing_defines.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_other_number_defines(t_cub *clist) { if (ft_check_not_found(FT_INF_PATH) < 0 || ft_check_ext(FT_INF_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_NUMBER, clist)); if (ft_check_not_found(FT_CAP_HEALTH_PATH) < 0 || ft_check_ext(FT_CAP_HEALTH_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_H_CAPTION, clist)); if (ft_check_not_found(FT_CAP_AMMO_PATH) < 0 || ft_check_ext(FT_CAP_AMMO_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_A_CAPTION, clist)); if (clist->mlist.enemy == 1) { if (ft_check_not_found(FT_HEAL_PACK_PATH) < 0 || ft_check_ext(FT_HEAL_PACK_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_HEAL_PACK, clist)); } else { if (ft_check_not_found(FT_HEAL_PACK_PATH) < 0 || ft_check_ext(FT_HEAL_PACK_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_HEAL_PACK, clist)); } return (ft_check_missing_sfx(clist)); } static int ft_check_missing_number_defines(t_cub *clist) { if (ft_check_not_found(FT_ZER_PATH) < 0 || ft_check_ext(FT_ZER_PATH, ".xpm") < 0 || ft_check_not_found(FT_ONE_PATH) < 0 || ft_check_ext(FT_ONE_PATH, ".xpm") < 0 || ft_check_not_found(FT_TWO_PATH) < 0 || ft_check_ext(FT_TWO_PATH, ".xpm") < 0 || ft_check_not_found(FT_THR_PATH) < 0 || ft_check_ext(FT_THR_PATH, ".xpm") < 0 || ft_check_not_found(FT_FOU_PATH) < 0 || ft_check_ext(FT_FOU_PATH, ".xpm") < 0 || ft_check_not_found(FT_FIV_PATH) < 0 || ft_check_ext(FT_FIV_PATH, ".xpm") < 0 || ft_check_not_found(FT_SIX_PATH) < 0 || ft_check_ext(FT_SIX_PATH, ".xpm") < 0 || ft_check_not_found(FT_SEV_PATH) < 0 || ft_check_ext(FT_SEV_PATH, ".xpm") < 0 || ft_check_not_found(FT_EIG_PATH) < 0 || ft_check_ext(FT_EIG_PATH, ".xpm") < 0 || ft_check_not_found(FT_NIN_PATH) < 0 || ft_check_ext(FT_NIN_PATH, ".xpm") < 0 || ft_check_not_found(FT_PER_PATH) < 0 || ft_check_ext(FT_PER_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_NUMBER, clist)); return (ft_check_missing_other_number_defines(clist)); } static int ft_check_missing_more_tex_defines(t_cub *clist) { if (clist->mlist.enemy == 1) { if (ft_check_not_found(FT_ENMY_WAIT_PATH) < 0 || ft_check_ext(FT_ENMY_WAIT_PATH, ".xpm") < 0 || ft_check_not_found(FT_ENMY_WALK_PATH) < 0 || ft_check_ext(FT_ENMY_WALK_PATH, ".xpm") < 0 || ft_check_not_found(FT_ENMY_FIRE_PATH) < 0 || ft_check_ext(FT_ENMY_FIRE_PATH, ".xpm") < 0 || ft_check_not_found(FT_ENMY_DEAD_PATH) < 0 || ft_check_ext(FT_ENMY_DEAD_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_ENMY, clist)); } else { if (ft_check_not_found(FT_CB_WAIT_PATH) < 0 || ft_check_ext(FT_CB_WAIT_PATH, ".xpm") < 0 || ft_check_not_found(FT_ENMY_WALK_PATH) < 0 || ft_check_ext(FT_CB_WALK_PATH, ".xpm") < 0 || ft_check_not_found(FT_CB_FIRE_PATH) < 0 || ft_check_ext(FT_CB_FIRE_PATH, ".xpm") < 0 || ft_check_not_found(FT_CB_DEAD_PATH) < 0 || ft_check_ext(FT_CB_DEAD_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_ENMY, clist)); } return (ft_check_missing_number_defines(clist)); } int ft_check_missing_tex_defines(t_cub *clist) { if (ft_check_not_found(FT_DEATH_SCREEN_PATH) < 0 || ft_check_ext(FT_DEATH_SCREEN_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_DEATH_SCREEN, clist)); if (ft_check_not_found(FT_HUD_BACK_PATH) < 0 || ft_check_ext(FT_HUD_BACK_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_HUD_BACK, clist)); if (ft_check_not_found(FT_WEAPON_ONE_PATH) < 0 || ft_check_ext(FT_WEAPON_ONE_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_W_ONE, clist)); if (ft_check_not_found(FT_WEAPON_TWO_PATH) < 0 || ft_check_ext(FT_WEAPON_TWO_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_W_TWO, clist)); if (ft_check_not_found(FT_WEAPON_THREE_PATH) < 0 || ft_check_ext(FT_WEAPON_THREE_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_W_THREE, clist)); if (ft_check_not_found(FT_WEAPON_ONE_FIRE_PATH) < 0 || ft_check_ext(FT_WEAPON_ONE_FIRE_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_W_ONE_FIRE, clist)); if (ft_check_not_found(FT_WEAPON_TWO_FIRE_PATH) < 0 || ft_check_ext(FT_WEAPON_TWO_FIRE_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_W_TWO_FIRE, clist)); if (ft_check_not_found(FT_WEAPON_THREE_FIRE_PATH) < 0 || ft_check_ext(FT_WEAPON_THREE_FIRE_PATH, ".xpm") < 0) return (ft_missing_error(FT_ERR_MISS_W_THREE_FIRE, clist)); return (ft_check_missing_more_tex_defines(clist)); }