Connected parsing to rest of the game
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef CUBE3D_MACRO_H
|
||||
# define CUBE3D_MACRO_H
|
||||
|
||||
# define TOTAL_ELEMENTS 6
|
||||
|
||||
# define MAX_NB_KEY 3
|
||||
# define SCREEN_DIST 50
|
||||
# define SCREEN_SIZE 100
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
// -------------------------------
|
||||
|
||||
@@ -75,6 +75,20 @@ typedef struct s_img
|
||||
int endian;
|
||||
} 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
|
||||
*/
|
||||
@@ -82,8 +96,11 @@ typedef struct s_img
|
||||
typedef struct s_map
|
||||
{
|
||||
char **content;
|
||||
char *tmp_str;
|
||||
int size_x;
|
||||
int size_y;
|
||||
int plr_x;
|
||||
int plr_y;
|
||||
} t_map;
|
||||
|
||||
/*
|
||||
@@ -120,6 +137,8 @@ typedef struct s_game
|
||||
t_plr plr;
|
||||
// rays
|
||||
t_rcast rcast;
|
||||
// textures and colors
|
||||
t_txt txt;
|
||||
// map
|
||||
t_map map;
|
||||
// key hook
|
||||
|
||||
Reference in New Issue
Block a user