You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.6 KiB
C
45 lines
1.6 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* map.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: hroussea <hroussea@student.42lyon.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2021/04/22 15:55:58 by hroussea #+# #+# */
|
|
/* Updated: 2021/09/22 21:16:24 by hroussea ### ########lyon.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef MAP_H
|
|
# define MAP_H
|
|
|
|
# include <libft/types.h>
|
|
# include "parsing/parsing.h"
|
|
|
|
typedef struct s_map {
|
|
char *data;
|
|
unsigned int width;
|
|
unsigned int height;
|
|
unsigned int playerpos_x;
|
|
unsigned int playerpos_y;
|
|
char direction;
|
|
t_bool playerpos_determined;
|
|
t_vector *sprites;
|
|
} t_map;
|
|
|
|
typedef struct s_map_info {
|
|
t_cubheader header;
|
|
t_map map;
|
|
} t_map_info;
|
|
|
|
t_bool parse_map(char *fileData, t_map *map);
|
|
|
|
char *map_atpos(t_map *map, unsigned int x, unsigned int y);
|
|
t_bool map_is_closed(t_map *map);
|
|
t_bool header_complete(t_cubheader *hdr, t_bool display);
|
|
t_bool handle_map_header(t_map_info *map, char *input, char *path, int *off);
|
|
void display_map(t_map *map);
|
|
int free_map(t_map_info *map, int ret);
|
|
|
|
#endif
|