diff options
Diffstat (limited to 'inc/cub3d_structs.h')
-rw-r--r-- | inc/cub3d_structs.h | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index 29c6ac7..fc3eead 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -14,9 +14,9 @@ # define CUB3D_STRUCTS_H #include <stddef.h> -#include <stdlib.h> #include <stdint.h> #include <sys/types.h> +#include <pthread.h> typedef struct s_win { @@ -57,15 +57,23 @@ typedef struct s_bmp_info typedef struct s_sfx { - char **death; - char **new_lvl; - char **pain_one; - char **pain_two; - char **trap; - pid_t death_pid; - pid_t new_lvl_pid; - pid_t pain_pid; - pid_t trap_pid; + char *death; + char *footstep_one; + char *footstep_two; + char *new_lvl; + char *pain_one; + char *pain_two; + char *trap; + pthread_t death_tid; + pthread_t footstep_tid; + pthread_t new_lvl_tid; + pthread_t pain_tid; + pthread_t trap_tid; + pthread_mutex_t death_mutex; + pthread_mutex_t footstep_mutex; + pthread_mutex_t new_lvl_mutex; + pthread_mutex_t pain_mutex; + pthread_mutex_t trap_mutex; } t_sfx; typedef struct s_bmp_rgb @@ -105,8 +113,8 @@ typedef struct s_sprite int32_t y; int32_t tex_x; int32_t tex_y; - int32_t s_pos_x; - int32_t s_pos_y; + uint64_t s_pos_x; + uint64_t s_pos_y; double spritex; double spritey; int32_t spriteheight; @@ -189,7 +197,6 @@ typedef struct s_map char *mapl; char **sprite_path; char **map; - char **mcmd_words; int8_t x_step; int8_t y_step; size_t map_w; @@ -199,7 +206,9 @@ typedef struct s_map uint8_t sprite_var; int32_t sprite_order[8][4096]; int32_t traps_nbr; + int32_t heals_nbr; int32_t traps_order[512]; + int32_t heals_order[64]; size_t line_chk; size_t map_start; uint8_t isspawn; @@ -209,6 +218,7 @@ typedef struct s_map uint8_t isctex; uint8_t isskybox; uint8_t istraps; + uint8_t isheals; uint8_t darklvl; uint8_t scale; int8_t topsp; @@ -230,7 +240,8 @@ typedef struct s_cub char *const *envp; char errmsg[64]; int32_t key_input[5]; - pid_t mpid; + char fps_count[9]; + pthread_t mtid; int (*key_ptr[6])(struct s_cub*); int8_t (*get_ptr[14])(char**, struct s_cub*); char ref[22][3]; @@ -242,9 +253,10 @@ typedef struct s_cub struct s_img death_screen; struct s_rgb f_rgb; struct s_rgb c_rgb; - struct s_img tlist[16]; - struct s_sprite sprites[8][4096]; + struct s_img tlist[18]; + struct s_sprite **sprites; struct s_sprite traps[512]; + struct s_sprite heals[64]; struct s_sfx sfx; } t_cub; |