-
Notifications
You must be signed in to change notification settings - Fork 0
/
purgatory.c
82 lines (73 loc) · 1.72 KB
/
purgatory.c
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* purgatory.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dstepane <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/06 18:50:40 by dstepane #+# #+# */
/* Updated: 2019/03/06 18:50:43 by dstepane ### ########.fr */
/* */
/* ************************************************************************** */
#include "filler.h"
void del_heatmap(t_flr *f)
{
int i;
i = 0;
if (f->hm)
{
while (i < f->map_h)
{
ft_bzero(f->hm[i], f->map_w);
free(f->hm[i++]);
}
ft_memdel((void **)&f->hm[i]);
ft_memdel((void **)&f->hm);
free(f->hm);
f->hm = NULL;
}
}
void del_arr(char **arr)
{
int i;
i = 0;
if (arr)
{
while (arr[i])
free(arr[i++]);
ft_memdel((void **)&arr);
}
}
void del_piece(t_flr *f)
{
int i;
i = 0;
if (f->fig)
{
while (i < f->fig_h)
{
ft_bzero(f->fig[i], f->fig_w);
ft_strdel(&f->fig[i++]);
}
ft_strdel(&f->fig[i]);
ft_memdel((void **)&f->fig);
}
f->fig_h = 0;
f->fig_w = 0;
}
void del_map(t_flr *f)
{
int i;
i = 0;
if (f->map)
{
while (i < f->map_h)
{
ft_bzero(f->map[i], f->map_w);
ft_strdel(&f->map[i++]);
}
ft_strdel(&f->map[i]);
free(f->map);
f->map = NULL;
}
}