aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_check_missing_defines.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-22 14:20:24 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-22 14:20:24 +0100
commit93594e31acfa50fdcb93d7dad7233c71f6222471 (patch)
tree5ae547e64eba1608cfafa5e812aae8b80c9c12e6 /src/ft_check_missing_defines.c
parentCured floating point exception (diff)
download42-cub3d-93594e31acfa50fdcb93d7dad7233c71f6222471.tar.gz
42-cub3d-93594e31acfa50fdcb93d7dad7233c71f6222471.tar.bz2
42-cub3d-93594e31acfa50fdcb93d7dad7233c71f6222471.tar.xz
42-cub3d-93594e31acfa50fdcb93d7dad7233c71f6222471.tar.zst
42-cub3d-93594e31acfa50fdcb93d7dad7233c71f6222471.zip
Removed bloat
Diffstat (limited to 'src/ft_check_missing_defines.c')
-rw-r--r--src/ft_check_missing_defines.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/ft_check_missing_defines.c b/src/ft_check_missing_defines.c
new file mode 100644
index 0000000..2e365b8
--- /dev/null
+++ b/src/ft_check_missing_defines.c
@@ -0,0 +1,67 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_check_missing_defines.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/14 17:28:42 by rbousset #+# #+# */
+/* Updated: 2020/02/14 17:28:42 by rbousset ### ########lyon.fr */
+/* */
+/* ************************************************************************** */
+
+#include <libft.h>
+#include <cub3d.h>
+
+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_sfx(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_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));
+ return (ft_check_missing_number_defines(clist));
+}