aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ft_castray_loop.c12
-rw-r--r--src/ft_detect.c8
-rw-r--r--src/ft_init_s_ray.c2
-rw-r--r--src/ft_select_bad_boy_action.c8
-rw-r--r--src/ft_shoot.c8
5 files changed, 19 insertions, 19 deletions
diff --git a/src/ft_castray_loop.c b/src/ft_castray_loop.c
index e10a48b..167ee1d 100644
--- a/src/ft_castray_loop.c
+++ b/src/ft_castray_loop.c
@@ -45,23 +45,23 @@ void
wl = &cl->wlist;
pl = &cl->plist;
pl->cam_x = 2 * i / (float)(wl->x_size) - 1;
- cl->rlist.x_ray_pos = pl->pos_y;
- cl->rlist.y_ray_pos = pl->pos_x;
+ cl->rlist.y_ray_pos = pl->pos_y;
+ cl->rlist.x_ray_pos = pl->pos_x;
cl->rlist.y_ray_dir = pl->dir_y + pl->plane_x *
pl->cam_x;
cl->rlist.x_ray_dir = pl->dir_x + pl->plane_y *
pl->cam_x;
- cl->rlist.sqy = (int16_t)cl->rlist.x_ray_pos;
- cl->rlist.sqx = (int16_t)cl->rlist.y_ray_pos;
+ cl->rlist.sqy = (int16_t)cl->rlist.y_ray_pos;
+ cl->rlist.sqx = (int16_t)cl->rlist.x_ray_pos;
ft_detect(cl);
if (cl->rlist.side == 0)
{
- cl->rlist.wall_dist = (cl->rlist.sqy - cl->rlist.x_ray_pos +
+ cl->rlist.wall_dist = (cl->rlist.sqy - cl->rlist.y_ray_pos +
(1 - cl->mlist.x_step) / 2) / cl->rlist.y_ray_dir;
}
else
{
- cl->rlist.wall_dist = (cl->rlist.sqx - cl->rlist.y_ray_pos +
+ cl->rlist.wall_dist = (cl->rlist.sqx - cl->rlist.x_ray_pos +
(1 - cl->mlist.y_step) / 2) / cl->rlist.x_ray_dir;
}
}
diff --git a/src/ft_detect.c b/src/ft_detect.c
index a944a0f..c7bdcbb 100644
--- a/src/ft_detect.c
+++ b/src/ft_detect.c
@@ -23,14 +23,14 @@ void
if (cl->rlist.x_ray_dir < 0)
{
cl->mlist.y_step = -1;
- cl->rlist.y_side_dist = (cl->rlist.y_ray_pos -
+ cl->rlist.y_side_dist = (cl->rlist.x_ray_pos -
cl->rlist.sqx) * cl->rlist.y_delta_dist;
}
else
{
cl->mlist.y_step = 1;
cl->rlist.y_side_dist = (cl->rlist.sqx + 1.0 -
- cl->rlist.y_ray_pos) * cl->rlist.y_delta_dist;
+ cl->rlist.x_ray_pos) * cl->rlist.y_delta_dist;
}
}
@@ -43,14 +43,14 @@ void
if (cl->rlist.y_ray_dir < 0)
{
cl->mlist.x_step = -1;
- cl->rlist.x_side_dist = (cl->rlist.x_ray_pos -
+ cl->rlist.x_side_dist = (cl->rlist.y_ray_pos -
cl->rlist.sqy) * cl->rlist.x_delta_dist;
}
else
{
cl->mlist.x_step = 1;
cl->rlist.x_side_dist = (cl->rlist.sqy + 1.0 -
- cl->rlist.x_ray_pos) * cl->rlist.x_delta_dist;
+ cl->rlist.y_ray_pos) * cl->rlist.x_delta_dist;
}
}
diff --git a/src/ft_init_s_ray.c b/src/ft_init_s_ray.c
index a79ec10..ed68cd6 100644
--- a/src/ft_init_s_ray.c
+++ b/src/ft_init_s_ray.c
@@ -23,8 +23,8 @@ t_ray
rl.wall_dist = 0;
rl.wall_t = 0;
rl.wall_b = 0;
- rl.x_ray_pos = 0;
rl.y_ray_pos = 0;
+ rl.x_ray_pos = 0;
rl.y_ray_dir = 0;
rl.x_ray_dir = 0;
rl.x_side_dist = 0;
diff --git a/src/ft_select_bad_boy_action.c b/src/ft_select_bad_boy_action.c
index 8fb38c6..08d7489 100644
--- a/src/ft_select_bad_boy_action.c
+++ b/src/ft_select_bad_boy_action.c
@@ -91,12 +91,12 @@ int8_t
wl = &cl->wlist;
pl = &cl->plist;
hit = 0;
- cl->rlist.x_ray_pos = cl->plist.pos_y;
- cl->rlist.y_ray_pos = cl->plist.pos_x;
+ cl->rlist.y_ray_pos = cl->plist.pos_y;
+ cl->rlist.x_ray_pos = cl->plist.pos_x;
cl->rlist.y_ray_dir = pl->dir_y;
cl->rlist.x_ray_dir = pl->dir_x;
- cl->rlist.sqy = (uint64_t)cl->rlist.x_ray_pos;
- cl->rlist.sqx = (uint64_t)cl->rlist.y_ray_pos;
+ cl->rlist.sqy = (uint64_t)cl->rlist.y_ray_pos;
+ cl->rlist.sqx = (uint64_t)cl->rlist.x_ray_pos;
ft_detection_init_x(cl);
ft_detection_init_y(cl);
while (hit == 0 && (cl->rlist.sqy != (uint64_t)cl->sprites[13][id].s_pos_y &&
diff --git a/src/ft_shoot.c b/src/ft_shoot.c
index 29f5066..7336a80 100644
--- a/src/ft_shoot.c
+++ b/src/ft_shoot.c
@@ -102,12 +102,12 @@ void
wl = &cl->wlist;
pl = &cl->plist;
- cl->rlist.x_ray_pos = pl->pos_y;
- cl->rlist.y_ray_pos = pl->pos_x;
+ cl->rlist.y_ray_pos = pl->pos_y;
+ cl->rlist.x_ray_pos = pl->pos_x;
cl->rlist.y_ray_dir = pl->dir_y;
cl->rlist.x_ray_dir = pl->dir_x;
- cl->rlist.sqy = (uint64_t)cl->rlist.x_ray_pos;
- cl->rlist.sqx = (uint64_t)cl->rlist.y_ray_pos;
+ cl->rlist.sqy = (uint64_t)cl->rlist.y_ray_pos;
+ cl->rlist.sqx = (uint64_t)cl->rlist.x_ray_pos;
ft_detection_init_x(cl);
ft_detection_init_y(cl);
ft_hitscan(cl, 0);