aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_floor_cast.c4
-rw-r--r--src/ft_get_skybox.c2
-rw-r--r--src/ft_tex_init.c7
3 files changed, 10 insertions, 3 deletions
diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c
index 6111eca..104fb49 100644
--- a/src/ft_floor_cast.c
+++ b/src/ft_floor_cast.c
@@ -75,9 +75,9 @@ static void
ft_draw_extra_tex(6, y, x, cl);
else
ft_draw_plain_horizontal(cl->f_rgb, cl, y, x);
- if (cl->mlist.isctex)
+ if (cl->mlist.isctex && !cl->mlist.isskybox)
ft_draw_extra_tex(7, cl->wlist.y_size - y - 1, x, cl);
- else
+ else if (!cl->mlist.isctex && !cl->mlist.isskybox)
ft_draw_plain_horizontal(cl->c_rgb, cl, cl->wlist.y_size - y - 1, x);
}
diff --git a/src/ft_get_skybox.c b/src/ft_get_skybox.c
index 011bec7..47c395e 100644
--- a/src/ft_get_skybox.c
+++ b/src/ft_get_skybox.c
@@ -35,7 +35,7 @@ int8_t
}
if (ft_check_not_found(clist->mlist.skybox_path) < 0)
{
- ft_sprintf(clist->errmsg, FT_ERR_RD_NL_MAP);
+ ft_sprintf(clist->errmsg, FT_ERR_RD_SB);
return (-1);
}
clist->mlist.isskybox = 1;
diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c
index 38e4c77..4cbdf73 100644
--- a/src/ft_tex_init.c
+++ b/src/ft_tex_init.c
@@ -62,6 +62,13 @@ static void
ft_get_floor_tex(cl);
if (cl->mlist.isctex)
ft_get_ceil_tex(cl);
+ if (cl->mlist.isskybox)
+ {
+ cl->tlist[7].img = mlx_xpm_file_to_image(cl->wlist.wlx,
+ cl->mlist.skybox_path, &cl->tlist[7].img_w, &cl->tlist[7].img_h);
+ cl->tlist[7].ptr = mlx_get_data_addr(cl->tlist[7].img,
+ &cl->tlist[7].bpp, &cl->tlist[7].sizeline, &cl->tlist[7].endian);
+ }
cl->walltexgood = 1;
}