-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.c
24 lines (21 loc) · 1.16 KB
/
utils.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bmacmaho <bmacmaho@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/20 15:26:11 by bmacmaho #+# #+# */
/* Updated: 2023/05/30 19:31:09 by bmacmaho ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
void ft_safe_draw(mlx_image_t *img, int x, int y, int colour)
{
if (x >= 0 && x < img->width && y >= 0 && y < img->height)
mlx_put_pixel(img, x, y, colour);
}
int ft_rgba_to_int(int32_t r, int32_t g, int32_t b, int32_t a)
{
return (r << 24 | g << 16 | b << 8 | a);
}