aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_tex_init.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-20 16:51:31 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-20 16:51:31 +0100
commitd99126692d9eefd345b4756017f4b7fb9cd75ba7 (patch)
tree61f72fda5b99804dea1ef0ca0f7ddc6e4ec6200b /src/ft_tex_init.c
parentAdded number images (diff)
download42-cub3d-d99126692d9eefd345b4756017f4b7fb9cd75ba7.tar.gz
42-cub3d-d99126692d9eefd345b4756017f4b7fb9cd75ba7.tar.bz2
42-cub3d-d99126692d9eefd345b4756017f4b7fb9cd75ba7.tar.xz
42-cub3d-d99126692d9eefd345b4756017f4b7fb9cd75ba7.tar.zst
42-cub3d-d99126692d9eefd345b4756017f4b7fb9cd75ba7.zip
in progress
Diffstat (limited to 'src/ft_tex_init.c')
-rw-r--r--src/ft_tex_init.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c
index 34f9fb9..5c0bed3 100644
--- a/src/ft_tex_init.c
+++ b/src/ft_tex_init.c
@@ -41,6 +41,15 @@
*/
static void
+ ft_init_number(t_img *tnum, const char *path, t_cub *cl)
+{
+ tnum->img = mlx_xpm_file_to_image(cl->wlist.wlx,
+ path, &tnum->img_w, &tnum->img_h);
+ tnum->ptr = mlx_get_data_addr(tnum->img,
+ &tnum->bpp, &tnum->sizeline, &tnum->endian);
+}
+
+static void
ft_next_sprite_init(t_cub *cl)
{
uint8_t i;
@@ -87,6 +96,17 @@ static void
FT_WEAPON_TWO_SPR_PATH, &cl->tlist[19].img_w, &cl->tlist[19].img_h);
cl->tlist[19].ptr = mlx_get_data_addr(cl->tlist[19].img,
&cl->tlist[19].bpp, &cl->tlist[19].sizeline, &cl->tlist[19].endian);
+ ft_init_number(&cl->tnum[0], FT_ZER_PATH, cl);
+ ft_init_number(&cl->tnum[1], FT_ONE_PATH, cl);
+ ft_init_number(&cl->tnum[2], FT_TWO_PATH, cl);
+ ft_init_number(&cl->tnum[3], FT_THR_PATH, cl);
+ ft_init_number(&cl->tnum[4], FT_FOU_PATH, cl);
+ ft_init_number(&cl->tnum[5], FT_FIV_PATH, cl);
+ ft_init_number(&cl->tnum[6], FT_SIX_PATH, cl);
+ ft_init_number(&cl->tnum[7], FT_SEV_PATH, cl);
+ ft_init_number(&cl->tnum[8], FT_EIG_PATH, cl);
+ ft_init_number(&cl->tnum[9], FT_NIN_PATH, cl);
+ ft_init_number(&cl->tnum[10], FT_PER_PATH, cl);
cl->walltexgood = 1;
if (cl->mlist.sprite_var > 1)
ft_next_sprite_init(cl);