2024-01-06 17:15:02 +01:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
|
|
|
/* so_long.h :+: :+: :+: */
|
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
/* Created: 2024/01/06 16:19:42 by adjoly #+# #+# */
|
2024-01-13 17:17:22 +01:00
|
|
|
/* Updated: 2024/01/13 17:13:56 by adjoly ### ########.fr */
|
2024-01-06 17:15:02 +01:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
#ifndef SO_LONG_H
|
|
|
|
# define SO_LONG_H
|
|
|
|
|
|
|
|
# include "MacroLibX/includes/mlx.h"
|
2024-01-07 22:45:08 +01:00
|
|
|
# include "libft/libft.h"
|
2024-01-09 16:12:58 +01:00
|
|
|
# include "get_next_line/get_next_line.h"
|
2024-01-10 15:14:24 +01:00
|
|
|
# include <stddef.h>
|
2024-01-08 13:33:55 +01:00
|
|
|
# include <unistd.h>
|
|
|
|
# include <fcntl.h>
|
|
|
|
# include <stdlib.h>
|
2024-01-06 17:15:02 +01:00
|
|
|
|
2024-01-13 17:17:22 +01:00
|
|
|
# define T_SIZE 64
|
|
|
|
# define P_PNG "assets/player.png"
|
|
|
|
# define G_PNG "assets/ground.png"
|
|
|
|
# define E_PNG "assets/exit.png"
|
|
|
|
# define W_PNG "assets/wall.png"
|
|
|
|
# define C_PNG "assets/collectible.png"
|
|
|
|
|
|
|
|
typedef struct s_coords
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
} t_coords;
|
2024-01-09 16:12:58 +01:00
|
|
|
|
2024-01-06 17:15:02 +01:00
|
|
|
typedef struct s_window
|
|
|
|
{
|
2024-01-13 17:17:22 +01:00
|
|
|
void *mlx;
|
|
|
|
void *win;
|
|
|
|
void *img;
|
|
|
|
char **map;
|
|
|
|
t_coords *p_coords;
|
|
|
|
size_t *c_count;
|
|
|
|
size_t *mov_count;
|
2024-01-10 15:14:24 +01:00
|
|
|
} t_window;
|
2024-01-06 17:15:02 +01:00
|
|
|
|
2024-01-13 17:17:22 +01:00
|
|
|
int ft_key_event(int key, void *param);
|
2024-01-09 16:12:58 +01:00
|
|
|
|
2024-01-13 17:17:22 +01:00
|
|
|
int check_wall(char **map, t_coords *player);
|
2024-01-09 16:12:58 +01:00
|
|
|
int ft_countline_fd(int fd);
|
|
|
|
char **ft_read_map(char *file_name);
|
|
|
|
|
2024-01-10 15:14:24 +01:00
|
|
|
void ft_printmap(char **map, t_window *win);
|
2024-01-13 17:17:22 +01:00
|
|
|
void ft_putimg(size_t x, size_t y, t_window *win, char *file_path);
|
2024-01-06 17:15:02 +01:00
|
|
|
|
|
|
|
#endif
|