-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.c
41 lines (38 loc) · 1.43 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
39
40
41
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: njantsch <njantsch@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/01 19:17:12 by skunert #+# #+# */
/* Updated: 2023/11/06 12:38:37 by njantsch ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/cub3d.h"
int main(int argc, char **argv)
{
int check;
t_map *map;
if (argc != 2)
return (printf("Error\nwrong amount of arguments\n"), 1);
check = ft_check_file_type(argv[1]);
if (check == 0)
return (printf("Error\n"), 1);
while (1)
{
map = strct_init(argv[1]);
if (map->error > 0)
return (ft_terminate_struct(map), 1);
game_init(map);
if (map->error > 0)
return (ft_terminate_struct(map), 1);
if (map->game->game_over != 3)
{
ft_terminate_struct(map);
break ;
}
ft_terminate_struct(map);
}
return (0);
}