aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_floor_cast.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c
index 9b8ab59..6947403 100644
--- a/src/ft_floor_cast.c
+++ b/src/ft_floor_cast.c
@@ -33,10 +33,10 @@ static void
{
rl->x_cell = (int32_t)(rl->x_floor);
rl->y_cell = (int32_t)(rl->y_floor);
- cl->tlist[6].tex_x = (int32_t)(cl->tlist[6].img_w
- * (rl->x_floor - rl->x_cell)) & (cl->tlist[6].img_w - 1);
- cl->tlist[6].tex_y = (int32_t)(cl->tlist[6].img_h
- * (rl->y_floor - rl->y_cell)) & (cl->tlist[6].img_h - 1);
+ cl->tlist[6].tex_y = (int32_t)(cl->tlist[6].img_w
+ * (rl->x_floor - rl->x_cell)) % (cl->tlist[6].img_w);
+ cl->tlist[6].tex_x = (int32_t)(cl->tlist[6].img_h
+ * (rl->y_floor - rl->y_cell)) % (cl->tlist[6].img_h);
rl->x_floor += cl->mlist.x_floor_step;
rl->y_floor += cl->mlist.y_floor_step;
ft_put_floor_tex(y, x, cl);
@@ -60,8 +60,8 @@ void
(rl->x_f_ray_dir_bis - rl->x_f_ray_dir) / cl->wlist.x_size;
cl->mlist.y_floor_step = rl->row_dist *
(rl->y_f_ray_dir_bis - rl->y_f_ray_dir) / cl->wlist.x_size;
- rl->x_floor = cl->plist.pos_x + rl->row_dist * rl->x_f_ray_dir;
- rl->y_floor = cl->plist.pos_y + rl->row_dist * rl->y_f_ray_dir;
+ rl->x_floor = cl->plist.pos_y + rl->row_dist * rl->x_f_ray_dir;
+ rl->y_floor = cl->plist.pos_x + rl->row_dist * rl->y_f_ray_dir;
x = 0;
while (++x < cl->wlist.x_size)
{