/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_draw_square.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 17:28:46 by rbousset #+# #+# */ /* Updated: 2020/02/14 17:28:46 by rbousset ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include void ft_draw_square(int a, int b, int rgb, t_cub *clist) { const uint16_t scale = clist->mlist.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--; } }