aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_drawsquare.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-02-04 23:45:21 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-02-04 23:45:21 +0100
commit20a7a10c762d2d81d3f749d08d4da3f56a045dce (patch)
tree0e04d3d6b0828b4b65e1bb4d49b464678492b03d /src/ft_drawsquare.c
parentPretty good (diff)
download42-cub3d-20a7a10c762d2d81d3f749d08d4da3f56a045dce.tar.gz
42-cub3d-20a7a10c762d2d81d3f749d08d4da3f56a045dce.tar.bz2
42-cub3d-20a7a10c762d2d81d3f749d08d4da3f56a045dce.tar.xz
42-cub3d-20a7a10c762d2d81d3f749d08d4da3f56a045dce.tar.zst
42-cub3d-20a7a10c762d2d81d3f749d08d4da3f56a045dce.zip
Scale
Diffstat (limited to '')
-rw-r--r--src/ft_drawsquare.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ft_drawsquare.c b/src/ft_drawsquare.c
index 1488c68..9e23937 100644
--- a/src/ft_drawsquare.c
+++ b/src/ft_drawsquare.c
@@ -11,20 +11,22 @@
/* / */
/* ************************************************************************** */
-#include <mlx.h>
#include <cub3d.h>
+#include <mlx.h>
+#include <stdint.h>
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 - 40)
+ while (x > a - scale)
{
- while (y > b - 40)
+ while (y > b - scale)
{
*(int*)(clist->img.ptr + (x * 4 + (y * clist->img.sizeline))) = rgb;
y--;