1
0
cub3d/src/parsing/check_id_text.c

33 lines
1.6 KiB
C
Raw Normal View History

2024-09-16 15:09:07 +02:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* check_id_text.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: madumerg <madumerg@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/16 09:38:32 by madumerg #+# #+# */
2024-10-05 18:59:47 +02:00
/* Updated: 2024/10/05 15:51:44 by madumerg ### ########.fr */
2024-09-16 15:09:07 +02:00
/* */
/* ************************************************************************** */
2024-09-29 20:40:33 +02:00
#include "parsing.h"
2024-09-16 15:09:07 +02:00
int detect_info(char **tab, t_pars *pars)
{
2024-09-29 20:40:33 +02:00
if (ft_strncmp("NO", tab[0], 2) == 0 && count_tab(tab) == 2)
2024-09-16 15:09:07 +02:00
return (check_texture(tab[0], tab[1], pars));
2024-09-29 20:40:33 +02:00
else if (ft_strncmp("SO", tab[0], 2) == 0 && count_tab(tab) == 2)
2024-09-16 15:09:07 +02:00
return (check_texture(tab[0], tab[1], pars));
2024-09-29 20:40:33 +02:00
else if (ft_strncmp("WE", tab[0], 2) == 0 && count_tab(tab) == 2)
2024-09-16 15:09:07 +02:00
return (check_texture(tab[0], tab[1], pars));
2024-09-29 20:40:33 +02:00
else if (ft_strncmp("EA", tab[0], 2) == 0 && count_tab(tab) == 2)
2024-09-16 15:09:07 +02:00
return (check_texture(tab[0], tab[1], pars));
2024-09-29 20:40:33 +02:00
else if (ft_strncmp("F", tab[0], 1) == 0 && count_tab(tab) == 2)
return (check_format_rgb("F", tab, pars));
2024-09-29 20:40:33 +02:00
else if (ft_strncmp("C", tab[0], 1) == 0 && count_tab(tab) == 2)
return (check_format_rgb("C", tab, pars));
2024-09-16 15:09:07 +02:00
else
return (err_mess(NOT_FOUND));
return (0);
}