-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcam_check.c
28 lines (25 loc) · 1.3 KB
/
cam_check.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cam_check.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nhamid <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/08/08 23:34:50 by nhamid #+# #+# */
/* Updated: 2019/08/08 23:36:57 by nhamid ### ########.fr */
/* */
/* ************************************************************************** */
#include "rtparse.h"
int ft_cam_check(char *str_file)
{
char *cam_str;
if (!(cam_str = ft_pick_str(str_file, "cam {", "}")))
return (ft_error(NULL, 10));
if (ft_strstr(cam_str, "light {") != NULL || ft_strstr(cam_str, "obj {"))
return (ft_error(&cam_str, 8));
if (ft_check(cam_str, "pos:", 3) || ft_check(cam_str, "trs:", 3)
|| ft_check(cam_str, "rot:", 3))
return (ft_error(&cam_str, 1));
ft_strdel(&cam_str);
return (1);
}