aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_tex_init.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_tex_init.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c
index e2fef5e..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,13 +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);
}
- 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);
}
@@ -118,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);
}