aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_drawmap.c
blob: 406369530eac7fe21c11064010835e5f1ef7adf5 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* ************************************************************************** */
/*                                                          LE - /            */
/*                                                              /             */
/*   ft_drawmap.c                                     .::    .:/ .      .::   */
/*                                                 +:+:+   +:    +:  +:+:+    */
/*   By: rbousset <marvin@le-101.fr>                +:+   +:    +:    +:+     */
/*                                                 #+#   #+    #+    #+#      */
/*   Created: 2020/02/02 17:19:18 by rbousset     #+#   ##    ##    #+#       */
/*   Updated: 2020/02/02 17:19:19 by rbousset    ###    #+. /#+    ###.fr     */
/*                                                         /                  */
/*                                                        /                   */
/* ************************************************************************** */

#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),
					0x00aa99aa, clist);
			else if (clist->map[x][y] == '0')
				ft_drawsquare(40 + (y * 41), 40 + (x * 41),
					clist->f_color, clist);
			else if (clist->map[x][y] == '2')
				ft_drawsquare(40 + (y * 41), 40 + (x * 41),
					0x0033ccff, clist);
			y++;
		}
		y = 0;
		x++;
	}
}