aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ft_draw_circle.c4
-rw-r--r--src/ft_raycasting.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ft_draw_circle.c b/src/ft_draw_circle.c
index 3e17dfa..be95617 100644
--- a/src/ft_draw_circle.c
+++ b/src/ft_draw_circle.c
@@ -31,8 +31,8 @@ void
while (i < 360)
{
angle = i;
- x1 = scale * cos(angle * M_PI / 180);
- y1 = scale * sin(angle * M_PI / 180);
+ x1 = scale * cos(angle * 3.14159 / 180);
+ y1 = scale * sin(angle * 3.14159 / 180);
*(int*)(cl->img.ptr + (a + (int)x1) * 4 +
((b + (int)y1) * cl->img.sizeline)) = color;
i += 0.1;
diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c
index 0c00a87..dd2be64 100644
--- a/src/ft_raycasting.c
+++ b/src/ft_raycasting.c
@@ -19,10 +19,10 @@ void
ft_calc_tex(t_cub *clist)
{
if (clist->rlist.side == 0)
- clist->rlist.wall_hit_x = (clist->plist->pos_x - clist->plist->start_x) +
+ clist->rlist.wall_hit_x = (clist->plist->pos_x) +
clist->rlist.wall_dist * clist->rlist.y_ray_dir;
else
- clist->rlist.wall_hit_x = (clist->plist->pos_y - clist->plist->start_y) +
+ clist->rlist.wall_hit_x = (clist->plist->pos_y) +
clist->rlist.wall_dist * clist->rlist.x_ray_dir;
clist->rlist.wall_hit_x -= floor(clist->rlist.wall_hit_x);
clist->tlist[clist->w_side].tex_x = (int)(clist->rlist.wall_hit_x *