diff options
Diffstat (limited to 'reduced_system_layer.c')
-rwxr-xr-x | reduced_system_layer.c | 19 |
1 files changed, 15 insertions, 4 deletions
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; |