-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
56 lines (51 loc) · 1.75 KB
/
main.c
File metadata and controls
56 lines (51 loc) · 1.75 KB
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
55
56
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tarchimb <tarchimb@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/09 12:51:57 by tarchimb #+# #+# */
/* Updated: 2021/12/10 18:23:10 by tarchimb ### ########.fr */
/* */
/* ************************************************************************** */
#include "Includes/libft.h"
#include "Includes/fdf.h"
void print_tab(t_map map, int i)
{
int x;
int y;
x = 0;
y = 0;
while (y < map.y_size)
{
x = 0;
while (x < map.x_size)
{
if (i == 1)
printf("%f, %f, %f, %d\n", map.map_tab[y][x].world.x, map.map_tab[y][x].world.y, map.map_tab[y][x].world.z, map.map_tab[y][x].world.color);
else
printf("%f, %f, %f, %d\n", map.map_tab[y][x].local.x, map.map_tab[y][x].local.y, map.map_tab[y][x].local.z, map.map_tab[y][x].local.color);
x++;
}
printf("(%d)\n", y);
y++;
}
}
int main(int argc, char **argv)
{
t_map map;
(void)argc;
(void)argv;
// if (argc != 2)
// return (0);
// map = ft_parsing_map(argv[1]);
if (!(ft_parsing_map("test_maps/t2.fdf", &map)))
return (0);
ft_convert_map_to_iso(&map);
ft_new_window(&map);
print_tab(map, 1);
ft_free_all((void **)map.map_tab);
return (0);
}
//pnp_plat, elem2/ pylone