aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_drawmap.c24
-rw-r--r--src/main.c2
2 files changed, 22 insertions, 4 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++;
+ }
}
diff --git a/src/main.c b/src/main.c
index bca23ce..8c4ecb9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -22,7 +22,7 @@ int
if (ft_init_winlx(clist) < 0)
return (ft_exit(3, clist));
mlx_key_hook(clist->wlist->winptr, ft_key_event, clist);
- ft_drawsquare(80, 80, clist->f_color, clist);
+ ft_drawmap(clist);
mlx_loop(clist->wlist->wlx);
return (0);
}