-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
38 lines (35 loc) · 1.37 KB
/
main.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yzaytoun <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/21 21:05:14 by yzaytoun #+# #+# */
/* Updated: 2023/07/10 21:07:50 by yzaytoun ### ########.fr */
/* */
/* ************************************************************************** */
#include "include/fdf.h"
int main(int ac, char **av)
{
t_window *window;
t_map *map;
int height;
if (ac == 2)
{
height = 0;
map = ft_readmap(av, &height);
if (!map)
ft_exception("Map reader");
window = ft_createwindow(av[1], map->width, height);
if (window == NULL)
ft_exception("Window");
if (ft_checkmap(map) != TRUE)
ft_exception("Invalide Map");
ft_run(window, map, height);
ft_destroywindow(&window, map);
}
else
ft_exception("Map reader");
return (EXIT_SUCCESS);
}