aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_tex_init.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-19 13:28:52 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-19 13:28:52 +0100
commitf57f187a59840d07cd47058022c44d464ad76522 (patch)
tree22d7e5be602a8dbd21999e43760a1fc0d0b0fdb7 /src/ft_tex_init.c
parentINTENSE mapping (diff)
download42-cub3d-f57f187a59840d07cd47058022c44d464ad76522.tar.gz
42-cub3d-f57f187a59840d07cd47058022c44d464ad76522.tar.bz2
42-cub3d-f57f187a59840d07cd47058022c44d464ad76522.tar.xz
42-cub3d-f57f187a59840d07cd47058022c44d464ad76522.tar.zst
42-cub3d-f57f187a59840d07cd47058022c44d464ad76522.zip
Loaded weapon images needs to memory
Diffstat (limited to 'src/ft_tex_init.c')
-rw-r--r--src/ft_tex_init.c49
1 files changed, 29 insertions, 20 deletions
diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c
index 6486e87..34f9fb9 100644
--- a/src/ft_tex_init.c
+++ b/src/ft_tex_init.c
@@ -1,7 +1,7 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
-/* ft_basic_keys.c :+: :+: :+: */
+/* ft_tex_init.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fmoenne- <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
@@ -13,30 +13,31 @@
#include <libft.h>
#include <cub3d.h>
#include <stdint.h>
-#include <stdio.h>
#include <mlx.h>
/*
** tlist[] index summary
** ---------------------
-** 0 : no
-** 1 : so
-** 2 : ea
-** 3 : we
-** 4 : sprite 2
-** 5 : new level door
-** 6 : floor
-** 7 : ceil / skybox
-** 8 : sprite 3
-** 9 : sprite 4
-** 10 : sprite 5
-** 11 : sprite 6
-** 12 : sprite 7
-** 13 : sprite 8
-** 14 : sprite 9
-** 15 : trap
-** 16 : HUD back
-** 17 : heal pack
+** 0: no
+** 1: so
+** 2: ea
+** 3: we
+** 4: sprite 2
+** 5: new level door
+** 6: floor
+** 7: ceil / skybox
+** 8: sprite 3
+** 9: sprite 4
+** 10: sprite 5
+** 11: sprite 6
+** 12: sprite 7
+** 13: sprite 8
+** 14: sprite 9
+** 15: trap
+** 16: HUD back
+** 17: heal pack
+** 18: weapon one sprite
+** 19: weapon two sprite
*/
static void
@@ -78,6 +79,14 @@ static void
FT_HUD_BACK_PATH, &cl->tlist[16].img_w, &cl->tlist[16].img_h);
cl->tlist[16].ptr = mlx_get_data_addr(cl->tlist[16].img,
&cl->tlist[16].bpp, &cl->tlist[16].sizeline, &cl->tlist[16].endian);
+ cl->tlist[18].img = mlx_xpm_file_to_image(cl->wlist.wlx,
+ FT_WEAPON_ONE_SPR_PATH, &cl->tlist[18].img_w, &cl->tlist[18].img_h);
+ cl->tlist[18].ptr = mlx_get_data_addr(cl->tlist[18].img,
+ &cl->tlist[18].bpp, &cl->tlist[18].sizeline, &cl->tlist[18].endian);
+ cl->tlist[19].img = mlx_xpm_file_to_image(cl->wlist.wlx,
+ 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);
cl->walltexgood = 1;
if (cl->mlist.sprite_var > 1)
ft_next_sprite_init(cl);