diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_del_map.c | 1 | ||||
-rw-r--r-- | src/ft_draw_scene.c | 2 | ||||
-rw-r--r-- | src/ft_draw_skybox.c | 38 | ||||
-rw-r--r-- | src/ft_floor_cast.c | 4 | ||||
-rw-r--r-- | src/ft_floor_cast_inits.c | 2 | ||||
-rw-r--r-- | src/ft_get_skybox.c | 43 | ||||
-rw-r--r-- | src/ft_init_funptr.c | 2 | ||||
-rw-r--r-- | src/ft_init_map.c | 2 | ||||
-rw-r--r-- | src/ft_select_get.c | 2 | ||||
-rw-r--r-- | src/ft_tex_init.c | 7 |
10 files changed, 3 insertions, 100 deletions
diff --git a/src/ft_del_map.c b/src/ft_del_map.c index 0c03007..49b9db9 100644 --- a/src/ft_del_map.c +++ b/src/ft_del_map.c @@ -26,7 +26,6 @@ void ft_memdel((void*)&ml->fl_tex_path); ft_memdel((void*)&ml->ce_tex_path); ft_memdel((void*)&ml->nlevel_path); - ft_memdel((void*)&ml->skybox_path); ft_memdel((void*)&ml->traps_path); ft_memdel((void*)&ml->music_path); ft_memdel((void*)&ml->music_cmd); diff --git a/src/ft_draw_scene.c b/src/ft_draw_scene.c index 86009f6..a76f403 100644 --- a/src/ft_draw_scene.c +++ b/src/ft_draw_scene.c @@ -65,8 +65,6 @@ void clist->doicast = 1; if (clist->ishud) ft_draw_hud(clist); - if (clist->mlist.isskybox) - ft_draw_skybox(clist); mlx_put_image_to_window(clist->wlist.wlx, clist->wlist.winptr, clist->img.img, 0, 0); if (FT_OS == 2) diff --git a/src/ft_draw_skybox.c b/src/ft_draw_skybox.c deleted file mode 100644 index a446485..0000000 --- a/src/ft_draw_skybox.c +++ /dev/null @@ -1,38 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_draw_skybox.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/02/14 17:22:57 by rbousset #+# #+# */ -/* Updated: 2020/02/14 17:23:42 by rbousset ### ########lyon.fr */ -/* */ -/* ************************************************************************** */ - -#include <cub3d.h> -#include <mlx.h> - -void - ft_draw_skybox(t_cub *cl) -{ - int offset; - - offset = 640; - if (cl->plist.dir_x > 0) - offset = -offset; - mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr, - cl->tlist[7].img, offset * cl->plist.dir_y, -125); - mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr, - cl->tlist[7].img, offset * cl->plist.dir_y, -125); - mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr, - cl->tlist[7].img, offset * cl->plist.dir_y, -125); - mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr, - cl->tlist[7].img, offset * cl->plist.dir_y, -125); - mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr, - cl->tlist[7].img, offset * cl->plist.dir_y, -125); - mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr, - cl->tlist[7].img, offset * cl->plist.dir_y, -125); - mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr, - cl->tlist[7].img, offset * cl->plist.dir_y, -125); -} diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c index 347f8d0..08f84c5 100644 --- a/src/ft_floor_cast.c +++ b/src/ft_floor_cast.c @@ -55,11 +55,11 @@ void } else ft_draw_plain_horizontal(cl->f_rgb, cl, y, x); - if (cl->mlist.isctex && !cl->mlist.isskybox) + if (cl->mlist.isctex) { ft_draw_extra_tex(7, cl->wlist.y_size - y - 1, x, cl); } - else if (!cl->mlist.isctex && !cl->mlist.isskybox) + else if (!cl->mlist.isctex) ft_draw_plain_horizontal(cl->c_rgb, cl, cl->wlist.y_size - y - 1, x); } diff --git a/src/ft_floor_cast_inits.c b/src/ft_floor_cast_inits.c index 68bb0c7..92b660b 100644 --- a/src/ft_floor_cast_inits.c +++ b/src/ft_floor_cast_inits.c @@ -61,7 +61,7 @@ void { if (cl->mlist.isftex) ft_set_fc_tex_xy(6, x, y, cl); - if (cl->mlist.isctex && !cl->mlist.isskybox) + if (cl->mlist.isctex) ft_set_fc_tex_xy(7, x, cl->wlist.y_size - y - 1, cl); } cl->rlist.x_floor += cl->mlist.x_floor_step; diff --git a/src/ft_get_skybox.c b/src/ft_get_skybox.c deleted file mode 100644 index 1e55b85..0000000 --- a/src/ft_get_skybox.c +++ /dev/null @@ -1,43 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* ft_get_skybox.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/02/24 20:22:45 by rbousset #+# #+# */ -/* Updated: 2020/03/09 18:56:01 by rbousset ### ########lyon.fr */ -/* */ -/* ************************************************************************** */ - -#include <libft.h> -#include <cub3d.h> -#include <stdint.h> - -int8_t - ft_get_skybox(char **words, t_cub *clist) -{ - if (!(*words) || !(*(words + 1)) || (*(words + 2))) - { - ft_sprintf(clist->errmsg, FT_ERR_ARGS); - return (-1); - } - if (ft_check_ext(*(words + 1), ".xpm") < 0) - { - ft_sprintf(clist->errmsg, FT_ERR_NOT_A_XPM); - return (-1); - } - ft_memdel((void*)&clist->mlist.skybox_path); - if (!(clist->mlist.skybox_path = ft_strdup(*(words + 1)))) - { - ft_sprintf(clist->errmsg, FT_ERR_ALLOCATE); - return (-1); - } - if (ft_check_not_found(clist->mlist.skybox_path) < 0) - { - ft_sprintf(clist->errmsg, FT_ERR_RD_SB); - return (-1); - } - clist->mlist.isskybox = 1; - return (0); -} diff --git a/src/ft_init_funptr.c b/src/ft_init_funptr.c index d944778..8702277 100644 --- a/src/ft_init_funptr.c +++ b/src/ft_init_funptr.c @@ -28,7 +28,6 @@ void ft_sprintf(clist->ref[9], "LT"); ft_sprintf(clist->ref[10], "MU"); ft_sprintf(clist->ref[11], "SH"); - ft_sprintf(clist->ref[12], "SB"); ft_sprintf(clist->ref[13], "T"); ft_sprintf(clist->ref[14], "S3"); ft_sprintf(clist->ref[15], "S4"); @@ -61,6 +60,5 @@ void clist->get_ptr[9] = ft_get_tex_nl; clist->get_ptr[10] = ft_get_music; clist->get_ptr[11] = ft_get_darkness; - clist->get_ptr[12] = ft_get_skybox; clist->get_ptr[13] = ft_get_traps; } diff --git a/src/ft_init_map.c b/src/ft_init_map.c index d252f2e..e0c232c 100644 --- a/src/ft_init_map.c +++ b/src/ft_init_map.c @@ -28,7 +28,6 @@ static int8_t !(mlist->fl_tex_path = (char*)ft_calloc(1, sizeof(char))) || !(mlist->ce_tex_path = (char*)ft_calloc(1, sizeof(char))) || !(mlist->nlevel_path = (char*)ft_calloc(1, sizeof(char))) || - !(mlist->skybox_path = (char*)ft_calloc(1, sizeof(char))) || !(mlist->traps_path = (char*)ft_calloc(1, sizeof(char))) || !(mlist->music_path = (char*)ft_calloc(1, sizeof(char))) || !(mlist->music_cmd = (char*)ft_calloc(1, sizeof(char))) || @@ -96,7 +95,6 @@ int8_t mlist->isctex = 0; mlist->isnlvl = 0; mlist->ismusic = 0; - mlist->isskybox = 0; mlist->istraps = 0; mlist->isheals = 0; mlist->traps_nbr = 0; diff --git a/src/ft_select_get.c b/src/ft_select_get.c index 143dc09..2c37b8f 100644 --- a/src/ft_select_get.c +++ b/src/ft_select_get.c @@ -53,8 +53,6 @@ static int8_t return (-1); if (ret == 10 && (clist->mlist.music_path[0])) return (-1); - if (ret == 12 && (clist->mlist.skybox_path[0])) - return (-1); if (ret == 13 && (clist->mlist.traps_path[0])) return (-1); if (ret > 13 && ret < 21 && (clist->mlist.sprite_path[ret - 13][0])) diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c index a6eec43..e2fef5e 100644 --- a/src/ft_tex_init.c +++ b/src/ft_tex_init.c @@ -91,13 +91,6 @@ static void cl->tlist[17].ptr = mlx_get_data_addr(cl->tlist[17].img, &cl->tlist[17].bpp, &cl->tlist[17].sizeline, &cl->tlist[17].endian); } - 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); - } else if (cl->mlist.isctex) { cl->tlist[7].img = mlx_xpm_file_to_image(cl->wlist.wlx, |