aboutsummaryrefslogtreecommitdiffstats
path: root/inc/cub3d_structs.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/cub3d_structs.h')
-rw-r--r--inc/cub3d_structs.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h
new file mode 100644
index 0000000..1a45860
--- /dev/null
+++ b/inc/cub3d_structs.h
@@ -0,0 +1,83 @@
+#ifndef CUB3D_STRUCTS_H
+#define CUB3D_STRUCTS_H
+
+typedef struct s_win
+{
+ void *wlx;
+ void *winptr;
+ uint8_t inited;
+ uint16_t x_max_size;
+ uint16_t y_max_size;
+ uint16_t x_size;
+ uint16_t y_size;
+} t_win;
+
+typedef struct s_img
+{
+ void *img;
+ char *ptr;
+ int bpp;
+ int sizeline;
+ int endian;
+} t_img;
+
+typedef struct s_rgb
+{
+ int16_t r;
+ int16_t g;
+ int16_t b;
+} t_rgb;
+
+/*
+** player view_side:
+** 1: North
+** 2: East
+** 3: South
+** 4: West
+*/
+
+typedef struct s_player
+{
+ float pos_x;
+ float pos_y;
+ float view_side;
+} t_player;
+
+typedef struct s_ray
+{
+ double x_ray_position;
+ double y_ray_position;
+ double x_ray_direction;
+ double y_ray_direction;
+ double x_side_distance;
+ double y_side_distance;
+ double x_delta_distance;
+ double y_delta_distance;
+ int hitX;
+ int hitY;
+ int hits[150];
+} t_ray;
+
+typedef struct s_cub
+{
+ char *no_tex_path;
+ char *so_tex_path;
+ char *ea_tex_path;
+ char *we_tex_path;
+ char *sprite_path;
+ char *mapl;
+ char **map;
+ size_t map_w;
+ size_t map_h;
+ size_t line_chk;
+ size_t map_start;
+ uint8_t isspawn;
+ uint8_t scale;
+ struct s_win *wlist;
+ struct s_player *plist;
+ struct s_img img;
+ struct s_rgb f_rgb;
+ struct s_rgb c_rgb;
+} t_cub;
+
+#endif