diff options
Diffstat (limited to 'src/ft_tex_init.c')
-rw-r--r-- | src/ft_tex_init.c | 20 |
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); |