diff options
Diffstat (limited to 'src/ft_check_missing.c')
-rw-r--r-- | src/ft_check_missing.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/ft_check_missing.c b/src/ft_check_missing.c index a17bdea..6bf41ab 100644 --- a/src/ft_check_missing.c +++ b/src/ft_check_missing.c @@ -14,15 +14,6 @@ #include <cub3d.h> #include <unistd.h> -int - ft_missing_error(const char *err, t_cub *clist) -{ - ft_dprintf(STDERR_FILENO, "Error\n"); - ft_dprintf(STDERR_FILENO, - "\033[1;31m%s %s\033[0m\n", FT_ERR_MISS_ELEMENT, err); - return (ft_exit(FT_ERR_MISSING, clist)); -} - static int ft_check_missing_sfx(t_cub *clist) { @@ -60,6 +51,21 @@ static int } static 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_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_sprites(clist)); +} + +static int ft_check_missing_norme(t_cub *clist) { if (!clist->mlist.isftex) @@ -82,10 +88,7 @@ static int return (ft_missing_error(FT_ERR_MISS_NLVL_PATH, clist)); if (clist->mlist.istraps && !clist->mlist.traps_path[0]) return (ft_missing_error(FT_ERR_MISS_TRAP, 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)); - return (ft_check_missing_sprites(clist)); + return (ft_check_missing_tex_defines(clist)); } int |