From e29dd2fa3688e1e96a25af3b651da574af08aa90 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Thu, 13 Feb 2020 19:42:05 +0100 Subject: Splited structs --- src/ft_set_minimap_scale.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/ft_set_minimap_scale.c') diff --git a/src/ft_set_minimap_scale.c b/src/ft_set_minimap_scale.c index 0f79d6e..cd3424c 100644 --- a/src/ft_set_minimap_scale.c +++ b/src/ft_set_minimap_scale.c @@ -16,9 +16,12 @@ void ft_set_minimap_scale(t_cub *clist) { - ((clist->scale = (clist->wlist->x_size / (uint16_t)clist->map_w) - 1) < 1) - ? (clist->scale = 1) : 0; - (clist->wlist->y_size < (clist->map_h * clist->scale)) ? (clist->scale = - (clist->wlist->y_size / (uint16_t)clist->map_h) - 1) : 0; - (clist->scale >= 10) ? (clist->scale /= 4) : 0; + t_map *ml; + + ml = clist->mlist; + ((ml->scale = (clist->wlist->x_size / (uint16_t)ml->map_w) - 1) < 1) + ? (ml->scale = 1) : 0; + (clist->wlist->y_size < (ml->map_h * ml->scale)) ? (ml->scale = + (clist->wlist->y_size / (uint16_t)ml->map_h) - 1) : 0; + (ml->scale >= 10) ? (ml->scale /= 4) : 0; } -- cgit v1.2.3