aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_check_missing_defines.c
blob: e32d7f7d20bd2fd895365b2d921f3140258afdfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   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));
}

static int
	ft_check_missing_more_tex_defines(t_cub *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));
	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));
}