-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathso_long.h
83 lines (68 loc) · 2.24 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
78
79
80
81
82
83
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* so_long.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dalcabre <dalcabre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/28 11:16:39 by dalcabre #+# #+# */
/* Updated: 2024/10/30 12:11:25 by dalcabre ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SO_LONG_H
# define SO_LONG_H
//libraries
# include "libft/libft.h"
# include "printf/ft_printf.h"
# include "libft/get_next_line.h"
# include "mlx/mlx.h"
# include <stdio.h>
# include <unistd.h>
# include <stdlib.h>
# include <fcntl.h>
# include <stdbool.h>
//estructures
typedef struct s_map
{
char **map; //matriz del mapa, para acceder a cada celda del mapa
size_t x; //ancho del mapa (columnas) es más probable que haya más columnas que filas, por eso size_t
int y; //altura del mapa (filas)
int player;
int coin;
int exit;
} t_map;
typedef struct s_player
{
int x;
int y;
int coins;
bool exit;
int collect;
int moves;
} t_player;
/*typedef struct s_images;
{
} t_images;*/
typedef struct s_game
{
void *mlx;
void *mlx_window;
t_map map;//mapa
t_player player;//jugador
// t_images images;//graficos
} t_game;
// map.c
void map_is_ber(char *argv);
void is_map_ok(char *argv, t_game *game);
void ber_to_matrix(char *argv, t_game *game);
void check_map_walls(t_game *game);
void check_map_content(t_game *game);
//floodfill.c
void where_is_player(t_game *game);
void map_floodfill(t_game *game, int x, int y);
void map_error(t_game *game);
// so_long.c
void ft_error(char *str);
void ft_free(t_game *game);
int main(int argc, char **argv);
#endif