From d7ca150c742d0154cf411bfce5bbf1f35c046e44 Mon Sep 17 00:00:00 2001 From: Theo Champion Date: Tue, 22 Jul 2025 12:12:36 +0200 Subject: [PATCH] fix: Changed return type of set_color() and converted types for colors --- src/map/mapdata.h | 34 +++++++++++++++++----------------- src/map/setters.c | 6 +++--- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/map/mapdata.h b/src/map/mapdata.h index c6e7f07..68984b5 100644 --- a/src/map/mapdata.h +++ b/src/map/mapdata.h @@ -6,7 +6,7 @@ /* By: kcolin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/07/17 14:58:19 by kcolin #+# #+# */ -/* Updated: 2025/07/17 15:57:59 by kcolin ### ########.fr */ +/* Updated: 2025/07/22 12:20:12 by tchampio ### ########.fr */ /* */ /* ************************************************************************** */ @@ -25,22 +25,22 @@ typedef enum e_direction typedef struct s_mapdata { - char *filename; - char *no_texture; - char *so_texture; - char *we_texture; - char *ea_texture; - int f_color; - int c_color; - int mapheight; - char **map; - char **mapflood; - int skipped_lines; - bool isvalid; - int startx; - int starty; - t_direction startdirection; - char error[1024]; + char *filename; + char *no_texture; + char *so_texture; + char *we_texture; + char *ea_texture; + unsigned int f_color; + unsigned int c_color; + int mapheight; + char **map; + char **mapflood; + int skipped_lines; + bool isvalid; + int startx; + int starty; + t_direction startdirection; + char error[1024]; } t_mapdata; #endif // MAPDATA_H diff --git a/src/map/setters.c b/src/map/setters.c index 42fe732..d936bab 100644 --- a/src/map/setters.c +++ b/src/map/setters.c @@ -6,7 +6,7 @@ /* By: kcolin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/06/21 19:35:43 by tchampio #+# #+# */ -/* Updated: 2025/07/22 12:11:28 by tchampio ### ########.fr */ +/* Updated: 2025/07/22 12:20:29 by tchampio ### ########.fr */ /* */ /* ************************************************************************** */ @@ -39,11 +39,11 @@ bool perform_color_checks(int *color, char *strcolor, t_mapdata *map) return (true); } -unsigned long set_color(const char *s, t_mapdata *map) +unsigned int set_color(const char *s, t_mapdata *map) { int i; bool isok; - unsigned long finalcolor; + unsigned int finalcolor; char **tab; int rgb[100];