Cub3D
 
Loading...
Searching...
No Matches
ft_print.h
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* ft_print.h :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: ppontet <ppontet@student.42lyon.fr> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2024/11/19 14:33:31 by ppontet #+# #+# */
9/* Updated: 2025/10/11 18:32:01 by ppontet ### ########lyon.fr */
10/* */
11/* ************************************************************************** */
12
13#ifndef FT_PRINT_H
14# define FT_PRINT_H
15
21
22# include "cub3d.h"
23# include <unistd.h>
24
30
31# define RESET "\033[0m"
32# define RESET_COLOR RESET
33# define BOLD "\033[1m"
34# define UNDERLINE "\033[4m"
35# define BLACK "\033[30m"
36# define RED "\033[31m"
37# define GREEN "\033[32m"
38# define YELLOW "\033[33m"
39# define BLUE "\033[34m"
40# define PURPLE "\033[35m"
41# define CYAN "\033[36m"
42# define WHITE "\033[37m"
44
50
62
73
86
100
101
107
115ssize_t ft_print_position(int x, int y);
122ssize_t ft_print_file(t_map *map);
129ssize_t ft_print_config(t_map *map);
136ssize_t ft_print_map(t_map *map);
148void ft_print_color(t_color *color);
158void print_visited(char **visited, char **map);
165void ft_print_key(int keycode);
166
167// ERRORS
174void print_map_error(t_map *map, enum e_map_error error);
181int print_map_validate_error(t_map *map, enum e_map_error error);
187void print_maze_error(enum e_maze_error error);
195int print_error(t_map *map, enum e_fx_error error);
203void print_leak_map(char **map, size_t y, size_t x);
205
206#endif
Header file for the cub3d project.
struct s_map t_map
Definition data_structure.h:30
union u_color t_color
Definition data_structure.h:40
e_fx_error
Enum used for main functions related errors.
Definition ft_print.h:91
e_maze_error
Enum used for maze related errors.
Definition ft_print.h:67
e_map_error
Enum used for map related errors.
Definition ft_print.h:55
e_arg_error
Definition ft_print.h:75
@ CUB_INIT_RENDER
Definition ft_print.h:97
@ CONFIG_ERROR
Definition ft_print.h:94
@ CUB_INIT
Definition ft_print.h:98
@ FT_MAP_CHECK
Definition ft_print.h:92
@ CHECK_ARGS
Definition ft_print.h:93
@ STORE_TEXTURES_IMG
Definition ft_print.h:95
@ FT_SETTINGS
Definition ft_print.h:96
@ MAZE_SIZE_TOO_BIG
Definition ft_print.h:68
@ MAZE_ARGS_BAD_FORMAT
Definition ft_print.h:71
@ MAZE_SIZE_TOO_SMALL
Definition ft_print.h:69
@ MAZE_SIZE_NEGATIVE_VALUE
Definition ft_print.h:70
@ CONFIG_TOO_MANY_PARAMETERS
Definition ft_print.h:56
@ CONFIG_MAP_TOO_SOON
Definition ft_print.h:59
@ CONFIG_ALREADY_STORED
Definition ft_print.h:57
@ CONFIG_MISSING_PARAMETERS
Definition ft_print.h:58
@ CONFIG_FOUND_AFTER_MAP
Definition ft_print.h:60
@ ARGS_DOOR_REQUIRED
Definition ft_print.h:81
@ ARGS_NO_MAP
Definition ft_print.h:79
@ ARGS_MISSING_GEN
Definition ft_print.h:76
@ ARGS_MISSING_KEY
Definition ft_print.h:82
@ ARGS_UNRECOGNIZED
Definition ft_print.h:84
@ ARGS_NOT_CUB
Definition ft_print.h:78
@ ARGS_MISSING_DOOR
Definition ft_print.h:83
@ ARGS_DUPLICATE
Definition ft_print.h:77
@ ARGS_MAZE_REQUIRED
Definition ft_print.h:80
ssize_t ft_print_position(int x, int y)
Print a position.
Definition ft_print_special.c:17
ssize_t ft_print_config(t_map *map)
Print the config.
Definition ft_print_special.c:50
void ft_print_key(int keycode)
Print the keycode name if registered or just its value if not.
Definition ft_print.c:17
void ft_print_color(t_color *color)
Print a color.
Definition ft_print_color.c:17
void print_leak_map(char **map, size_t y, size_t x)
Print where a leak is located on the map.
Definition ft_print_errors.c:100
void print_maze_error(enum e_maze_error error)
Print the corresponding maze error.
Definition ft_print_errors.c:55
ssize_t ft_print_file(t_map *map)
Print the whole file.
Definition ft_print_special.c:22
int print_error(t_map *map, enum e_fx_error error)
Print a special message according to enum.
Definition ft_print_errors.c:73
void print_visited(char **visited, char **map)
Print the map visited by the DFS (Depth First Search), DFS is used to search if the exterior is acces...
Definition ft_print_special.c:102
ssize_t ft_print_map(t_map *map)
Print the map.
Definition ft_print_special.c:74
int print_map_validate_error(t_map *map, enum e_map_error error)
Print the corresponding map validation error.
Definition ft_print_errors.c:38
void ft_print_floor_ceiling(t_map *map)
Print the colors of floor and ceiling.
Definition ft_print_color.c:24
void print_map_error(t_map *map, enum e_map_error error)
Print the corresponding map error.
Definition ft_print_errors.c:19