Core functionality of the program.
More...
Core functionality of the program.
◆ count_file_lines()
| size_t count_file_lines |
( |
char * | file_name | ) |
|
Simple function to count the number of lines in a file.
- Parameters
-
| file_name | file name to count lines in |
- Returns
- size_t
◆ cub3d()
| int cub3d |
( |
int | argc, |
|
|
char ** | argv ) |
Main function of the cub3d project.
- Parameters
-
| argc | number of arguments |
| argv | array of string arguments |
- Returns
- int 0 if the program ends correctly, -1 otherwise
◆ cub_read_args()
| int cub_read_args |
( |
int | argc, |
|
|
char ** | argv, |
|
|
t_args * | args ) |
Reads and verifies the arguments passed to the program.
- Parameters
-
| argc | argument count |
| argv | array of arguments |
| args | pointer to args struct to fill |
- Returns
- int 1 OK, -1 otherwise with side effect of printing error
◆ fill_config_region()
| char ** fill_config_region |
( |
t_map * | map | ) |
|
Fill the config region of the file.
- Parameters
-
- Returns
- char** NULL if error, config otherwise
◆ fill_map_region()
| char ** fill_map_region |
( |
t_map * | map | ) |
|
Fill the map region of the file.
- Parameters
-
- Returns
- char** NULL if error, map otherwise
◆ ft_exit()
Exit the program.
- Parameters
-
| mlx | Pointer to the mlx structure. |
| map | Pointer to the map structure. |
◆ ft_mlx_end()
| void ft_mlx_end |
( |
t_mlx * | mlx | ) |
|
Close and free the mlx structure.
- Parameters
-
◆ ft_mlx_init()
| int ft_mlx_init |
( |
t_data * | data | ) |
|
Initialize the mlx structure, create settings window, and load game.
- Parameters
-
- Returns
- int
◆ read_file_lines()
| char ** read_file_lines |
( |
t_map * | map, |
|
|
char * | map_name ) |
Read the map file line by line and return an array of strings.
- Parameters
-
| map | map structure to store the lines |
| map_name | map file name to read |
- Returns
- char** array of strings containing the map lines