aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_set_minimap_scale.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_set_minimap_scale.c')
-rw-r--r--src/ft_set_minimap_scale.c10
1 files changed, 10 insertions, 0 deletions
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 <cub3d.h>
+
+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;
+}