From a7effd47d8bf2a906d0cdbf9fe2ae3d40a8a90b1 Mon Sep 17 00:00:00 2001 From: yesimzaim Date: Mon, 22 Jan 2024 12:56:23 +0100 Subject: [PATCH] added a comment --- src/cub3d.c | 2 +- src/game/raycaster.c | 2 ++ src/renderer/pixel_picker.c | 3 --- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cub3d.c b/src/cub3d.c index d1cdad1..9105bb8 100644 --- a/src/cub3d.c +++ b/src/cub3d.c @@ -11,7 +11,7 @@ /* ************************************************************************** */ #include "MLX42/MLX42.h" -#include "MLX42/MLX42_Int.h" +// #include "MLX42/MLX42_Int.h" #include "meta.h" #include "parser.h" #include diff --git a/src/game/raycaster.c b/src/game/raycaster.c index 343780c..552fd4a 100644 --- a/src/game/raycaster.c +++ b/src/game/raycaster.c @@ -68,6 +68,7 @@ inline static double calculate_ray_length(t_side hit_side, \ return (side_dist.y - delta_dist.y); } +// moving the ray forward in the direction until there is a hit inline static t_side ray_move(t_vec2d *side_dist, t_vec2d *delta_dist, \ t_vec2i step_size, t_vec2i *map_pos) { @@ -91,6 +92,7 @@ inline static t_side ray_move(t_vec2d *side_dist, t_vec2d *delta_dist, \ } } + t_ray raycaster_cast(t_vec2d pp, t_vec2d dir, t_ray_hitfunc hit, const void *param) { t_ray r; diff --git a/src/renderer/pixel_picker.c b/src/renderer/pixel_picker.c index 50d1a47..d8929c0 100644 --- a/src/renderer/pixel_picker.c +++ b/src/renderer/pixel_picker.c @@ -17,9 +17,6 @@ // calculate texture position void wall_texture_position(mlx_texture_t *texture, t_ray *ray, t_vec2i line_points, uint32_t h) { - static double x_old = 0; - static double y_old = 0; - ray->texture_point.x = (int)(ray->wall_x * (double)texture->width); if ((ray->hit_side == SIDE_N || ray->hit_side == SIDE_S) && ray->direction.x > 0)