aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_set_minimap_scale.c
blob: cd3424cb04b4fdfa9a66785078d289d107f21c8f (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
27
/* ************************************************************************** */
/*                                                          LE - /            */
/*                                                              /             */
/*   ft_set_minimap_scale.c                           .::    .:/ .      .::   */
/*                                                 +:+:+   +:    +:  +:+:+    */
/*   By: rbousset <marvin@le-101.fr>                +:+   +:    +:    +:+     */
/*                                                 #+#   #+    #+    #+#      */
/*   Created: 2020/02/09 14:33:30 by rbousset     #+#   ##    ##    #+#       */
/*   Updated: 2020/02/09 14:33:31 by rbousset    ###    #+. /#+    ###.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;
}