aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_detect.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_detect.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/ft_detect.c b/src/ft_detect.c
index 7153123..bfc4449 100644
--- a/src/ft_detect.c
+++ b/src/ft_detect.c
@@ -1,9 +1,21 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_detect.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/14 17:22:11 by rbousset #+# #+# */
+/* Updated: 2020/02/14 17:23:42 by rbousset ### ########lyon.fr */
+/* */
+/* ************************************************************************** */
+
#include <libft.h>
#include <cub3d.h>
#include <math.h>
static void
-ft_detection_init_y(t_cub *cl)
+ ft_detection_init_y(t_cub *cl)
{
cl->rlist.y_delta_dist = sqrt(1 + (cl->rlist.x_ray_dir *
cl->rlist.x_ray_dir) / (cl->rlist.y_ray_dir *
@@ -23,7 +35,7 @@ ft_detection_init_y(t_cub *cl)
}
static void
-ft_detection_init_x(t_cub *cl)
+ ft_detection_init_x(t_cub *cl)
{
cl->rlist.x_delta_dist = sqrt(1 + (cl->rlist.y_ray_dir *
cl->rlist.y_ray_dir) / (cl->rlist.x_ray_dir *
@@ -44,10 +56,10 @@ ft_detection_init_x(t_cub *cl)
}
void
-ft_detect(t_cub *cl)
+ ft_detect(t_cub *cl)
{
ft_detection_init_x(cl);
- cl->rlist.hit = 0;
+ cl->rlist.hit = 0;
while (cl->rlist.hit == 0)
{
if (cl->rlist.x_side_dist < cl->rlist.y_side_dist)