42_solong/draw.c

48 lines
1.4 KiB
C
Raw Normal View History

2022-12-22 11:41:31 -05:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* draw.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/13 15:49:23 by cchauvet #+# #+# */
2023-01-06 13:37:36 -05:00
/* Updated: 2023/01/06 18:49:39 by cchauvet ### ########.fr */
2022-12-22 11:41:31 -05:00
/* */
/* ************************************************************************** */
#include "solong.h"
2023-01-06 13:37:36 -05:00
void ft_draw_xpm(void *mlx, void *window, char *img_path, size_t *cord)
2022-12-22 11:41:31 -05:00
{
int bozo;
2023-01-06 13:37:36 -05:00
void *img;
2022-12-22 11:41:31 -05:00
2023-01-04 14:07:13 -05:00
img = mlx_xpm_file_to_image(mlx, img_path, &bozo, &bozo);
mlx_put_image_to_window(mlx, window, img, cord[0], cord[1]);
mlx_destroy_image(mlx, img);
2022-12-22 11:41:31 -05:00
}
2023-01-06 13:37:36 -05:00
int ft_draw_map(void *mlx, void *window, t_map map)
{
size_t x;
size_t y;
map = ft_getmap(path);
if (map == NULL)
return (0);
if (ft_map_is_correct(map))
{
free(map);
return (0);
}
y = 0;
while (y < 0)
{
x = 0;
while (x < 0)
x++;
return (0);
}
return (1);
}