aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_draw_verline.c10
-rw-r--r--src/ft_floor_cast.c1
-rw-r--r--src/ft_raycasting.c1
3 files changed, 6 insertions, 6 deletions
diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c
index dd7697a..8e71457 100644
--- a/src/ft_draw_verline.c
+++ b/src/ft_draw_verline.c
@@ -28,6 +28,7 @@ static void
cl->img.ptr[x * 4 + cl->wlist.x_size * y + 3] = (int8_t)0;
}
+#include <stdio.h>
static void
ft_draw_floor(t_cub *cl, int32_t y, int32_t x)
{
@@ -40,7 +41,6 @@ static void
dist_player = 0.0;
while ((uint32_t)y < cl->wlist.y_size)
{
- ft_floor_cast(cl);
curr_dist = cl->wlist.y_size / (2.0 * y - cl->wlist.y_size);
weight = (curr_dist - dist_player)
/ (cl->rlist.wall_dist - dist_player);
@@ -52,10 +52,10 @@ static void
* cl->tlist[6].img_w) % cl->tlist[6].img_w;
cl->tlist[6].tex_y = (int32_t)(curr_floor_y
* cl->tlist[6].img_h) % cl->tlist[6].img_h;
- cl->tlist[6].tex_x = (cl->tlist[6].tex_x > 0)
- ? (cl->tlist[6].tex_x) : (-cl->tlist[6].tex_x);
- cl->tlist[6].tex_y = (cl->tlist[6].tex_y > 0)
- ? (cl->tlist[6].tex_y) : (-cl->tlist[6].tex_y);
+ /* cl->tlist[6].tex_x = (cl->tlist[6].tex_x > 0) */
+ /* ? (cl->tlist[6].tex_x) : (-cl->tlist[6].tex_x); */
+ /* cl->tlist[6].tex_y = (cl->tlist[6].tex_y > 0) */
+ /* ? (cl->tlist[6].tex_y) : (-cl->tlist[6].tex_y); */
ft_draw_floor_tex(cl, y, x, cl->tlist[6].tex_y);
/* *(int*)(cl->img.ptr + */
/* (x * 4 + (y * cl->img.sizeline))) */
diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c
index d9afa5a..fe2734a 100644
--- a/src/ft_floor_cast.c
+++ b/src/ft_floor_cast.c
@@ -13,7 +13,6 @@
#include <cub3d.h>
#include <stdint.h>
-#include <stdio.h>
void
ft_floor_cast(t_cub *cl)
{
diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c
index c83604f..0a4b8b5 100644
--- a/src/ft_raycasting.c
+++ b/src/ft_raycasting.c
@@ -117,6 +117,7 @@ void
while (i < wl->x_size)
{
ft_initray(i, cl);
+ ft_floor_cast(cl);
cl->rlist.line_h = (int16_t)(wl->y_size / cl->rlist.wall_dist);
cl->rlist.wall_t = -cl->rlist.line_h / 2 + wl->y_size / 2;
if (cl->rlist.wall_t < 0)