feat: adding all the structure for the player and the map
This commit is contained in:
parent
f48e586896
commit
1b98b537b7
3 changed files with 39 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/30 16:30:26 by rparodi #+# #+# */
|
/* Created: 2024/10/30 16:30:26 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/10/31 11:17:40 by rparodi ### ########.fr */
|
/* Updated: 2024/10/31 12:15:18 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -27,6 +27,34 @@
|
||||||
# define BONUS 0
|
# define BONUS 0
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
typedef struct s_map
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
char *path;
|
||||||
|
char *oneline;
|
||||||
|
char **content;
|
||||||
|
double spawn_x;
|
||||||
|
double spawn_y;
|
||||||
|
} t_map;
|
||||||
|
|
||||||
|
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);
|
void print_error(char *msg);
|
||||||
bool ft_parse_args(int argc, char *argv[]);
|
bool ft_parse_args(int argc, char *argv[]);
|
||||||
int main(int argc, char *argv[]);
|
int main(int argc, char *argv[]);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/31 11:09:00 by rparodi #+# #+# */
|
/* Created: 2024/10/31 11:09:00 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/10/31 11:21:59 by rparodi ### ########.fr */
|
/* Updated: 2024/10/31 12:01:18 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -14,6 +14,11 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Print the message error with red color !
|
||||||
|
*
|
||||||
|
* @param msg The detailled message
|
||||||
|
*/
|
||||||
void print_error(char *msg)
|
void print_error(char *msg)
|
||||||
{
|
{
|
||||||
write(2, BOLD_RED, strlen(BOLD_RED));
|
write(2, BOLD_RED, strlen(BOLD_RED));
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/30 16:30:03 by rparodi #+# #+# */
|
/* Created: 2024/10/30 16:30:03 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/10/30 17:00:20 by rparodi ### ########.fr */
|
/* Updated: 2024/10/31 12:04:36 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -14,7 +14,10 @@
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
t_info *cub;
|
||||||
|
|
||||||
if (!ft_parse_args(argc, argv))
|
if (!ft_parse_args(argc, argv))
|
||||||
return (1);
|
return (1);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue