-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfdf_bonus.h
89 lines (79 loc) · 2.14 KB
/
fdf_bonus.h
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
83
84
85
86
87
88
89
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fdf_bonus.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: imane <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/17 21:13:44 by irhesri #+# #+# */
/* Updated: 2023/02/13 23:43:10 by imane ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FDF_BONUS_H
# define FDF_BONUS_H
# include <stdlib.h>
# include <unistd.h>
# include <fcntl.h>
# include <math.h>
# ifdef __linux__
# include "mlx_linux/mlx_linux.h"
# else
# include "mlx_mac/mlx_mac.h"
# endif
typedef struct s_line
{
char **points;
struct s_line *next;
}t_line;
typedef struct s_segment
{
int xi;
int yi;
int xf;
int yf;
short b;
int color;
}t_segment;
typedef struct s_point
{
int x;
int y;
int z;
int color;
}t_point;
typedef struct s_image
{
void *img;
char *address;
int bit;
int size;
int endian;
}t_image;
typedef struct s_window
{
t_point **map;
t_line *lines;
t_image *image;
void *mlx;
void *win;
int color;
int map_size[2];
int n[2];
int x[2];
int trans[2];
float z;
float zoom;
double teta;
short p;
}t_window;
int my_atoi(char *str, t_point *point);
char *get_next_line(int fd);
char **ft_split(char const *s, char c, int *len);
size_t ft_strlen(const char *str);
/*************************************NEW*************************************/
int error_case(short n);
void check_args(char *str, int ac);
void new_image(t_window *window, int width, int length);
void list_to_array(t_line *line, t_window *win, t_point **map, short b);
t_point **get_map(char *file, int *size, t_window *win);
#endif