/* ************************************************************************** */ /* LE - / */ /* / */ /* ft_drawsquare.c .:: .:/ . .:: */ /* +:+:+ +: +: +:+:+ */ /* By: rbousset +:+ +: +: +:+ */ /* #+# #+ #+ #+# */ /* Created: 2020/02/02 17:19:22 by rbousset #+# ## ## #+# */ /* Updated: 2020/02/02 17:19:22 by rbousset ### #+. /#+ ###.fr */ /* / */ /* / */ /* ************************************************************************** */ #include #include #include void ft_drawsquare(int a, int b, int rgb, t_cub *clist) { const uint16_t scale = clist->scale; int x; int y; x = a; y = b; while (x > a - scale) { while (y > b - scale) { *(int*)(clist->img.ptr + (x * 4 + (y * clist->img.sizeline))) = rgb; y--; } y = b; x--; } }