diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-22 23:19:52 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-22 23:19:52 +0100 |
commit | 7dc1b6b32f045649492f633f3edf1afa9d9fe0d3 (patch) | |
tree | 1effc3afde21c3015de2b6dc309e6ee0200b5a13 /src | |
parent | Perfect (diff) | |
download | 42-cub3d-7dc1b6b32f045649492f633f3edf1afa9d9fe0d3.tar.gz 42-cub3d-7dc1b6b32f045649492f633f3edf1afa9d9fe0d3.tar.bz2 42-cub3d-7dc1b6b32f045649492f633f3edf1afa9d9fe0d3.tar.xz 42-cub3d-7dc1b6b32f045649492f633f3edf1afa9d9fe0d3.tar.zst 42-cub3d-7dc1b6b32f045649492f633f3edf1afa9d9fe0d3.zip |
Secured weird screen size % 10 bug
Diffstat (limited to 'src')
-rw-r--r-- | src/ft_get_res.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ft_get_res.c b/src/ft_get_res.c index dece00f..26853be 100644 --- a/src/ft_get_res.c +++ b/src/ft_get_res.c @@ -31,6 +31,15 @@ static int8_t return (0); } +static void + ft_securize_scr(t_win *wl) +{ + while (wl->x_size % 10) + wl->x_size -= 1; + while (wl->y_size % 10) + wl->y_size -= 1; +} + int8_t ft_get_res(char **words, t_cub *clist) { @@ -57,5 +66,6 @@ int8_t } if (ft_get_screen_size(wlist) < 0) return (-1); + ft_securize_scr(wlist); return (0); } |