blob: 9fa5a85a6a0ff43df07e410bec986bee3c84642d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_set_minimap_scale.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/14 17:28:59 by rbousset #+# #+# */
/* Updated: 2020/02/14 17:28:59 by rbousset ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include <cub3d.h>
void
ft_set_minimap_scale(t_cub *clist)
{
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;
}
|