From 3f95779e54a44ab15d566fbcbdc965d842d12786 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 6 Feb 2020 19:02:34 +0100 Subject: New scale function --- src/ft_set_minimap_scale.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/ft_set_minimap_scale.c (limited to 'src/ft_set_minimap_scale.c') diff --git a/src/ft_set_minimap_scale.c b/src/ft_set_minimap_scale.c new file mode 100644 index 0000000..5a69c18 --- /dev/null +++ b/src/ft_set_minimap_scale.c @@ -0,0 +1,10 @@ +#include + +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; +} -- cgit v1.2.3