From dced6f7768e02252af11f9b41017d75c66b47d81 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Tue, 14 Jan 2025 06:33:54 +0100 Subject: Correct examples for changed graphics procs --- reduced_system_layer.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'reduced_system_layer.c') diff --git a/reduced_system_layer.c b/reduced_system_layer.c index 3d020bd..522d672 100755 --- a/reduced_system_layer.c +++ b/reduced_system_layer.c @@ -1254,10 +1254,21 @@ void p_init(void) { i32 display_width = DisplayWidth (_display, screen); i32 display_height = DisplayHeight(_display, screen); - if (g_platform.frame_width <= 0) - g_platform.frame_width = 400; - if (g_platform.frame_height <= 0) - g_platform.frame_height = 300; + if (g_platform.frame_width <= 0 || g_platform.frame_height <= 0) { + if (display_width >= 1680 && display_height >= 1020) { + g_platform.frame_width = 1280; + g_platform.frame_height = 720; + } else if (display_width >= 800 && display_height >= 600) { + g_platform.frame_width = display_width - 400; + g_platform.frame_height = display_height - 300; + } else if (display_width >= 400 && display_height >= 300) { + g_platform.frame_width = 400; + g_platform.frame_height = 300; + } else { + g_platform.frame_width = display_width; + g_platform.frame_height = display_height; + } + } i32 x = (display_width - g_platform.frame_width) / 2; i32 y = (display_height - g_platform.frame_height) / 2; -- cgit v1.2.3