aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_drawmap.c
blob: 3466df0f65d0a23a60599a12e9dc854cb36ad743 (plain)
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
#include <libft.h>
#include <cub3d.h>

void
ft_drawmap(t_cub *clist)
{
	int	x;
	int	y;

	(void)clist;
	x = 0;
	y = 0;
	while (clist->map[x])
	{
		while (clist->map[x][y])
		{
			if (clist->map[x][y] == '1')
				ft_drawsquare(40 + (y * 41), 40 + (x * 41),
					clist->f_color, clist);
			if (clist->map[x][y] == '0')
				ft_drawsquare(40 + (y * 41), 40 + (x * 41),
					clist->c_color, clist);
			y++;
		}
		y = 0;
		x++;
	}
}