-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
33 lines (30 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: pnuti <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/11 16:28:16 by pnuti #+# #+# */
/* Updated: 2022/07/06 08:34:25 by pnuti ### ########.fr */
/* */
/* ************************************************************************** */
#include "mini_rt.h"
int main(int argc, char *argv[])
{
t_data data;
if (argc != 2 || !ft_strchr(argv[1], '.') \
|| ft_strncmp(ft_strchr(argv[1], '.'), ".rt", 4))
return (!berror("Error\nwrong number of arguments or file extension!"));
data.scene = reader(argv[1], data.scene);
if (data.scene->error)
{
purge_scene(data.scene);
return (2);
}
init(&data, argv);
data.scene->camera->fov_h = data.scene->camera->fov_w * \
((float)data.screen.h / (float)data.screen.w);
loop(&data);
return (0);
}