-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfdf.h
93 lines (70 loc) · 2.24 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: tadiyamu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/11 17:25:24 by tadiyamu #+# #+# */
/* Updated: 2023/02/11 17:25:25 by tadiyamu ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FDF_H
# define FDF_H
# include <stdlib.h>
# include <unistd.h>
# include <math.h>
# include <stdio.h>
# include <sys/stat.h>
# include <fcntl.h>
# include "minilibx-linux/mlx.h"
# include "libft/libft.h"
# include "get_next_line.h"
# define TILE_WIDTH 20
# define TILE_HEIGHT 10
typedef struct s_data {
void *img;
char *addr;
int bits_per_pixel;
int line_length;
int endian;
} t_data;
typedef struct s_point {
int x;
int y;
int color;
int rend;
} t_point;
typedef struct s_map {
int *map;
t_point *points;
int row;
int col;
int min;
int max;
int height;
int width;
int tile_width;
int tile_height;
} t_map;
typedef struct s_vars {
void *mlx;
void *win;
t_data img;
} t_vars;
void ft_split_free(char ***res);
void ft_error_gen(void);
int ft_file_to_cord(char *file, t_map *map);
void ft_split_to_cord(t_map *map, int r, int c, char *split);
int ft_cnt_line(char *file, t_map *map, char **content);
void ft_malloc_map(t_map *map);
void ft_map_from_file(char *file, t_map *map);
int ft_cal_x(int r, int c, t_map *map);
int ft_cal_y(int r, int c, t_map *map);
void ft_mlx_pixel_put(t_data *data, int x, int y, int color);
void ft_calculate_points(t_map *map);
void ft_connect_points(int r, int c, t_map *map, t_data *img);
int handle_input(int keysym, t_vars *vars);
int handle_cross(t_vars *vars);
int handle_no_event(void);
#endif