diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-04 16:36:54 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-04 16:36:54 +0100 |
commit | 30b664f648b80d5a6df1ad5982a9a390c304db69 (patch) | |
tree | f2a0f4f2a6931dab1081e03b9de9aeb8808d1932 | |
parent | More tab (diff) | |
download | 42-cub3d-30b664f648b80d5a6df1ad5982a9a390c304db69.tar.gz 42-cub3d-30b664f648b80d5a6df1ad5982a9a390c304db69.tar.bz2 42-cub3d-30b664f648b80d5a6df1ad5982a9a390c304db69.tar.xz 42-cub3d-30b664f648b80d5a6df1ad5982a9a390c304db69.tar.zst 42-cub3d-30b664f648b80d5a6df1ad5982a9a390c304db69.zip |
Compiles
-rw-r--r-- | inc/cub3d.h | 4 | ||||
-rw-r--r-- | src/ft_init_bmp.c | 21 | ||||
-rw-r--r-- | src/ft_save_to_bmp.c | 2 |
3 files changed, 18 insertions, 9 deletions
diff --git a/inc/cub3d.h b/inc/cub3d.h index 8643c5c..a80cfd5 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -31,7 +31,7 @@ t_rgb ft_init_rgb(void); int8_t ft_init_map(t_map *mlist); t_bmp_file ft_init_bmp(void); t_bmp_info ft_init_bmp_info(void); -t_bmp_colors ft_init_bmp_colors(void) +t_bmp_colors ft_init_bmp_colors(void); /* ** ====== HOOKS ====== @@ -123,7 +123,7 @@ void ft_set_minimap_scale(t_cub *clist); void *ft_music_thread(void *vargp); void ft_detect(t_cub *cl); void ft_castray(t_cub *cl); -int8_t ft_save_to_bmp(t_bmp_file *bmp_file, void *img, t_cub *cl); +int8_t ft_save_to_bmp(void *img, t_cub *cl); int ft_error(uint8_t retval, const char *errmsg, t_cub *clist); uint8_t ft_free_words(char **words); int8_t ft_warp_level(t_cub *cl); diff --git a/src/ft_init_bmp.c b/src/ft_init_bmp.c index e3fab01..8e94eba 100644 --- a/src/ft_init_bmp.c +++ b/src/ft_init_bmp.c @@ -17,17 +17,22 @@ t_bmp_colors ft_init_bmp_colors(void) { - bmp_colors->red_mask = 0x00ff0000; - bmp_colors->green_mask = 0x0000ff00; - bmp_colors->blue_mask = 0x000000ff; - bmp_colors->alpha_mask = 0xff000000; - bmp_colors->color_space_type = 0x73524742; - ft_bzero(bmp_colors, 16); + t_bmp_colors bmp_colors; + + bmp_colors.red_mask = 0x00ff0000; + bmp_colors.green_mask = 0x0000ff00; + bmp_colors.blue_mask = 0x000000ff; + bmp_colors.alpha_mask = 0xff000000; + bmp_colors.color_space_type = 0x73524742; + ft_bzero(bmp_colors.unused, 16); + return (bmp_colors); } t_bmp_info ft_init_bmp_info(void) { + t_bmp_info bmp_info; + bmp_info.size = 0; bmp_info.width = 0; bmp_info.height = 0; @@ -39,14 +44,18 @@ t_bmp_info bmp_info.y_pixels_per_meter = 0; bmp_info.colors_used = 0; bmp_info.colors_important = 0; + return (bmp_info); } t_bmp_file ft_init_bmp(void) { + t_bmp_file bmp_file; + bmp_file.file_type = 0x4d42; bmp_file.file_size = 0; bmp_file.reserv_one = 0; bmp_file.reserv_two = 0; bmp_file.offset_data = 0; + return (bmp_file); } diff --git a/src/ft_save_to_bmp.c b/src/ft_save_to_bmp.c index cb3fa9b..d751ea0 100644 --- a/src/ft_save_to_bmp.c +++ b/src/ft_save_to_bmp.c @@ -16,7 +16,7 @@ #include <stdint.h> static int8_t - ft_convert_image_to_bmp(t_bmp_file *bmp_file, void *img, t_cub *cl) + ft_convert_image_to_bmp(t_bmp_file bmp_file, void *img, t_cub *cl) { int32_t filelen; uint8_t *bmp; |