diff options
author | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-02-04 20:38:07 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-02-04 20:38:07 +0100 |
commit | eae1fb0d6dd36d3bb7878a921f5a6398df62eea2 (patch) | |
tree | 377464db5a2b34ceab61a00cba8b9ebdd32e930d | |
parent | Ok colors (diff) | |
download | 42-cub3d-eae1fb0d6dd36d3bb7878a921f5a6398df62eea2.tar.gz 42-cub3d-eae1fb0d6dd36d3bb7878a921f5a6398df62eea2.tar.bz2 42-cub3d-eae1fb0d6dd36d3bb7878a921f5a6398df62eea2.tar.xz 42-cub3d-eae1fb0d6dd36d3bb7878a921f5a6398df62eea2.tar.zst 42-cub3d-eae1fb0d6dd36d3bb7878a921f5a6398df62eea2.zip |
quick af
Diffstat (limited to '')
-rw-r--r-- | src/ft_drawmap.c | 9 | ||||
-rw-r--r-- | src/ft_drawsquare.c | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/ft_drawmap.c b/src/ft_drawmap.c index 0380f2d..4d78426 100644 --- a/src/ft_drawmap.c +++ b/src/ft_drawmap.c @@ -55,7 +55,14 @@ static void void ft_drawmap(t_cub *clist) { - mlx_clear_window(clist->wlist->wlx, clist->wlist->winptr); + 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_draw_core_map(clist->map, clist); ft_draw_player(clist->plist, clist); + /* mlx_clear_window(clist->wlist->wlx, clist->wlist->winptr); */ + mlx_put_image_to_window(clist->wlist->wlx, + clist->wlist->winptr, clist->img.img, 0, 0); + mlx_destroy_image(clist->wlist->wlx, clist->img.img); } diff --git a/src/ft_drawsquare.c b/src/ft_drawsquare.c index 211f122..f23bd79 100644 --- a/src/ft_drawsquare.c +++ b/src/ft_drawsquare.c @@ -26,7 +26,8 @@ void { while (y > b - 40) { - mlx_pixel_put(clist->wlist->wlx, clist->wlist->winptr, x, y, rgb); + /* mlx_pixel_put(clist->wlist->wlx, clist->wlist->winptr, x, y, rgb); */ + *(int*)(clist->img.ptr + (x * 4 + (y * clist->img.sizeline))) = rgb; y--; } y = b; |