cub3d/includes/maputils.h
2025-07-15 10:33:25 +02:00

47 lines
2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* maputils.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tchampio <tchampio@student.42lehavre.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/06/21 19:34:43 by tchampio #+# #+# */
/* Updated: 2025/07/15 10:32:24 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MAPUTILS_H
# define MAPUTILS_H
# include <stdbool.h>
# include "structs.h"
// 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"
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);
void free_map(t_mapdata *map);
#endif