-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfdf.h
81 lines (72 loc) · 2.16 KB
/
fdf.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fdf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: emende <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/26 20:26:51 by emende #+# #+# */
/* Updated: 2022/04/09 22:00:08 by emende ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FDF_H
# define FDF_H
# include "libft.h"
# include "mlx.h"
# include "get_next_line.h"
# include <fcntl.h>
# define W_WIDTH 1500
# define W_HEIGHT 1000
typedef struct s_data {
void *img;
void *addr;
int bpp;
int line_len;
int endian;
} t_data;
typedef struct s_line {
int x0;
int y0;
int x1;
int y1;
int delta_x;
int delta_y;
} t_line;
typedef struct s_vars {
struct s_line line;
struct s_data data;
void *mlx_ptr;
void *win_ptr;
int colors[5][2];
int colormode[2];
int light_switch;
int **arr;
char **split;
int row_count;
int col_count;
int max_altitude;
int min_altitude;
int color;
int color_theme;
int x_ofs;
int y_ofs;
double z_ofs;
double z_ofs2;
double tile_w;
double tile_h;
int projection;
} t_vars;
void ft_mlx_pixel_put(t_vars *v, int x, int y);
void draw_line(t_vars *v);
int hook_key(int keycode, t_vars *v);
void panic(char *msg, t_vars *v);
void read_values(int fd, char *argv, t_vars *v);
void image_to_display(t_vars *v);
void projection(t_vars *v);
void refresh(t_vars *v);
void initilize_colors(t_vars *v);
void change_colortheme(int keycode, t_vars *v);
int upd_col(int point1, int point2, t_vars *v);
int free_intarr(int ***split, int length);
int free_strarr(char ***split);
#endif