Skip to content

Commit 03e0948

Browse files
ShokerStlkXottab-DUTY
authored andcommitted
Added new startup keys for engine:
-nosplash - removes the splash screen at engine launch. -splashnotop - allow to hide the splash screen by another window
1 parent d48ff90 commit 03e0948

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/xrEngine/main.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,11 @@ void Startup()
178178
g_SpatialSpace = new ISpatial_DB("Spatial obj");
179179
g_SpatialSpacePhysic = new ISpatial_DB("Spatial phys");
180180
// Destroy LOGO
181-
DestroyWindow(logoWindow);
182-
logoWindow = nullptr;
181+
if (logoWindow != nullptr)
182+
{
183+
DestroyWindow(logoWindow);
184+
logoWindow = nullptr;
185+
}
183186
// Main cycle
184187
Memory.mem_usage();
185188
Device.Run();
@@ -320,18 +323,21 @@ int RunApplication(pcstr commandLine)
320323
}
321324
#endif
322325
//SetThreadAffinityMask(GetCurrentThread(), 1);
323-
logoWindow = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_STARTUP), nullptr, LogoWndProc);
324-
HWND logoPicture = GetDlgItem(logoWindow, IDC_STATIC_LOGO);
325-
RECT logoRect;
326-
GetWindowRect(logoPicture, &logoRect);
326+
if (strstr(commandLine, "-nosplash") == 0)
327+
{
328+
logoWindow = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_STARTUP), nullptr, LogoWndProc);
329+
HWND logoPicture = GetDlgItem(logoWindow, IDC_STATIC_LOGO);
330+
RECT logoRect;
331+
GetWindowRect(logoPicture, &logoRect);
327332
#ifndef DEBUG
328-
HWND prevWindow = HWND_TOPMOST;
333+
HWND prevWindow = (strstr(commandLine, "-splashnotop") == NULL) ? HWND_TOPMOST : HWND_NOTOPMOST;
329334
#else
330-
HWND prevWindow = HWND_NOTOPMOST;
335+
HWND prevWindow = HWND_NOTOPMOST;
331336
#endif
332-
SetWindowPos(logoWindow, prevWindow, 0, 0, logoRect.right - logoRect.left, logoRect.bottom - logoRect.top,
333-
SWP_NOMOVE | SWP_SHOWWINDOW);
334-
UpdateWindow(logoWindow);
337+
SetWindowPos(logoWindow, prevWindow, 0, 0, logoRect.right - logoRect.left, logoRect.bottom - logoRect.top,
338+
SWP_NOMOVE | SWP_SHOWWINDOW);
339+
UpdateWindow(logoWindow);
340+
}
335341
*g_sLaunchOnExit_app = 0;
336342
*g_sLaunchOnExit_params = 0;
337343

0 commit comments

Comments
 (0)