Cub3D
 
Loading...
Searching...
No Matches
Main Functions

Core functionality of the program. More...

Functions

int cub3d (int argc, char **argv)
 Main function of the cub3d project.
 
int cub_read_args (int argc, char **argv, t_args *args)
 Reads and verifies the arguments passed to the program.
 
char ** fill_config_region (t_map *map)
 Fill the config region of the file.
 
char ** fill_map_region (t_map *map)
 Fill the map region of the file.
 
char ** read_file_lines (t_map *map, char *map_name)
 Read the map file line by line and return an array of strings.
 
size_t count_file_lines (char *file_name)
 Simple function to count the number of lines in a file.
 
void ft_exit (t_mlx mlx, t_map *map)
 Exit the program.
 
int ft_mlx_init (t_data *data)
 Initialize the mlx structure, create settings window, and load game.
 
void ft_mlx_end (t_mlx *mlx)
 Close and free the mlx structure.
 

Detailed Description

Core functionality of the program.

Function Documentation

◆ count_file_lines()

size_t count_file_lines ( char * file_name)

Simple function to count the number of lines in a file.

Parameters
file_namefile name to count lines in
Returns
size_t
Here is the call graph for this function:

◆ cub3d()

int cub3d ( int argc,
char ** argv )

Main function of the cub3d project.

Parameters
argcnumber of arguments
argvarray of string arguments
Returns
int 0 if the program ends correctly, -1 otherwise
Here is the call graph for this function:

◆ cub_read_args()

int cub_read_args ( int argc,
char ** argv,
t_args * args )

Reads and verifies the arguments passed to the program.

Parameters
argcargument count
argvarray of arguments
argspointer to args struct to fill
Returns
int 1 OK, -1 otherwise with side effect of printing error
Here is the call graph for this function:

◆ fill_config_region()

char ** fill_config_region ( t_map * map)

Fill the config region of the file.

Parameters
mapmap structure
Returns
char** NULL if error, config otherwise
Here is the call graph for this function:

◆ fill_map_region()

char ** fill_map_region ( t_map * map)

Fill the map region of the file.

Parameters
mapmap structure
Returns
char** NULL if error, map otherwise
Here is the call graph for this function:

◆ ft_exit()

void ft_exit ( t_mlx mlx,
t_map * map )

Exit the program.

Parameters
mlxPointer to the mlx structure.
mapPointer to the map structure.

◆ ft_mlx_end()

void ft_mlx_end ( t_mlx * mlx)

Close and free the mlx structure.

Parameters
mlxmlx structure

◆ ft_mlx_init()

int ft_mlx_init ( t_data * data)

Initialize the mlx structure, create settings window, and load game.

Parameters
datadata structure
Returns
int
Here is the call graph for this function:

◆ 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
mapmap structure to store the lines
map_namemap file name to read
Returns
char** array of strings containing the map lines
Here is the call graph for this function: