aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_sprite.c
blob: c63c35746e6a42818d7d9565c2970ef49114f514 (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
/* ************************************************************************** */
/*                                                          LE - /            */
/*                                                              /             */
/*   ft_get_sprite.c                                  .::    .:/ .      .::   */
/*                                                 +:+:+   +:    +:  +:+:+    */
/*   By: rbousset <marvin@le-101.fr>                +:+   +:    +:    +:+     */
/*                                                 #+#   #+    #+    #+#      */
/*   Created: 2020/02/02 17:19:27 by rbousset     #+#   ##    ##    #+#       */
/*   Updated: 2020/02/02 17:19:27 by rbousset    ###    #+. /#+    ###.fr     */
/*                                                         /                  */
/*                                                        /                   */
/* ************************************************************************** */

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

int8_t
	ft_get_sprite(char **words, t_cub *clist)
{
	if (!(*words) || !words[1] || words[2])
		return (-1);
	ft_memdel((void**)&clist->mlist->sprite_path);
	if (!(clist->mlist->sprite_path = ft_strdup(*(words + 1))))
		return (-1);
	return (0);
}