Cub3D
 
Loading...
Searching...
No Matches
ft_print.h File Reference

Header file for the print functions. More...

#include "cub3d.h"
#include <unistd.h>
Include dependency graph for ft_print.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RESET   "\033[0m"
 
#define RESET_COLOR   RESET
 
#define BOLD   "\033[1m"
 
#define UNDERLINE   "\033[4m"
 
#define BLACK   "\033[30m"
 
#define RED   "\033[31m"
 
#define GREEN   "\033[32m"
 
#define YELLOW   "\033[33m"
 
#define BLUE   "\033[34m"
 
#define PURPLE   "\033[35m"
 
#define CYAN   "\033[36m"
 
#define WHITE   "\033[37m"
 

Enumerations

enum  e_map_error {
  CONFIG_TOO_MANY_PARAMETERS , CONFIG_ALREADY_STORED , CONFIG_MISSING_PARAMETERS , CONFIG_MAP_TOO_SOON ,
  CONFIG_FOUND_AFTER_MAP
}
 Enum used for map related errors. More...
 
enum  e_maze_error { MAZE_SIZE_TOO_BIG , MAZE_SIZE_TOO_SMALL , MAZE_SIZE_NEGATIVE_VALUE , MAZE_ARGS_BAD_FORMAT }
 Enum used for maze related errors. More...
 
enum  e_arg_error {
  ARGS_MISSING_GEN , ARGS_DUPLICATE , ARGS_NOT_CUB , ARGS_NO_MAP ,
  ARGS_MAZE_REQUIRED , ARGS_DOOR_REQUIRED , ARGS_MISSING_KEY , ARGS_MISSING_DOOR ,
  ARGS_UNRECOGNIZED
}
 
enum  e_fx_error {
  FT_MAP_CHECK , CHECK_ARGS , CONFIG_ERROR , STORE_TEXTURES_IMG ,
  FT_SETTINGS , CUB_INIT_RENDER , CUB_INIT
}
 Enum used for main functions related errors. More...
 

Functions

ssize_t ft_print_position (int x, int y)
 Print a position.
 
ssize_t ft_print_file (t_map *map)
 Print the whole file.
 
ssize_t ft_print_config (t_map *map)
 Print the config.
 
ssize_t ft_print_map (t_map *map)
 Print the map.
 
void ft_print_floor_ceiling (t_map *map)
 Print the colors of floor and ceiling.
 
void ft_print_color (t_color *color)
 Print a color.
 
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 accessible by the player 'x' means visited '.' means not visited.
 
void ft_print_key (int keycode)
 Print the keycode name if registered or just its value if not.
 
void print_map_error (t_map *map, enum e_map_error error)
 Print the corresponding map error.
 
int print_map_validate_error (t_map *map, enum e_map_error error)
 Print the corresponding map validation error.
 
void print_maze_error (enum e_maze_error error)
 Print the corresponding maze error.
 
int print_error (t_map *map, enum e_fx_error error)
 Print a special message according to enum.
 
void print_leak_map (char **map, size_t y, size_t x)
 Print where a leak is located on the map.
 

Detailed Description

Header file for the print functions.