/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_tex_weap_init.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: water_ma +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 17:43:55 by water_ma #+# #+# */ /* Updated: 2020/02/14 17:43:56 by water_ma ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include /* ** tweap[] index summary ** --------------------- ** 0: weapon one ** 1: weapon one fire ** 2: weapon two ** 3: weapon two fire ** 4: weapon three ** 5: weapon three fire */ void ft_weap_tex_init(t_cub *cl) { cl->tweap[0].img = mlx_xpm_file_to_image(cl->wlist.wlx, FT_WEAPON_ONE_PATH, &cl->tweap[0].img_w, &cl->tweap[0].img_h); cl->tweap[0].ptr = mlx_get_data_addr(cl->tweap[0].img, &cl->tweap[0].bpp, &cl->tweap[0].sizeline, &cl->tweap[0].endian); cl->tweap[1].img = mlx_xpm_file_to_image(cl->wlist.wlx, FT_WEAPON_ONE_FIRE_PATH, &cl->tweap[1].img_w, &cl->tweap[1].img_h); cl->tweap[1].ptr = mlx_get_data_addr(cl->tweap[1].img, &cl->tweap[1].bpp, &cl->tweap[1].sizeline, &cl->tweap[1].endian); cl->tweap[2].img = mlx_xpm_file_to_image(cl->wlist.wlx, FT_WEAPON_TWO_PATH, &cl->tweap[2].img_w, &cl->tweap[2].img_h); cl->tweap[2].ptr = mlx_get_data_addr(cl->tweap[2].img, &cl->tweap[2].bpp, &cl->tweap[2].sizeline, &cl->tweap[2].endian); cl->tweap[3].img = mlx_xpm_file_to_image(cl->wlist.wlx, FT_WEAPON_TWO_FIRE_PATH, &cl->tweap[3].img_w, &cl->tweap[3].img_h); cl->tweap[3].ptr = mlx_get_data_addr(cl->tweap[3].img, &cl->tweap[3].bpp, &cl->tweap[3].sizeline, &cl->tweap[3].endian); cl->tweap[4].img = mlx_xpm_file_to_image(cl->wlist.wlx, FT_WEAPON_THREE_PATH, &cl->tweap[4].img_w, &cl->tweap[4].img_h); cl->tweap[4].ptr = mlx_get_data_addr(cl->tweap[4].img, &cl->tweap[4].bpp, &cl->tweap[4].sizeline, &cl->tweap[4].endian); cl->tweap[5].img = mlx_xpm_file_to_image(cl->wlist.wlx, FT_WEAPON_THREE_FIRE_PATH, &cl->tweap[5].img_w, &cl->tweap[5].img_h); cl->tweap[5].ptr = mlx_get_data_addr(cl->tweap[5].img, &cl->tweap[5].bpp, &cl->tweap[5].sizeline, &cl->tweap[5].endian); }