diff options
Diffstat (limited to 'src/ft_tex_init.c')
-rw-r--r-- | src/ft_tex_init.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c index a6eec43..1a58421 100644 --- a/src/ft_tex_init.c +++ b/src/ft_tex_init.c @@ -84,6 +84,13 @@ static void static void ft_wall_tex_init_next_bonus(t_cub *cl) { + if (cl->mlist.istraps) + { + cl->tlist[15].img = mlx_xpm_file_to_image(cl->wlist.wlx, + cl->mlist.traps_path, &cl->tlist[15].img_w, &cl->tlist[15].img_h); + cl->tlist[15].ptr = mlx_get_data_addr(cl->tlist[15].img, + &cl->tlist[15].bpp, &cl->tlist[15].sizeline, &cl->tlist[15].endian); + } if (cl->mlist.isheals) { cl->tlist[17].img = mlx_xpm_file_to_image(cl->wlist.wlx, @@ -91,20 +98,6 @@ static void cl->tlist[17].ptr = mlx_get_data_addr(cl->tlist[17].img, &cl->tlist[17].bpp, &cl->tlist[17].sizeline, &cl->tlist[17].endian); } - if (cl->mlist.isskybox) - { - cl->tlist[7].img = mlx_xpm_file_to_image(cl->wlist.wlx, - cl->mlist.skybox_path, &cl->tlist[7].img_w, &cl->tlist[7].img_h); - cl->tlist[7].ptr = mlx_get_data_addr(cl->tlist[7].img, - &cl->tlist[7].bpp, &cl->tlist[7].sizeline, &cl->tlist[7].endian); - } - else if (cl->mlist.isctex) - { - cl->tlist[7].img = mlx_xpm_file_to_image(cl->wlist.wlx, - cl->mlist.ce_tex_path, &cl->tlist[7].img_w, &cl->tlist[7].img_h); - cl->tlist[7].ptr = mlx_get_data_addr(cl->tlist[7].img, - &cl->tlist[7].bpp, &cl->tlist[7].sizeline, &cl->tlist[7].endian); - } ft_wall_tex_init_more_bonus(cl); } @@ -125,12 +118,12 @@ static void cl->tlist[6].ptr = mlx_get_data_addr(cl->tlist[6].img, &cl->tlist[6].bpp, &cl->tlist[6].sizeline, &cl->tlist[6].endian); } - if (cl->mlist.istraps) + if (cl->mlist.isctex) { - cl->tlist[15].img = mlx_xpm_file_to_image(cl->wlist.wlx, - cl->mlist.traps_path, &cl->tlist[15].img_w, &cl->tlist[15].img_h); - cl->tlist[15].ptr = mlx_get_data_addr(cl->tlist[15].img, - &cl->tlist[15].bpp, &cl->tlist[15].sizeline, &cl->tlist[15].endian); + cl->tlist[7].img = mlx_xpm_file_to_image(cl->wlist.wlx, + cl->mlist.ce_tex_path, &cl->tlist[7].img_w, &cl->tlist[7].img_h); + cl->tlist[7].ptr = mlx_get_data_addr(cl->tlist[7].img, + &cl->tlist[7].bpp, &cl->tlist[7].sizeline, &cl->tlist[7].endian); } ft_wall_tex_init_next_bonus(cl); } |