cube_utils.c
1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* cube_utils.c :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* By: ll-hotel <ll-hotel@student.42.fr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* Created: 2024/07/25 16:42:05 by ll-hotel #+# #+# */ 9 /* Updated: 2024/10/20 17:01:16 by ll-hotel ### ########.fr */ 10 /* */ 11 /* ************************************************************************** */ 12 13 #include "cub3D.h" 14 #include "mlx.h" 15 #include "ft_basics.h" 16 17 void cube_put_image(t_cube *cube) 18 { 19 mlx_put_image_to_window(cube->mlx.ptr, \ 20 cube->mlx.win, \ 21 cube->mlx.img.ptr, \ 22 0, 0); 23 } 24 25 void ft_strtrim_inplace(char *str) 26 { 27 int start; 28 int length; 29 int end; 30 31 if (str == (void *)0) 32 return ; 33 start = 0; 34 while (str[start] == ' ') 35 start += 1; 36 end = start; 37 while (str[end] != 0 && str[end] != ' ') 38 end += 1; 39 length = end - start; 40 str[end] = 0; 41 ft_memmove(str, &str[start], length); 42 }