void ft_draw_img() { int x; int y; double wall_height; double wall_dist; x = WIN_WID - 1; while (x >= 0) { //printf("x = %d\n", x); wall_dist = ft_wall_distance(x); printf("Pour x = %d wall_dist->%f\n", x, wall_dist); //ft_putstr("\n"); wall_height = STEP / wall_dist * POV; printf("hauteur a l ecran = %f\n", wall_height); /*if (wall_height > WIN_HEI) wall_height = WIN_HEI - 1;*/ y = (WIN_HEI / 2) - 1 - (wall_height / 2); /* on dessine le plafond */ ft_draw_ceiling(x, y); /* on dessine le mur */ ft_draw_wall(wall_height, x, y); /* on dessine le floor */ ft_draw_floor(x, WIN_HEI / 2 + wall_height / 2 - 1); /*if (x == WIN_WID - 64) break ; */ x--; } }
void ft_corps(t_id *s) { int x; x = -1; while (++x < W_X) { ft_start_initialisation(x, s); ft_ray_direction(s); ft_dda(s); ft_calc_pixl_place(s); ft_calc_floor_place(s); ft_draw_ceiling(x, s); if (x == W_X - 1) mlx_put_image_to_window(s->mlx, s->win, s->wall[13], MU, II); ft_draw_floor(x, s); ft_draw_walls(x, s); } mlx_put_image_to_window(s->mlx, s->win, s->img, 0, 0); ft_static_xpm(s); }