mini correction
This commit is contained in:
parent
e74045d318
commit
dee20e3897
1 changed files with 3 additions and 3 deletions
6
render.c
6
render.c
|
@ -6,7 +6,7 @@
|
|||
/* By: grobledo <grobledo@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/14 14:55:05 by greg #+# #+# */
|
||||
/* Updated: 2024/10/17 16:28:20 by grobledo ### ########.fr */
|
||||
/* Updated: 2024/10/17 16:56:10 by grobledo ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -153,9 +153,9 @@ static void draw_vertical_line(int x, u_int32_t *img_data)
|
|||
if (g_ray.side == 0 && g_ray.dir.x > 0)
|
||||
tex_x = g_tex.tex_width - tex_x - 1;
|
||||
if (g_ray.side == 1 && g_ray.dir.y < 0)
|
||||
tex_x = g_tex.tex_height - tex_x - 1;
|
||||
tex_x = g_tex.tex_width - tex_x - 1;
|
||||
u_int32_t *texture_data = (u_int32_t *)mlx_get_data_addr(g_tex.textures[g_tex.tex_dir], &bpp, &size_line, &endian);
|
||||
color = texture_data[tex_y * g_tex.tex_width + tex_x];
|
||||
color = texture_data[tex_x * g_tex.tex_width + tex_y];
|
||||
img_data[y * SCREEN_WIDTH + x] = color;
|
||||
// img_data[y * SCREEN_WIDTH + x] = COLOR_WALL;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue