blob: 02ca36c5f892acc5dc6b8b824f9143a4938f9c2e (
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
/* ************************************************************************** */
/* LE - / */
/* / */
/* ft_init_lists.c .:: .:/ . .:: */
/* +:+:+ +: +: +:+:+ */
/* By: rbousset <marvin@le-101.fr> +:+ +: +: +:+ */
/* #+# #+ #+ #+# */
/* Created: 2020/02/02 17:19:29 by rbousset #+# ## ## #+# */
/* Updated: 2020/02/02 17:19:29 by rbousset ### #+. /#+ ###.fr */
/* / */
/* / */
/* ************************************************************************** */
#include <libft.h>
#include <mlx.h>
#include <cub3d.h>
#include <stddef.h>
#include <stdlib.h>
t_win
*ft_init_win(void)
{
t_win *wlist;
if (!(wlist = (t_win*)malloc(sizeof(t_win))))
return (NULL);
if (!(wlist->wlx = malloc(1)) ||
!(wlist->winptr = malloc(1)))
return (NULL);
wlist->inited = 0;
wlist->x_size = -1;
wlist->y_size = -1;
return (wlist);
}
t_cub
*ft_init_cub(void)
{
t_cub *clist;
if (!(clist = (t_cub*)malloc(sizeof(t_cub))))
return (NULL);
if (!(clist->no_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
!(clist->so_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
!(clist->ea_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
!(clist->we_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
!(clist->sprite_path = (char*)ft_calloc(1, sizeof(char))) ||
!(clist->mapl = (char*)ft_calloc(1, sizeof(char))) ||
!(clist->map = (char**)ft_calloc(2, sizeof(char*))) ||
!(clist->map[0] = (char*)ft_calloc(1, sizeof(char))))
return (NULL);
clist->map[1] = 0;
clist->f_color = -1;
clist->c_color = -1;
clist->map_w = 0;
clist->line_chk = 0;
clist->nsew = 0;
return (clist);
}
|