Skip to content

Commit

Permalink
added a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ys-zm committed Jan 22, 2024
1 parent dea0b0d commit a7effd4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cub3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdint.h>
Expand Down
2 changes: 2 additions & 0 deletions src/game/raycaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions src/renderer/pixel_picker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a7effd4

Please sign in to comment.