-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
54 lines (49 loc) · 1.7 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
42
43
44
45
46
47
48
49
50
51
52
53
54
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cub3d.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lbrandy <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/18 13:17:20 by lbrandy #+# #+# */
/* Updated: 2021/04/02 19:31:25 by lbrandy ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
int check_full_struct(t_textures *t)
{
return (t->x != -1 && t->y != -1 && t->no_texture != NULL
&& t->so_texture != NULL && t->we_texture != NULL
&& t->ea_texture != NULL && t->s_texture != NULL
&& t->f != -1 && t->c != -1);
}
void init_struct(t_textures *t)
{
t->x = -1;
t->y = -1;
t->no_texture = NULL;
t->so_texture = NULL;
t->we_texture = NULL;
t->ea_texture = NULL;
t->s_texture = NULL;
t->f = -1;
t->c = -1;
}
int main(int argc, char *argv[])
{
t_all *all;
argv_check(argc, argv);
all = pars_all(argv[1]);
if (!all)
error_handler("malloc error\n");
if (argc == 3)
screen_save(all, argc);
all->win = (t_win *)malloc(sizeof(t_win));
if (!all->win)
error_handler("malloc error\n");
init_mlx(all->win, all, argc);
init_sprite(all);
reading_textures(all);
raycasting(all);
return (0);
}