diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-28 22:39:39 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-28 22:39:39 +0100 |
commit | 889bf3352ebd318894ef08063fe0ffa1197125e9 (patch) | |
tree | 9745d87d0dde922c05ed60e7fbef0b91e19ab6a9 /src/ft_tex_init.c | |
parent | Normed (diff) | |
download | 42-cub3d-889bf3352ebd318894ef08063fe0ffa1197125e9.tar.gz 42-cub3d-889bf3352ebd318894ef08063fe0ffa1197125e9.tar.bz2 42-cub3d-889bf3352ebd318894ef08063fe0ffa1197125e9.tar.xz 42-cub3d-889bf3352ebd318894ef08063fe0ffa1197125e9.tar.zst 42-cub3d-889bf3352ebd318894ef08063fe0ffa1197125e9.zip |
Normal map fix
Diffstat (limited to '')
-rw-r--r-- | src/ft_tex_init.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c index b60e405..24b7d87 100644 --- a/src/ft_tex_init.c +++ b/src/ft_tex_init.c @@ -23,7 +23,17 @@ ** 4 : sprite */ -void ft_wall_tex_init(t_cub *cl) +static void + ft_get_nlvl_img(t_cub *cl) +{ + cl->tlist[5].img = mlx_xpm_file_to_image(cl->wlist->wlx, + cl->mlist->nl_tex_path, &cl->tlist[5].img_w, &cl->tlist[5].img_h); + cl->tlist[5].ptr = mlx_get_data_addr(cl->tlist[5].img, + &cl->tlist[5].bpp, &cl->tlist[5].sizeline, &cl->tlist[5].endian); +} + +void + ft_wall_tex_init(t_cub *cl) { cl->tlist[0].img = mlx_xpm_file_to_image(cl->wlist->wlx, cl->mlist->no_tex_path, &cl->tlist[0].img_w, &cl->tlist[0].img_h); @@ -45,8 +55,6 @@ void ft_wall_tex_init(t_cub *cl) cl->mlist->sprite_path, &cl->tlist[4].img_w, &cl->tlist[4].img_h); cl->tlist[4].ptr = mlx_get_data_addr(cl->tlist[4].img, &cl->tlist[4].bpp, &cl->tlist[4].sizeline, &cl->tlist[4].endian); - cl->tlist[5].img = mlx_xpm_file_to_image(cl->wlist->wlx, - cl->mlist->nl_tex_path, &cl->tlist[5].img_w, &cl->tlist[5].img_h); - cl->tlist[5].ptr = mlx_get_data_addr(cl->tlist[5].img, - &cl->tlist[5].bpp, &cl->tlist[5].sizeline, &cl->tlist[5].endian); + if (cl->mlist->isnlvl) + ft_get_nlvl_img(cl); } |