aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-28 15:21:21 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-28 15:21:21 +0100
commitc0264d533fc95639c8eeb570d131746f67d64fe9 (patch)
treea8e65f808c8c88060a3e22a130c8963e546619de
parentremoved bloat (diff)
download42-cub3d-c0264d533fc95639c8eeb570d131746f67d64fe9.tar.gz
42-cub3d-c0264d533fc95639c8eeb570d131746f67d64fe9.tar.bz2
42-cub3d-c0264d533fc95639c8eeb570d131746f67d64fe9.tar.xz
42-cub3d-c0264d533fc95639c8eeb570d131746f67d64fe9.tar.zst
42-cub3d-c0264d533fc95639c8eeb570d131746f67d64fe9.zip
Removed skybox related bloat
Diffstat (limited to '')
-rw-r--r--Makefile2
-rw-r--r--inc/cub3d.h2
-rw-r--r--inc/cub3d_structs.h2
-rw-r--r--src/ft_del_map.c1
-rw-r--r--src/ft_draw_scene.c2
-rw-r--r--src/ft_draw_skybox.c38
-rw-r--r--src/ft_floor_cast.c4
-rw-r--r--src/ft_floor_cast_inits.c2
-rw-r--r--src/ft_get_skybox.c43
-rw-r--r--src/ft_init_funptr.c2
-rw-r--r--src/ft_init_map.c2
-rw-r--r--src/ft_select_get.c2
-rw-r--r--src/ft_tex_init.c7
13 files changed, 3 insertions, 106 deletions
diff --git a/Makefile b/Makefile
index 2692ab5..fa7290f 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,6 @@ SRCS_NAME += ft_get_tex_nl.c
SRCS_NAME += ft_get_tex_extra.c
SRCS_NAME += ft_get_path_nl.c
SRCS_NAME += ft_get_nlvl_pos.c
-SRCS_NAME += ft_get_skybox.c
SRCS_NAME += ft_get_player_spawn.c
SRCS_NAME += ft_get_music.c
SRCS_NAME += ft_get_darkness.c
@@ -57,7 +56,6 @@ SRCS_NAME += ft_draw_square.c
SRCS_NAME += ft_draw_circle.c
SRCS_NAME += ft_draw_map.c
SRCS_NAME += ft_draw_scene.c
-SRCS_NAME += ft_draw_skybox.c
SRCS_NAME += ft_basic_keys.c
SRCS_NAME += ft_extra_keys.c
SRCS_NAME += ft_wall_cast.c
diff --git a/inc/cub3d.h b/inc/cub3d.h
index 3973a5b..f4f9552 100644
--- a/inc/cub3d.h
+++ b/inc/cub3d.h
@@ -97,7 +97,6 @@ void ft_calc_heal(t_cub *cl);
void ft_draw_heals(t_cub *cl, t_sprite *sprite);
void ft_calc_weaps(t_cub *cl);
void ft_draw_weapon(t_cub *cl, t_sprite *sprite);
-void ft_draw_skybox(t_cub *cl);
void ft_draw_handweap(t_cub *cl);
void ft_macos_suffer_animation(t_cub *cl);
void ft_linux_suffer_animation(t_cub *cl);
@@ -140,7 +139,6 @@ int8_t ft_get_c_color(char **words, t_cub *clist);
int8_t ft_get_c_tex(char **words, t_cub *clist);
int8_t ft_get_darkness(char **words, t_cub *clist);
int8_t ft_get_path_nl(char **words, t_cub *clist);
-int8_t ft_get_skybox(char **words, t_cub *clist);
int8_t ft_get_traps(char **words, t_cub *clist);
int8_t ft_get_tex_nl(char **words, t_cub *clist);
int8_t ft_get_music(char **words, t_cub *clist);
diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h
index 1b46312..ac87260 100644
--- a/inc/cub3d_structs.h
+++ b/inc/cub3d_structs.h
@@ -190,7 +190,6 @@ typedef struct s_map
char *fl_tex_path;
char *ce_tex_path;
char *nlevel_path;
- char *skybox_path;
char *traps_path;
char *music_path;
char *music_cmd;
@@ -220,7 +219,6 @@ typedef struct s_map
uint8_t ismusic;
uint8_t isftex;
uint8_t isctex;
- uint8_t isskybox;
uint8_t istraps;
uint8_t isheals;
uint8_t darklvl;
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,