aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_textures.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-23 20:02:30 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-23 20:02:30 +0100
commit32aa3a92c7c7a1c452ff11e844becab0ca89f5f5 (patch)
tree4e1c0e3d6515d1223e3d97eff82571e1e17a720e /src/ft_draw_textures.c
parentThis is great (diff)
download42-cub3d-32aa3a92c7c7a1c452ff11e844becab0ca89f5f5.tar.gz
42-cub3d-32aa3a92c7c7a1c452ff11e844becab0ca89f5f5.tar.bz2
42-cub3d-32aa3a92c7c7a1c452ff11e844becab0ca89f5f5.tar.xz
42-cub3d-32aa3a92c7c7a1c452ff11e844becab0ca89f5f5.tar.zst
42-cub3d-32aa3a92c7c7a1c452ff11e844becab0ca89f5f5.zip
now pthread
Diffstat (limited to '')
-rw-r--r--src/ft_draw_textures.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ft_draw_textures.c b/src/ft_draw_textures.c
index 56be3ee..5bf0854 100644
--- a/src/ft_draw_textures.c
+++ b/src/ft_draw_textures.c
@@ -30,11 +30,14 @@ void
if ((dist = cl->rlist.wall_dist_tab[x]) <= 0)
dist = 0.0001;
- rgb.r = (uint8_t)cl->tlist[cl->rlist.w_side_tab[x]].ptr[cl->rlist.tex_x_tab[x]
+ rgb.r =
+ (uint8_t)cl->tlist[cl->rlist.w_side_tab[x]].ptr[cl->rlist.tex_x_tab[x]
* 4 + 4 * cl->tlist[cl->rlist.w_side_tab[x]].img_h * tex_y + 2];
- rgb.g = (uint8_t)cl->tlist[cl->rlist.w_side_tab[x]].ptr[cl->rlist.tex_x_tab[x]
+ rgb.g =
+ (uint8_t)cl->tlist[cl->rlist.w_side_tab[x]].ptr[cl->rlist.tex_x_tab[x]
* 4 + 4 * cl->tlist[cl->rlist.w_side_tab[x]].img_h * tex_y + 1];
- rgb.b = (uint8_t)cl->tlist[cl->rlist.w_side_tab[x]].ptr[cl->rlist.tex_x_tab[x]
+ rgb.b =
+ (uint8_t)cl->tlist[cl->rlist.w_side_tab[x]].ptr[cl->rlist.tex_x_tab[x]
* 4 + 4 * cl->tlist[cl->rlist.w_side_tab[x]].img_h * tex_y];
*(int*)(cl->img.ptr + ((uint16_t)x * 4 +
(y * cl->img.sizeline))) = ft_rgb_to_hex(dist, rgb, cl);