aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_treat_args.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-22 16:58:26 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-22 16:58:26 +0100
commitb34688558a7b9d2b1f95c00a33197cdc017e8dc5 (patch)
tree51c0339d1252a1384113767f1efa5a285f05b325 /src/ft_treat_args.c
parentRaycasting normed (diff)
download42-cub3d-b34688558a7b9d2b1f95c00a33197cdc017e8dc5.tar.gz
42-cub3d-b34688558a7b9d2b1f95c00a33197cdc017e8dc5.tar.bz2
42-cub3d-b34688558a7b9d2b1f95c00a33197cdc017e8dc5.tar.xz
42-cub3d-b34688558a7b9d2b1f95c00a33197cdc017e8dc5.tar.zst
42-cub3d-b34688558a7b9d2b1f95c00a33197cdc017e8dc5.zip
Norm so far
Diffstat (limited to 'src/ft_treat_args.c')
-rw-r--r--src/ft_treat_args.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/ft_treat_args.c b/src/ft_treat_args.c
index cf487f7..19da836 100644
--- a/src/ft_treat_args.c
+++ b/src/ft_treat_args.c
@@ -29,6 +29,18 @@ uint8_t
return (0);
}
+static void
+ ft_init_macos_img(t_cub *clist)
+{
+ if (FT_OS == 1)
+ {
+ clist->img.img = mlx_new_image(clist->wlist.wlx,
+ clist->wlist.x_size, clist->wlist.y_size);
+ clist->img.ptr = mlx_get_data_addr(clist->img.img, &clist->img.bpp,
+ &clist->img.sizeline, &clist->img.endian);
+ }
+}
+
uint8_t
ft_use_args(int argc, const char *argv[], t_cub *clist)
{
@@ -38,13 +50,8 @@ uint8_t
return (ft_exit(FT_RET_FAILED_MLX, clist));
ft_wall_tex_init(clist);
ft_weap_tex_init(clist);
- if (FT_OS == 1)
- {
- clist->img.img = mlx_new_image(clist->wlist.wlx,
- clist->wlist.x_size, clist->wlist.y_size);
- clist->img.ptr = mlx_get_data_addr(clist->img.img, &clist->img.bpp,
- &clist->img.sizeline, &clist->img.endian);
- }
+ ft_num_tex_init(clist);
+ ft_init_macos_img(clist);
ft_draw_scene(clist);
if (clist->mlist.ismusic)
ft_enable_music(clist);