void ft_print_wall(t_data *e) { double x; ft_init_vec(e); x = 0; while (x < e->w) { ft_ray_pos(e, x); ft_init_dda(e); ft_calc_dist(e); ft_dda(e); ft_correct_feye(e); ft_calc_hwall(e, x); x++; } }
void ft_raycast_wall(t_env *v, int x) { CAMX = 2 * x / (double)WIDTH - 1; RAYPOSX = POSX; RAYPOSY = POSY; RAYDIRX = DIRX + PLANEX * CAMX; RAYDIRY = DIRY + PLANEY * CAMX; MAPX = (int)RAYPOSX; MAPY = (int)RAYPOSY; D_DELTAX = sqrt(1 + (RAYDIRY * RAYDIRY) / (RAYDIRX * RAYDIRX)); D_DELTAY = sqrt(1 + (RAYDIRX * RAYDIRX) / (RAYDIRY * RAYDIRY)); ft_calc_step(v); // dprintf(1, "debug1\n"); ft_dda(v); ft_calc_dist(v); // dprintf(1, "x = %d lh = %d\n", x, LINEHEIGHT); ft_print_wall(v, x); }