aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_verline.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-03 14:47:33 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-03 14:47:33 +0100
commit8866ef5699150d0549096efa94fc311ff7a48dc7 (patch)
tree4a03267f7e7f9b399a9ad0536b50ba6a90407e47 /src/ft_draw_verline.c
parentMusic is pretty bav (diff)
download42-cub3d-8866ef5699150d0549096efa94fc311ff7a48dc7.tar.gz
42-cub3d-8866ef5699150d0549096efa94fc311ff7a48dc7.tar.bz2
42-cub3d-8866ef5699150d0549096efa94fc311ff7a48dc7.tar.xz
42-cub3d-8866ef5699150d0549096efa94fc311ff7a48dc7.tar.zst
42-cub3d-8866ef5699150d0549096efa94fc311ff7a48dc7.zip
Changing stuff
Diffstat (limited to '')
-rw-r--r--src/ft_draw_verline.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c
index b0f9880..7b74d4a 100644
--- a/src/ft_draw_verline.c
+++ b/src/ft_draw_verline.c
@@ -15,10 +15,10 @@
static void
ft_draw_floor(t_cub *cl, int32_t y, int32_t x)
{
- while ((uint32_t)y < cl->wlist->y_size)
+ while ((uint32_t)y < cl.wlist.y_size)
{
- *(int*)(cl->img.ptr +
- (x * 4 + (y * cl->img.sizeline))) = ft_rgb_to_hex(cl->f_rgb);
+ *(int*)(cl.img.ptr +
+ (x * 4 + (y * cl.img.sizeline))) = ft_rgb_to_hex(cl.f_rgb);
y++;
}
}
@@ -31,8 +31,8 @@ static void
i = 0;
while (i <= y)
{
- *(int*)(cl->img.ptr +
- (x * 4 + (i * cl->img.sizeline))) = ft_rgb_to_hex(cl->c_rgb);
+ *(int*)(cl.img.ptr +
+ (x * 4 + (i * cl.img.sizeline))) = ft_rgb_to_hex(cl.c_rgb);
i++;
}
}
@@ -49,21 +49,21 @@ static void
** i = 0;
** while (i < y)
** {
-** d = i * 256 - cl->wlist->y_size * 128 + cl->rlist.line_h * 128;
+** d = i * 256 - cl.wlist.y_size * 128 + cl.rlist.line_h * 128;
** d = (d <= 0) ? (-d) : (d);
** ft_printf("%d\n", d);
-** tex_y = ((d * cl->tlist[1].img_h) / cl->rlist.line_h) / 256;
+** tex_y = ((d * cl.tlist[1].img_h) / cl.rlist.line_h) / 256;
** (tex_y <= 0) ? (tex_y = 1) : 0;
-** cl->img.ptr[x * 4 + (cl->img.sizeline * i)] =
-** (int8_t)cl->tlist[1].ptr[cl->tlist[1].tex_x * 4 + 4 *
-** cl->tlist[1].img_h * tex_y];
-** cl->img.ptr[x * 4 + (cl->img.sizeline * i) + 1] =
-** (int8_t)cl->tlist[1].ptr[cl->tlist[1].tex_x * 4 + 4 *
-** cl->tlist[1].img_h * tex_y + 1];
-** cl->img.ptr[x * 4 + (cl->img.sizeline * i) + 2] =
-** (int8_t)cl->tlist[1].ptr[cl->tlist[1].tex_x * 4 + 4 *
-** cl->tlist[1].img_h * tex_y + 2];
-** cl->img.ptr[x * 4 + cl->wlist->x_size * i + 3] = (char)0;
+** cl.img.ptr[x * 4 + (cl.img.sizeline * i)] =
+** (int8_t)cl.tlist[1].ptr[cl.tlist[1].tex_x * 4 + 4 *
+** cl.tlist[1].img_h * tex_y];
+** cl.img.ptr[x * 4 + (cl.img.sizeline * i) + 1] =
+** (int8_t)cl.tlist[1].ptr[cl.tlist[1].tex_x * 4 + 4 *
+** cl.tlist[1].img_h * tex_y + 1];
+** cl.img.ptr[x * 4 + (cl.img.sizeline * i) + 2] =
+** (int8_t)cl.tlist[1].ptr[cl.tlist[1].tex_x * 4 + 4 *
+** cl.tlist[1].img_h * tex_y + 2];
+** cl.img.ptr[x * 4 + cl.wlist.x_size * i + 3] = (char)0;
** i++;
** }
** }
@@ -78,12 +78,12 @@ int8_t
(y < 0) ? (y = 0) : 0;
(y2 < 0) ? (y2 = 0) : 0;
ft_draw_ceil(cl, y, x);
- (cl->rlist.line_h <= 0) ? (cl->rlist.line_h = 1) : 0;
+ (cl.rlist.line_h <= 0) ? (cl.rlist.line_h = 1) : 0;
while (y < y2)
{
- d = y * 256 - cl->wlist->y_size * 128 + cl->rlist.line_h * 128;
+ d = y * 256 - cl.wlist.y_size * 128 + cl.rlist.line_h * 128;
d = (d <= 0) ? (-d) : (d);
- tex_y = ((d * cl->tlist[cl->w_side].img_h) / cl->rlist.line_h) / 256;
+ tex_y = ((d * cl.tlist[cl.w_side].img_h) / cl.rlist.line_h) / 256;
(tex_y <= 0) ? (tex_y = 1) : 0;
ft_draw_texture(cl, x, y, tex_y);
y++;