aboutsummaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-27 13:55:24 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-27 13:55:24 +0100
commitb626f171f26f709b27e790911b48f7a4272dc707 (patch)
treede04209c5ffecc5f26baac853951bc1748c925d4 /inc
parentReady to try traps (diff)
download42-cub3d-b626f171f26f709b27e790911b48f7a4272dc707.tar.gz
42-cub3d-b626f171f26f709b27e790911b48f7a4272dc707.tar.bz2
42-cub3d-b626f171f26f709b27e790911b48f7a4272dc707.tar.xz
42-cub3d-b626f171f26f709b27e790911b48f7a4272dc707.tar.zst
42-cub3d-b626f171f26f709b27e790911b48f7a4272dc707.zip
In progress
Diffstat (limited to 'inc')
-rw-r--r--inc/cub3d.h4
-rw-r--r--inc/cub3d_defines.h17
-rw-r--r--inc/cub3d_structs.h9
3 files changed, 16 insertions, 14 deletions
diff --git a/inc/cub3d.h b/inc/cub3d.h
index b7f8a36..a6a0db7 100644
--- a/inc/cub3d.h
+++ b/inc/cub3d.h
@@ -92,8 +92,6 @@ void ft_sort_sprites(t_cub *cl, int16_t i, int16_t j);
void ft_sort_s_t(t_cub *cl, float **dist_tab);
void ft_calc_sprite(t_cub *cl);
void ft_draw_sprite(t_cub *cl, t_sprite *sprite);
-void ft_calc_trap(t_cub *cl);
-void ft_draw_traps(t_cub *cl, t_sprite *sprite);
void ft_calc_heal(t_cub *cl);
void ft_draw_heals(t_cub *cl, t_sprite *sprite);
void ft_calc_weaps(t_cub *cl);
@@ -145,8 +143,8 @@ int8_t ft_get_tex_nl(char **words, t_cub *clist);
int8_t ft_get_music(char **words, t_cub *clist);
size_t ft_get_map_h(char **map);
size_t ft_get_map_w(char **map);
+int8_t ft_get_next_sprite(t_cub *clist, int s_n, char c, size_t x);
void ft_get_sprite_spawn(t_cub *clist);
-void ft_get_trap_spawn(t_cub *clist);
void ft_get_heal_spawn(t_cub *clist);
void ft_get_weapon_spawn(t_cub *clist);
int8_t ft_check_map_line(char *line, uint8_t l, t_cub *clist);
diff --git a/inc/cub3d_defines.h b/inc/cub3d_defines.h
index 76c0fc5..7b4d1b8 100644
--- a/inc/cub3d_defines.h
+++ b/inc/cub3d_defines.h
@@ -232,11 +232,12 @@ enum
# define FT_ERR_RD_TRAP "could not find trap texture file"
# define FT_ERR_WR_BMP "could not export to bmp"
# define FT_ERR_UNDEF_SPRITE "undefined sprite"
+# define FT_ERR_TOO_MUCH_SPRT "too much sprites, limit is 4096"
# define FT_ERR_TOO_MUCH_HEALS "too much heal packs, limit is 64"
# define FT_ERR_TOO_MUCH_TRAPS "too much traps, limit is 512"
-# define FT_ERR_TOO_MUCH_W_ONE "too much weapon one, limit is 1"
-# define FT_ERR_TOO_MUCH_W_TWO "too much weapon two, limit is 1"
-# define FT_ERR_TOO_MUCH_W_THREE "too much weapon three, limit is 1"
+# define FT_ERR_TOO_MUCH_W_ONE "too much weapon one, limit is 4"
+# define FT_ERR_TOO_MUCH_W_TWO "too much weapon two, limit is 4"
+# define FT_ERR_TOO_MUCH_W_THREE "too much weapon three, limit is 4"
/*
** ====== MISSING ERROR MSG ======
@@ -285,10 +286,9 @@ enum
# define FT_ERR_MISS_A_CAPTION "ammo caption"
/*
-** ====== OTHER ======
+** ====== GAMEPLAY ======
*/
-# define FT_PARSE_END_RET 25
# define FT_STRT_LIFE 250
# define FT_TRAP_DAMAGE_AMOUNT 45
# define FT_HEAL_PACK_AMOUNT 20
@@ -298,4 +298,11 @@ enum
# define FT_WEAP_THREE_STRT_AMMO 24
# define FT_WEAP_MAX_AMMO 1000
+/*
+** ====== OTHER ======
+*/
+
+# define FT_PARSE_END_RET 25
+# define FT_TOTAL_SPRT 9
+
# endif
diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h
index caf4964..836d168 100644
--- a/inc/cub3d_structs.h
+++ b/inc/cub3d_structs.h
@@ -202,15 +202,13 @@ typedef struct s_map
size_t map_w;
size_t map_h;
size_t mapl_len;
- int32_t sprite_nbr[8];
+ int32_t sprite_nbr[FT_TOTAL_SPRT];
uint8_t sprite_var;
uint8_t weapon_var;
- int32_t sprite_order[8][4096];
- int32_t st_o[8];
- int32_t traps_nbr;
+ int32_t sprite_order[FT_TOTAL_SPRT][4096];
+ int32_t st_o[FT_TOTAL_SPRT];
int32_t heals_nbr;
int32_t weaps_nbr[3];
- int32_t traps_order[512];
int32_t heals_order[64];
int32_t weaps_order[3][1];
size_t line_chk;
@@ -275,7 +273,6 @@ typedef struct s_cub
struct s_img tweap[6];
struct s_img tnum[12];
struct s_sprite **sprites;
- struct s_sprite traps[512];
struct s_sprite heals[64];
struct s_sprite **weaps;
struct s_sfx sfx[13];