aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_set_minimap_scale.c
blob: 52c63e6cdf3c5209282073f7b01ff835e79d45dc (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;
}