-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathborder_check.c
More file actions
27 lines (25 loc) · 1.27 KB
/
border_check.c
File metadata and controls
27 lines (25 loc) · 1.27 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* border_check.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bparker <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/01/11 07:52:26 by bparker #+# #+# */
/* Updated: 2019/01/17 17:17:07 by bparker ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
int border_check(t_vec4 dot0, t_vec4 dot1, t_vec2 map)
{
if ((dot0.x >= map.x && dot1.x >= map.x) ||
(dot0.y >= map.y && dot1.y >= map.y) ||
(dot0.x < 0 && dot1.x < 0) || (dot0.y < 0 && dot1.y < 0))
return (0);
if (dot0.x >= map.x || dot0.y >= map.y || dot0.x < 0 || dot0.y < 0 ||
dot1.x >= map.x || dot1.y >= map.y || dot1.x < 0 || dot1.y < 0)
{
return (-1);
}
return (1);
}