aboutsummaryrefslogtreecommitdiff
path: root/parse/parse_textures.c
blob: a0fb8f624a289df7803178daa3725bd23942c2a9 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   parse_textures.c                                   :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: cacharle <marvin@42.fr>                    +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/01/11 09:47:53 by cacharle          #+#    #+#             */
/*   Updated: 2020/01/11 09:51:03 by cacharle         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "cub3d.h"

t_bool	parse_north_texture(t_state *state, char *line)
{
	if ((state->textures_path[TEX_NORTH] = ft_strdup(line)) == NULL)
		return (FALSE);
	return (TRUE);
}

t_bool	parse_south_texture(t_state *state, char *line)
{
	if ((state->textures_path[TEX_SOUTH] = ft_strdup(line)) == NULL)
		return (FALSE);
	return (TRUE);
}

t_bool	parse_west_texture(t_state *state, char *line)
{
	if ((state->textures_path[TEX_WEST] = ft_strdup(line)) == NULL)
		return (FALSE);
	return (TRUE);
}

t_bool	parse_east_texture(t_state *state, char *line)
{
	if ((state->textures_path[TEX_EAST] = ft_strdup(line)) == NULL)
		return (FALSE);
	return (TRUE);
}

t_bool	parse_sprite_texture(t_state *state, char *line)
{
	if ((state->textures_path[TEX_SPRITE] = ft_strdup(line)) == NULL)
		return (FALSE);
	return (TRUE);
}