First shot on structures, First shot on option
option:
Added options for help, debug, save, file using bgoulard lib
structures:
Moved cub3d.h structures to cub3d_struct.h
Added color, dpoint, ipoint, tile, cli, error
Modified t_map, t_player to use previously mentioned struct :
ipoint, dpoint, tyle
This commit is contained in:
parent
be6038dcc8
commit
8ee1c5f85a
14 changed files with 580 additions and 79 deletions
|
|
@ -6,59 +6,25 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/30 16:30:26 by rparodi #+# #+# */
|
||||
/* Updated: 2024/11/08 11:40:44 by rparodi ### ########.fr */
|
||||
/* Updated: 2024/11/09 01:19:41 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef CUB3D_H
|
||||
# define CUB3D_H
|
||||
|
||||
# include <stdio.h>
|
||||
# include <math.h>
|
||||
# include <fcntl.h>
|
||||
# include <stdlib.h>
|
||||
# include <sys/time.h>
|
||||
# include <unistd.h>
|
||||
# include <stdbool.h>
|
||||
|
||||
# include "libft.h"
|
||||
# include "../minilibx-linux/mlx.h"
|
||||
# include "message_error.h"
|
||||
|
||||
#include "cub3d_struct.h"
|
||||
# ifndef BONUS
|
||||
# define BONUS 0
|
||||
# endif
|
||||
|
||||
typedef struct s_map
|
||||
{
|
||||
int fd;
|
||||
char *path;
|
||||
char *oneline;
|
||||
char **content;
|
||||
double spawn_x;
|
||||
double spawn_y;
|
||||
} t_map;
|
||||
# include <stdbool.h>
|
||||
|
||||
typedef struct s_player
|
||||
{
|
||||
double pos_x;
|
||||
double pos_y;
|
||||
double dir_x;
|
||||
double dir_y;
|
||||
double view_x;
|
||||
double view_y;
|
||||
} t_player;
|
||||
|
||||
typedef struct s_info
|
||||
{
|
||||
void *mlx_ptr;
|
||||
void *win_ptr;
|
||||
t_map *map;
|
||||
t_player player;
|
||||
} t_info;
|
||||
|
||||
void print_error(char *msg);
|
||||
bool ft_parse_args(int argc, char *argv[]);
|
||||
void cleanup_info(t_info *info);
|
||||
int c3_options(t_info *info, int argc, char *argv[]);
|
||||
void c3_perror(t_info *info);
|
||||
void print_error(const char *msg);
|
||||
void parse_args(char *arg, t_info *inf);
|
||||
int main(int argc, char *argv[]);
|
||||
|
||||
#endif
|
||||
#endif /* CUB3D_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue