-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathso_long.h
77 lines (69 loc) · 2.1 KB
/
so_long.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* so_long.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sonkang <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/07/19 11:09:25 by sonkang #+# #+# */
/* Updated: 2021/08/17 23:46:47 by sonkang ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SO_LONG_H
# define SO_LONG_H
# include "./GNL/get_next_line.h"
# include "./Libft/libft.h"
# include "./mlx/mlx.h"
# include <unistd.h>
# include <stdio.h>
typedef struct s_map
{
char **map;
int row;
int col;
int temp_col;
int player_x;
int player_y;
int collect;
int walk;
} t_map;
typedef struct s_data
{
void *img;
unsigned int *addr;
int bits_per_pixel;
int line_length;
int endian;
int img_width;
int img_height;
} t_data;
typedef struct s_win
{
void *mlx;
void *mlx_win;
t_data img;
} t_win;
typedef struct s_info
{
char tmp[4096];
t_map map;
t_data fimg;
t_data tex[5];
t_win win;
} t_info;
void print_error(int i);
int check_extention(char *argv);
int check_map_valid(t_map *m_info);
int check_comp_valid(t_map *m_info);
int get_newline(char *argv, t_map *map_info);
void get_texture(t_info *info);
char **map_parser(t_map *map_info, char *argv, int fd);
void parsing(t_info *info, char *argv);
int draw(t_info *info, int y, int x, t_data tex);
int img_conv(t_info *info);
void ft_exit(t_info *info);
void message(t_info *info);
void move(t_info *info, int x, int y);
int check_keypress(int key, t_info *info);
int check_button(t_info *info);
#endif