-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFdF.h
93 lines (82 loc) · 2.09 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
82
83
84
85
86
87
88
89
90
91
92
93
/* ************************************************************************** */
/* */
/* :::::::: */
/* FdF.h :+: :+: */
/* +:+ */
/* By: bsomers <[email protected]> +#+ */
/* +#+ */
/* Created: 2022/04/22 13:51:39 by bsomers #+# #+# */
/* Updated: 2022/06/10 16:02:28 by bsomers ######## odam.nl */
/* */
/* ************************************************************************** */
#ifndef FDF_H
# define FDF_H
# include "./libft/libft.h"
# include "./MLX42/include/MLX42/MLX42.h"
# include <stdlib.h>
# include <math.h>
# define GREEN 0x39BD00FF
# define RED 0xFF0000FF
# define WHITE 0xFFFFFFFF
# define BLACK 0x000000FF
# define BLUE 0x0000FFFF
# define YELLOW 0xFFFF00FF
# define HEIGHT 1080
# define WIDTH 1920
typedef struct s_map
{
int win_h;
int win_w;
int x;
int y;
int **map;
} t_map;
typedef struct s_draw
{
int x;
int y;
int x_prev;
int y_prev;
int **map_x;
int **map_y;
int z_key;
int zoom;
int color;
int c_key;
void *g_img;
} t_draw;
typedef struct s_press
{
struct s_draw *ptr;
struct s_map *ptrm;
struct s_br *ptrbr;
void *mlx;
} t_press;
typedef struct s_br
{
int x;
int y;
int dx;
int dy;
int dx1;
int dy1;
int px;
int py;
int xe;
int ye;
int i;
int x1;
int x2;
int y1;
int y2;
int move_x;
int move_y;
} t_br;
void if_error(char *str);
int parse_map(char *argv[], t_map *map);
void make_raster(t_draw *draw, t_map *map, t_br *br, mlx_image_t *g_img);
void bresenham(t_br *br, mlx_image_t *g_img, int color);
void fdf_keyhook(mlx_key_data_t keydata, void *param);
void free_struct(t_map *map);
void malloc_map(t_map *map, int x, int y);
#endif