diff options
author | Rudy Bousset <rbousset@z2r4p1.le-101.fr> | 2020-03-11 16:07:29 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r4p1.le-101.fr> | 2020-03-11 16:07:29 +0100 |
commit | 7f77c9bc922fb608f689385d642304956afe0492 (patch) | |
tree | 50ccbb70b2f39f6dbe2d8336165eea47b6b5c048 /src/ft_suffer_animation.c | |
parent | qweqwe (diff) | |
download | 42-cub3d-7f77c9bc922fb608f689385d642304956afe0492.tar.gz 42-cub3d-7f77c9bc922fb608f689385d642304956afe0492.tar.bz2 42-cub3d-7f77c9bc922fb608f689385d642304956afe0492.tar.xz 42-cub3d-7f77c9bc922fb608f689385d642304956afe0492.tar.zst 42-cub3d-7f77c9bc922fb608f689385d642304956afe0492.zip |
Performance
Diffstat (limited to 'src/ft_suffer_animation.c')
-rw-r--r-- | src/ft_suffer_animation.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/ft_suffer_animation.c b/src/ft_suffer_animation.c index 2a1beb4..1a9b51a 100644 --- a/src/ft_suffer_animation.c +++ b/src/ft_suffer_animation.c @@ -21,24 +21,26 @@ void { int32_t x; int32_t y; - int8_t i; + int32_t col; + t_rgb rgb; - /* cl->red_scr.img = mlx_new_image(cl->wlist.wlx, */ - /* cl->wlist.x_size, cl->wlist.y_size); */ - /* cl->red_scr.ptr = mlx_get_data_addr(cl->red_scr.img, &cl->red_scr.bpp, */ - /* &cl->red_scr.sizeline, &cl->red_scr.endian); */ y = -1; + col = 0x00880000; while (++y < (int32_t)cl->wlist.y_size) { x = -1; while (++x < (int32_t)cl->wlist.x_size) + { + rgb = ft_hex_to_og_rgb(*(int*)(cl->img.ptr + + (x * 4 + (y * cl->img.sizeline)))); + rgb.r += 120; *(int*)(cl->img.ptr + - (x * 4 + (y * cl->img.sizeline))) = 0x00ffffff; + (x * 4 + (y * cl->img.sizeline))) = ft_rgb_to_hex(rgb); + } + /* if (y < (int32_t)cl->wlist.y_size / 2) */ + /* col += 0x00000000; */ + /* else */ + /* col -= 0x00000000; */ } - i = -1; - mlx_put_image_to_window(cl->wlist.wlx, - cl->wlist.winptr, cl->img.img, 0, 0); - sleep(5); - /* while (++i < 120) */ - /* mlx_destroy_image(cl->wlist.wlx, cl->red_scr.img); */ + cl->doicast = 0; } |