diff options
author | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-01-27 20:22:14 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-01-27 20:22:14 +0100 |
commit | 0978388f4ae8f78c53ade14db1d5c1c8819e4310 (patch) | |
tree | 35b795404f3642fe60d7ee9cffb284f608b73cd8 /src/ft_drawmap.c | |
parent | Added @ (diff) | |
download | 42-cub3d-0978388f4ae8f78c53ade14db1d5c1c8819e4310.tar.gz 42-cub3d-0978388f4ae8f78c53ade14db1d5c1c8819e4310.tar.bz2 42-cub3d-0978388f4ae8f78c53ade14db1d5c1c8819e4310.tar.xz 42-cub3d-0978388f4ae8f78c53ade14db1d5c1c8819e4310.tar.zst 42-cub3d-0978388f4ae8f78c53ade14db1d5c1c8819e4310.zip |
Nice map drawing
Diffstat (limited to 'src/ft_drawmap.c')
-rw-r--r-- | src/ft_drawmap.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/ft_drawmap.c b/src/ft_drawmap.c index f944b11..c0854e0 100644 --- a/src/ft_drawmap.c +++ b/src/ft_drawmap.c @@ -1,7 +1,25 @@ #include <libft.h> +#include <cub3d.h> -int -ft_drawmap(void) +void +ft_drawmap(t_cub *clist) { - return (0); + 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); + y++; + } + y = 0; + x++; + } } |