From e2bc261c830a91f5961dd2d3831f3955ce9cd6eb Mon Sep 17 00:00:00 2001 From: Verdatim Date: Wed, 26 Aug 2026 18:09:59 +0800 Subject: [PATCH] Add a command to disable the splash window when starting the game --- src/xrEngine/x_ray.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/xrEngine/x_ray.cpp b/src/xrEngine/x_ray.cpp index 7c9df2b6ae..10615defe9 100644 --- a/src/xrEngine/x_ray.cpp +++ b/src/xrEngine/x_ray.cpp @@ -1033,8 +1033,8 @@ int APIENTRY WinMain_impl(HINSTANCE hInstance, #endif // DEDICATED_SERVER // Title window - logoWindow = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_STARTUP), 0, logDlgProc); - + logoWindow = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_STARTUP), 0, logDlgProc); + HWND logoPicture = GetDlgItem(logoWindow, IDC_STATIC_LOGO); RECT logoRect; GetWindowRect(logoPicture, &logoRect); @@ -1048,6 +1048,13 @@ int APIENTRY WinMain_impl(HINSTANCE hInstance, int x = monX + (screenW - splashW) / 2; int y = monY + (screenH - splashH) / 2; + // verdatim: set the size of the splash window to be zero when the flag "-nosplashwindow" is given + if (strstr(xr_strdup(GetCommandLine()), "-nosplashwindow")) { + splashW = int(0); + splashH = int(0); + } + + SetWindowPos( logoWindow, #ifndef DEBUG @@ -1061,7 +1068,7 @@ int APIENTRY WinMain_impl(HINSTANCE hInstance, splashH, SWP_SHOWWINDOW ); - + UpdateWindow(logoWindow); // AVI