-
Notifications
You must be signed in to change notification settings - Fork 0
/
vertexutils2.c
38 lines (34 loc) · 1.32 KB
/
vertexutils2.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
29
30
31
32
33
34
35
36
37
38
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* vertexutils2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: toramo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/18 10:06:53 by toramo #+# #+# */
/* Updated: 2023/12/18 10:06:55 by toramo ### ########.fr */
/* */
/* ************************************************************************** */
#include "include/fdf.h"
void placeholder_vertex(t_vertex *array, int k)
{
array[k].x = array[k - 1].x + 1;
array[k].y = 0;
array[k].z = array[k - 1].z;
array[k].w = 1;
array[k].color = 0;
}
int vertex_is_valid(t_vertex v)
{
if (!v.enabled || v.x <= 0 || v.z <= 0 || v.y <= 0 || v.color == 0)
return (0);
else
return (1);
}
int pixel_is_valid(int x, int y)
{
if (x > 0 && x < WIDTH && y > 0 && y < HEIGHT)
return (1);
else
return (0);
}