aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_tex_sprites_extra_init.c
blob: 84684be83c26633bebf3e76a5656abbfee2f5953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_tex_sprites_extra_init.c                        :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: fmoenne- <marvin@42.fr>                    +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/02/14 17:43:55 by fmoenne-          #+#    #+#             */
/*   Updated: 2020/02/14 17:43:56 by fmoenne-         ###   ########lyon.fr   */
/*                                                                            */
/* ************************************************************************** */

#include <libft.h>
#include <cub3d.h>
#include <stdint.h>
#include <mlx.h>

void
    ft_next_sprite_init(t_cub *cl)
{
    uint8_t i;

    i = 1;
	while (cl->mlist.sprite_path[i][0])
	{
		cl->tlist[i + 7].img = mlx_xpm_file_to_image(cl->wlist.wlx,
			cl->mlist.sprite_path[i], &cl->tlist[i + 7].img_w,
			&cl->tlist[i + 7].img_h);
		cl->tlist[i + 7].ptr = mlx_get_data_addr(cl->tlist[i + 7].img,
			&cl->tlist[i + 7].bpp, &cl->tlist[i + 7].sizeline,
			&cl->tlist[i + 7].endian);
		i++;
	}
}