Merged parsing_connected branch to master

This commit is contained in:
pblagoje
2022-04-28 19:55:06 +02:00
19 changed files with 1019 additions and 22 deletions

View File

@@ -7,6 +7,9 @@
# include <stdlib.h> // for atoi()
# include <stdio.h> // for printf()
# include <math.h> // for M_PI, cos(), sin()
# include <sys/stat.h> // for open()
# include <fcntl.h> // for open flags
# include "colors.h"
# include "memorybook.h"

View File

@@ -9,6 +9,10 @@
# define PLR_MV 1
/* nbr key you can press at the same time */
# define MAX_NB_KEY 3
/* nbr of elements to parse in the .cub file (without the map) */
# define TOTAL_ELEMENTS 6
/* screen width */
# define SCREEN_WIDTH 500
/* screen height */

View File

@@ -13,14 +13,31 @@ int shut_down();
// SRC/INIT
// -------------------------------
// init_struct.c
t_game *init_game(void);
// init_parsing.c
void init_parsing(int ac, char **av, t_game *game);
t_game *init_struct(void);
void init_game(t_game *game);
void init_plr(t_plr *plr, t_map *map);
// -------------------------------
// SRC/GNL
// -------------------------------
// get_next_line.c
int get_next_line(int fd, char **line);
// -------------------------------
// SRC/PARSING
// -------------------------------
// init_parsing.c
int init_parsing(t_game *game, char *file);
// check_extension.c
int check_extension(char *filename, char *ext);
// check_path.c
int check_elements(t_game *game, char *file);
// check_rgb.c
int check_rgb(t_txt *txt, char *element, char identifier);
// check_map.c
int check_map(t_map *map);
// -------------------------------

View File

@@ -80,6 +80,20 @@ typedef struct s_img
int height;
} t_img;
/*
* wall textures and floor/ceiling colors
*/
typedef struct s_txt
{
char *txt_north;
char *txt_south;
char *txt_east;
char *txt_west;
int rgb_floor[3];
int rgb_ceiling[3];
} t_txt;
/*
* structs for the map
*/
@@ -87,9 +101,12 @@ typedef struct s_img
typedef struct s_map
{
char **content;
char *tmp_str;
int size_x;
int size_y;
int cell;
int plr_x;
int plr_y;
} t_map;
/*
@@ -123,6 +140,8 @@ typedef struct s_game
t_plr plr;
// rays
t_rcast rcast;
// textures and colors
t_txt txt;
// map
t_map map;
// map window