42_solong/draw.c
Camille Chauvet d7256c47a5 kekw
2023-01-06 19:37:36 +01:00

48 lines
1.4 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* draw.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/13 15:49:23 by cchauvet #+# #+# */
/* Updated: 2023/01/06 18:49:39 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "solong.h"
void ft_draw_xpm(void *mlx, void *window, char *img_path, size_t *cord)
{
int bozo;
void *img;
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);
}
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);
}