aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--map/map_one.cub12
-rw-r--r--map/map_two.cub8
-rw-r--r--src/ft_draw_textures.c1
-rw-r--r--src/ft_draw_verline.c3
-rw-r--r--src/ft_raycasting.c8
5 files changed, 13 insertions, 19 deletions
diff --git a/map/map_one.cub b/map/map_one.cub
index 6ecbbd1..aba8f38 100644
--- a/map/map_one.cub
+++ b/map/map_one.cub
@@ -1,9 +1,9 @@
R 1080 720
-NO ./map/img/BRIQUASSES.xpm
-SO ./map/img/BRIQUASSES_2.xpm
-EA ./map/img/BRIQUASSE_3.xpm
-WE ./map/img/MURLOL.xpm
+NO ./map/img/linuz.xpm
+SO ./map/img/linuz.xpm
+EA ./map/img/linuz.xpm
+WE ./map/img/linuz.xpm
S ./map/img/segfot.xpm
C 50,100,200
@@ -12,10 +12,10 @@ F 50,190,124
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1
1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
-1 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1
+1 N 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1
1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1
-1 0 0 1 0 0 S 0 0 0 0 0 0 0 0 0 0 1
+1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1
1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1
1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1
diff --git a/map/map_two.cub b/map/map_two.cub
index 99671c9..1553c25 100644
--- a/map/map_two.cub
+++ b/map/map_two.cub
@@ -1,9 +1,9 @@
-R 1920 1080
+R 1920 1024
-NO ./map/img/crapaud.xpm
-SO ./map/img/linus.xpm
+NO ./map/img/linuz.xpm
+SO ./map/img/linuz.xpm
EA ./map/img/linuz.xpm
-WE ./map/img/segfault2.xpm
+WE ./map/img/linuz.xpm
S ./map/img/segfot.xpm
C 50,100,200
diff --git a/src/ft_draw_textures.c b/src/ft_draw_textures.c
index 25a6863..0c86043 100644
--- a/src/ft_draw_textures.c
+++ b/src/ft_draw_textures.c
@@ -13,7 +13,6 @@
#include <libft.h>
#include <cub3d.h>
#include <stdint.h>
-#include <stdio.h>
/*
** 0 : no
diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c
index d144d87..d526b6a 100644
--- a/src/ft_draw_verline.c
+++ b/src/ft_draw_verline.c
@@ -11,7 +11,6 @@
/* ************************************************************************** */
#include <cub3d.h>
-#include <stdio.h>
static void
ft_draw_floor(t_cub *cl, int32_t y, int32_t x)
@@ -53,11 +52,9 @@ int8_t
d = (d <= 0) ? (-d) : (d);
tex_y = ((d * cl->tlist[cl->w_side].img_h) / cl->rlist.line_h) / 256;
(tex_y < 0) ? (tex_y = 0) : 0;
- /*if (!(tex_x % 2))*/
ft_draw_texture(cl, x, y, tex_y);
y++;
}
- /*printf("%d\n", cl->tlist[cl->w_side].tex_x);*/
ft_draw_floor(cl, y, x);
return (0);
}
diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c
index 1ad16e1..0c00a87 100644
--- a/src/ft_raycasting.c
+++ b/src/ft_raycasting.c
@@ -13,17 +13,16 @@
#include <libft.h>
#include <cub3d.h>
#include <stdint.h>
-#include <stdio.h>
#include <math.h>
void
ft_calc_tex(t_cub *clist)
{
if (clist->rlist.side == 0)
- clist->rlist.wall_hit_x = clist->plist->pos_y +
+ clist->rlist.wall_hit_x = (clist->plist->pos_x - clist->plist->start_x) +
clist->rlist.wall_dist * clist->rlist.y_ray_dir;
else
- clist->rlist.wall_hit_x = clist->plist->pos_x +
+ clist->rlist.wall_hit_x = (clist->plist->pos_y - clist->plist->start_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 *
@@ -31,10 +30,9 @@ void
if (clist->rlist.side == 0 && clist->rlist.x_ray_dir > 0)
clist->tlist[clist->w_side].tex_x = clist->tlist[clist->w_side].img_w
- clist->tlist[clist->w_side].tex_x - 1;
- if (clist->rlist.side == 1 && clist->rlist.y_ray_dir < 0)
+ else if (clist->rlist.side == 1 && clist->rlist.y_ray_dir < 0)
clist->tlist[clist->w_side].tex_x = clist->tlist[clist->w_side].img_w
- clist->tlist[clist->w_side].tex_x - 1;
- printf("dir :%f\ntex_x : %d\n", clist->rlist.y_ray_dir, clist->tlist[clist->w_side].tex_x);
}
static void