-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
36 lines (33 loc) · 1.34 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rvinnie <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/08 10:43:35 by rvinnie #+# #+# */
/* Updated: 2021/02/08 10:43:37 by rvinnie ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
int main(int argc, char *argv[])
{
t_map s_map;
int screenshot;
if (argc < 2 || argc > 3)
put_error(&s_map, NULL, 1, 0);
s_map.mlx = NULL;
s_map.mlx = mlx_init();
if (argc == 3)
screenshot = 1;
else
screenshot = 0;
main_parser(argv[1], &s_map);
map_checker(&s_map);
s_map.win = mlx_new_window(s_map.mlx, s_map.w, s_map.h, "cub3D");
if (screenshot)
painter(&s_map, screenshot, argv[2]);
else
painter(&s_map, screenshot, NULL);
return (0);
}