fix: Changed return type of set_color() and converted types for colors

This commit is contained in:
Theo Champion 2025-07-22 12:12:36 +02:00
parent 4b2f671107
commit d7ca150c74
2 changed files with 20 additions and 20 deletions

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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];