aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_init_map.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_init_map.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/ft_init_map.c b/src/ft_init_map.c
new file mode 100644
index 0000000..0bbae5e
--- /dev/null
+++ b/src/ft_init_map.c
@@ -0,0 +1,31 @@
+#include <libft.h>
+#include <cub3d.h>
+#include <stdlib.h>
+
+t_map
+ *ft_init_map(void)
+{
+ t_map *mlist;
+
+ if (!(mlist = (t_map*)malloc(sizeof(t_map))))
+ return (NULL);
+ if (!(mlist->no_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
+ !(mlist->so_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
+ !(mlist->ea_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
+ !(mlist->we_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
+ !(mlist->sprite_path = (char*)ft_calloc(1, sizeof(char))) ||
+ !(mlist->mapl = (char*)ft_calloc(1, sizeof(char))) ||
+ !(mlist->map = (char**)ft_calloc(2, sizeof(char*))) ||
+ !(mlist->map[0] = (char*)ft_calloc(1, sizeof(char))))
+ return (NULL);
+ mlist->map[1] = 0;
+ mlist->map_w = 0;
+ mlist->map_h = 0;
+ mlist->x_step = 0;
+ mlist->y_step = 0;
+ mlist->line_chk = 0;
+ mlist->map_start = 0;
+ mlist->isspawn = 0;
+ mlist->scale = 0;
+ return (mlist);
+}