diff --git a/check.c b/check.c index 48f4940..6dcf802 100644 --- a/check.c +++ b/check.c @@ -6,7 +6,7 @@ /* By: yantoine +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/14 18:28:42 by yantoine #+# #+# */ -/* Updated: 2025/02/17 21:07:31 by yantoine ### ########.fr */ +/* Updated: 2025/02/25 00:29:27 by yantoine ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,13 +17,12 @@ int check_tokens(char **tokens, int expected) return (tokens && ft_arraylen(tokens) == expected); } -void check_if_max(t_scene scene, const int to_test, const int max) +int check_if_max(t_scene scene, const int to_test, const int max) { + (void)scene; if (to_test >= max) { - printf("error:\n"); - close(scene.fd_if_exit); - free(scene.line_if_exit); - exit(1); + return (0); } + return (1); } diff --git a/miniRT b/miniRT index bd657aa..9c85190 100755 Binary files a/miniRT and b/miniRT differ diff --git a/miniRT.h b/miniRT.h index 27cab62..ee52e9c 100644 --- a/miniRT.h +++ b/miniRT.h @@ -6,7 +6,7 @@ /* By: yantoine +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/13 20:02:36 by yantoine #+# #+# */ -/* Updated: 2025/02/24 17:02:24 by yantoine ### ########.fr */ +/* Updated: 2025/02/25 00:29:04 by yantoine ### ########.fr */ /* */ /* ************************************************************************** */ @@ -238,7 +238,7 @@ char **get_tokens_secure(t_scene scene, const int numObject, int check_tokens(char **tokens, int expected); int isdigit_token(char **tokens); int have_extension(const char *line); -void check_if_max(t_scene scene, const int to_test, const int max); +int check_if_max(t_scene scene, const int to_test, const int max); // Intersection float intersect_cylinder(t_ray ray, t_cylinder cy, t_vec3 *hitNormal); diff --git a/tags b/tags index ee5bb69..29d7d45 100644 --- a/tags +++ b/tags @@ -292,7 +292,7 @@ camera miniRT.h /^ t_camera camera;$/;" m struct:s_scene typeref:typename:t_came center miniRT.h /^ t_vec3 center;$/;" m struct:s_cylinder typeref:typename:t_vec3 center miniRT.h /^ t_vec3 center;$/;" m struct:s_sphere typeref:typename:t_vec3 check minilibx-linux/Makefile.mk /^check: all$/;" t -check_if_max check.c /^void check_if_max(t_scene scene, const int to_test, const int max)$/;" f typeref:typename:void +check_if_max check.c /^int check_if_max(t_scene scene, const int to_test, const int max)$/;" f typeref:typename:int check_number main.c /^static int check_number(t_scene scene)$/;" f typeref:typename:int file: check_shadow_cylinder shadows.c /^static bool check_shadow_cylinder(const t_ray shadow_ray, float max_t,$/;" f typeref:typename:bool file: check_shadow_plane shadows.c /^static bool check_shadow_plane(const t_ray shadow_ray, float max_t,$/;" f typeref:typename:bool file: