aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_treat_args.c
diff options
context:
space:
mode:
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);