diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-05 00:30:41 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-05 00:30:41 +0100 |
commit | b729c722cb6fea7a88929e0054508bfa60c27ed5 (patch) | |
tree | ba6f02bee81a1cfd5144847f0f0e5e57d3332f7f /src/ft_save_to_bmp.c | |
parent | it's all black (diff) | |
download | 42-cub3d-b729c722cb6fea7a88929e0054508bfa60c27ed5.tar.gz 42-cub3d-b729c722cb6fea7a88929e0054508bfa60c27ed5.tar.bz2 42-cub3d-b729c722cb6fea7a88929e0054508bfa60c27ed5.tar.xz 42-cub3d-b729c722cb6fea7a88929e0054508bfa60c27ed5.tar.zst 42-cub3d-b729c722cb6fea7a88929e0054508bfa60c27ed5.zip |
How do I convert hex to rgb pls
Diffstat (limited to 'src/ft_save_to_bmp.c')
-rw-r--r-- | src/ft_save_to_bmp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ft_save_to_bmp.c b/src/ft_save_to_bmp.c index bc4547a..9526e62 100644 --- a/src/ft_save_to_bmp.c +++ b/src/ft_save_to_bmp.c @@ -47,7 +47,7 @@ static uint8_t *ft_convert_image_to_bmp(t_img img, t_cub *cl) { uint8_t *bmp; - t_rgb px; + t_bmp_rgb px; uint32_t y; uint32_t x; uint32_t i; @@ -63,7 +63,9 @@ static uint8_t x = -1; while (++x < cl->wlist.x_size) { - px = ft_hex_to_rgb(*(int*)(cl->img.ptr + (x * 4 + (y * cl->img.sizeline)))); + /* px = ft_hex_to_rgb(*(int*)(cl->img.ptr */ + /* + (x * 4 + (y * cl->img.sizeline)))); */ + px = ft_hex_to_rgb(0x00ff2222); *(bmp + i++) = (uint8_t)px.b; *(bmp + i++) = (uint8_t)px.g; *(bmp + i++) = (uint8_t)px.r; |