Added memorybook to parsing and cleaned most of the files

This commit is contained in:
Philippe BLAGOJEVIC
2022-05-04 14:38:34 +02:00
parent e564e7c8e9
commit 362668fe35
231 changed files with 11474 additions and 405 deletions

View File

@@ -1,3 +1,15 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cube3d_struct.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: pblagoje <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/05/04 13:31:38 by pblagoje #+# #+# */
/* Updated: 2022/05/04 13:34:07 by pblagoje ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef CUBE3D_STRUCT_H
# define CUBE3D_STRUCT_H
@@ -8,19 +20,19 @@
* - vector (two points)
*/
typedef struct s_d_coord
typedef struct s_d_coord
{
double x;
double y;
} t_d_coord;
typedef struct s_coord
typedef struct s_coord
{
int x;
int y;
} t_coord;
typedef struct s_vec
typedef struct s_vec
{
t_coord start;
t_coord end;
@@ -30,7 +42,7 @@ typedef struct s_vec
* struct with all elements for raycasting
*/
typedef struct s_wall
typedef struct s_wall
{
t_vec vec;
int height;
@@ -44,7 +56,7 @@ typedef struct s_wall
* struct with all elements for raycasting
*/
typedef struct s_rcast
typedef struct s_rcast
{
t_vec screen_size;
t_vec ray;
@@ -76,14 +88,14 @@ typedef struct s_rcast
* structs for windows, and images associated
*/
typedef struct s_win
typedef struct s_win
{
void *ptr;
int size_x;
int size_y;
} t_win;
typedef struct s_img
typedef struct s_img
{
void *ptr;
char *data;
@@ -98,7 +110,7 @@ typedef struct s_img
* wall textures and floor/ceiling colors
*/
typedef struct s_txt
typedef struct s_txt
{
char *txt_north;
char *txt_south;
@@ -116,7 +128,7 @@ typedef struct s_txt
* structs for the map
*/
typedef struct s_map
typedef struct s_map
{
char **content;
char *tmp_str;
@@ -132,12 +144,10 @@ typedef struct s_map
* structs for the player and its moves
*/
typedef struct s_plr
typedef struct s_plr
{
// player
t_d_coord exact;
t_coord pos;
// rot
int rot;
int deg;
double cosi;
@@ -150,32 +160,16 @@ typedef struct s_plr
* struct with all elements for the project
*/
typedef struct s_game
typedef struct s_game
{
void *mlx_ptr;
// game window
t_win win;
t_img img;
// player
t_plr plr;
// rays
t_rcast rcast;
// textures and colors
t_txt txt;
// map
t_map map;
//tmp draw map
// // map window
// t_win map_win;
// t_img map_img;
// // rays
// int ray_highlight;
// int ray_activ;
// t_vec ray;
// tmp end
// key hook
int k_hook[MAX_NB_KEY];
} t_game;