-
Notifications
You must be signed in to change notification settings - Fork 0
/
additional.c
60 lines (48 loc) · 1.49 KB
/
additional.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* additional.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kstorozh <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/05/21 21:12:08 by kstorozh #+# #+# */
/* Updated: 2017/05/21 21:12:35 by kstorozh ### ########.fr */
/* */
/* ************************************************************************** */
#include "wolf.h"
void del_arrey(void **arrey, int size)
{
int i;
i = 0;
while (i < size)
{
if (arrey[i] != NULL)
free(arrey[i]);
i++;
}
if (arrey != NULL)
free(arrey);
}
void swap(double *x1, double *x2)
{
double i;
double j;
i = *x1;
j = *x2;
*x1 = j;
*x2 = i;
}
double to_radians(double degrees)
{
return (degrees / 180.0 * M_PI);
}
void create_img(t_img *img_struct, void *img_mlx)
{
int bit_per_pixel;
int size_line;
int endian;
img_struct->map = mlx_get_data_addr(img_mlx, &bit_per_pixel,
&size_line, &endian);
img_struct->size_line = size_line;
img_struct->img_mlx = img_mlx;
}