2025-06-24 00:17:33 +02:00
|
|
|
/* ************************************************************************** */
|
|
|
|
|
/* */
|
|
|
|
|
/* ::: :::::::: */
|
|
|
|
|
/* maputils.h :+: :+: :+: */
|
|
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
|
/* By: tchampio <tchampio@student.42lehavre.fr> +#+ +:+ +#+ */
|
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
|
/* Created: 2025/06/21 19:34:43 by tchampio #+# #+# */
|
|
|
|
|
/* Updated: 2025/06/21 19:47:07 by tchampio ### ########.fr */
|
|
|
|
|
/* */
|
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
2025-06-04 19:16:59 +02:00
|
|
|
#ifndef MAPUTILS_H
|
|
|
|
|
# define MAPUTILS_H
|
|
|
|
|
|
|
|
|
|
# include <stdbool.h>
|
2025-06-24 00:17:33 +02:00
|
|
|
# include "structs.h"
|
2025-06-04 19:16:59 +02:00
|
|
|
|
2025-06-04 21:50:33 +02:00
|
|
|
// TODO: mettre ca dans un autre fichier
|
|
|
|
|
# define RESET "\033[0m"
|
|
|
|
|
# define RED "\033[31m"
|
|
|
|
|
# define GREEN "\033[32m"
|
|
|
|
|
# define YELLOW "\033[33m"
|
|
|
|
|
# define BLUE "\033[34m"
|
|
|
|
|
# define MAGENTA "\033[35m"
|
|
|
|
|
# define CYAN "\033[36m"
|
|
|
|
|
# define BOLD "\033[1m"
|
|
|
|
|
|
2025-06-04 19:16:59 +02:00
|
|
|
|
2025-06-24 00:17:33 +02:00
|
|
|
bool check_cubfile(char *filename, t_mapdata *map);
|
|
|
|
|
bool check_filename(t_mapdata *map, char *file);
|
|
|
|
|
void populate_maps(t_mapdata *map, int fd);
|
|
|
|
|
bool check_walls(t_mapdata *map);
|
|
|
|
|
bool check_bare_minimum(t_mapdata *map);
|
|
|
|
|
bool has_forbidden_characters(char *line);
|
|
|
|
|
void print_mapdata(const t_mapdata *data);
|
|
|
|
|
unsigned long set_color(const char *s, t_mapdata *map);
|
|
|
|
|
bool set_textures(char *line, t_mapdata *map);
|
|
|
|
|
bool add_textures(int fd, t_mapdata *map);
|
|
|
|
|
void free_tab_length(char **tab, int length);
|
|
|
|
|
int copy_old_map(t_mapdata *map, char **newmap,
|
|
|
|
|
char **newmapflood, int length);
|
|
|
|
|
void add_map_line(const char *line, t_mapdata *map);
|
|
|
|
|
void print_map(char **map);
|
|
|
|
|
bool check_cubfile(char *file, t_mapdata *map);
|
2025-06-04 19:16:59 +02:00
|
|
|
|
|
|
|
|
#endif
|