-
Notifications
You must be signed in to change notification settings - Fork 0
/
head.h
117 lines (104 loc) · 2.85 KB
/
head.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* head.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: eteyssed <eteyssed@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/24 18:08:36 by eteyssed #+# #+# */
/* Updated: 2014/11/24 18:08:36 by eteyssed ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef HEAD_H
# define HEAD_H
# include "libft/libft.h"
# include <mlx.h>
# include <unistd.h>
# include <math.h>
# include "libft/get_next_line.h"
# define SIZE_WIN_X 1920
# define SIZE_WIN_Y 1080
# define GAP 20
# define ALT 5
typedef unsigned char t_byte;
typedef struct s_env
{
void *mlx;
void *win;
} t_env;
typedef struct s_img
{
void *img;
int bpp;
int sizeline;
int endian;
int clrline;
char *data;
} t_img;
typedef struct s_pos
{
int x;
int y;
} t_pos;
typedef struct s_3dpos
{
int x;
int y;
int z;
} t_3dpos;
typedef struct s_all
{
t_env env;
t_3dpos **tab;
t_3dpos max;
t_img img;
t_pos posimg;
int re;
int alt;
int zoom;
float rx;
float ry;
float r;
char *name;
} t_all;
typedef struct s_color
{
t_byte r;
t_byte g;
t_byte b;
} t_color;
typedef struct s_line
{
t_pos p1;
t_pos p2;
t_color clr;
t_pos inc;
int dx;
int dy;
} t_line;
int ft_color_to_int(t_color color);
void ft_put_pixel(t_env env, t_pos point, t_color color);
void ft_line_put(t_all *all, t_pos p1, t_pos p2);
void ft_line_put_1(t_all *all, t_line line, t_img img);
void ft_line_put_2(t_all *all, t_line line, t_img img);
void ft_3d_line(t_all *all, t_3dpos dp1, t_3dpos dp2);
void ft_put_3d_tab(t_all *all);
void ft_end_line(t_all *all, t_3dpos **tab, t_3dpos max);
t_pos ft_3d_to_2d(t_3dpos dp1, float rx, float ry);
t_color ft_rgb_to_color(t_byte r, t_byte g, t_byte b);
t_3dpos **ft_fill_tab(t_list *lst, t_3dpos pt);
t_all ft_read_map(int fd, char c);
void ft_put_pixel_img(t_env env, t_pos point, t_img img);
void color_alt(t_all *all, int z);
void move_up(t_all *all);
void move_down(t_all *all);
void move_left(t_all *all);
void move_right(t_all *all);
void ft_dir_err(int erno);
void ft_free_map(t_all *all);
void ft_free_all(t_all *all);
void ft_ac_error(int ac);
void ft_is_fd(int fd, char *av);
int expose_hook(t_all *all);
void cartridge(t_all *all);
#endif