aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_set_minimap_scale.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z3r8p1.le-101.fr>2020-02-13 19:42:05 +0100
committerRudy Bousset <rbousset@z3r8p1.le-101.fr>2020-02-13 19:42:05 +0100
commite29dd2fa3688e1e96a25af3b651da574af08aa90 (patch)
treecb6486fc91f1b93e61e4dcda25d359095e6aa108 /src/ft_set_minimap_scale.c
parentBetter code structure (diff)
download42-cub3d-e29dd2fa3688e1e96a25af3b651da574af08aa90.tar.gz
42-cub3d-e29dd2fa3688e1e96a25af3b651da574af08aa90.tar.bz2
42-cub3d-e29dd2fa3688e1e96a25af3b651da574af08aa90.tar.xz
42-cub3d-e29dd2fa3688e1e96a25af3b651da574af08aa90.tar.zst
42-cub3d-e29dd2fa3688e1e96a25af3b651da574af08aa90.zip
Splited structs
Diffstat (limited to 'src/ft_set_minimap_scale.c')
-rw-r--r--src/ft_set_minimap_scale.c13
1 files changed, 8 insertions, 5 deletions
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;
}