From 9a83bb29755867739ed24c6cc7808048bcb8c488 Mon Sep 17 00:00:00 2001 From: gbrochar Date: Sat, 5 Oct 2024 11:29:47 +0200 Subject: [PATCH] libft compile + NOW SUPPORTS 8K RESOLUTION 8D --- libft | 2 +- src/parse_file.c | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/libft b/libft index 1ab0cdf..88ac066 160000 --- a/libft +++ b/libft @@ -1 +1 @@ -Subproject commit 1ab0cdf1acf97db0cb8d90940c96a6f1ccb3a7af +Subproject commit 88ac06645fbea2ba61d1df452c024ec7e6081c2f diff --git a/src/parse_file.c b/src/parse_file.c index 4d739bc..f6a2e32 100644 --- a/src/parse_file.c +++ b/src/parse_file.c @@ -47,8 +47,22 @@ void set_params(t_env *e, int argc, char **argv) e->window.height = atoi(argv[4]); if (argc >= 6) e->camera.fov = atof(argv[5]); - e->window.width = e->window.width < 640 ? 640 : e->window.width; - e->window.height = e->window.height < 480 ? 480 : e->window.height; + if (e->window.width > 7680) { + ft_putstr("window width has been adjusted to 7680, the maximum supported\n"); + e->window.width = 7680; + } + if (e->window.width < 240) { + ft_putstr("window width has been adjusted to 240, the minimum supported\n"); + e->window.width = 240; + } + if (e->window.height > 7680) { + ft_putstr("window height has been adjusted to 7680, the maximum supported\n"); + e->window.height = 7680; + } + if (e->window.height < 240) { + ft_putstr("window height has been adjusted to 240, the minimum supported\n"); + e->window.height = 240; + } e->camera.aspect = (double)e->window.width / (double)e->window.height; } @@ -57,3 +71,4 @@ int parse(t_env *e, int argc, char **argv) set_params(e, argc, argv); return (parse_file(e)); } +