From 207c4df8edd0d460c51722d9b37646b018435be6 Mon Sep 17 00:00:00 2001 From: theTwister <6237734+twist84@users.noreply.github.com> Date: Sat, 14 Sep 2024 12:01:58 +0100 Subject: [PATCH] Updated `-centered` --- game/source/rasterizer/rasterizer.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/game/source/rasterizer/rasterizer.cpp b/game/source/rasterizer/rasterizer.cpp index 3b1da68b6..4bdefbe8e 100644 --- a/game/source/rasterizer/rasterizer.cpp +++ b/game/source/rasterizer/rasterizer.cpp @@ -527,13 +527,21 @@ void __cdecl c_rasterizer::initialize_window() long height = display_height; global_preferences_get_screen_resolution(&width, &height); + int window_x = 0; + int window_y = 0; + if (strstr(shell_get_command_line(), "-centered") != 0) + { + window_x = (GetSystemMetrics(SM_CXSCREEN) - width) / 2; + window_y = (GetSystemMetrics(SM_CYSCREEN) - height) / 2; + } + HWND window_handle_created = CreateWindowExA( 0, g_windows_params.class_name, g_windows_params.window_name, WS_TILEDWINDOW, - 0, - 0, + window_x, + window_y, width, height, GetDesktopWindow(), @@ -544,14 +552,6 @@ void __cdecl c_rasterizer::initialize_window() if (window_handle_created != NULL) { - int window_x = 0; - int window_y = 0; - if (strstr(shell_get_command_line(), "-centered") != 0) - { - window_x = (GetSystemMetrics(SM_CXSCREEN) - width) / 2; - window_y = (GetSystemMetrics(SM_CYSCREEN) - height) / 2; - } - BOOL window_position_set = SetWindowPos( window_handle_created, HWND_NOTOPMOST,