1818#include " Text_Console.h"
1919#include " xrSASH.h"
2020#include " xr_ioc_cmd.h"
21+ #include " splash.h"
2122
2223#ifdef MASTER_GOLD
2324#define NO_MULTI_INSTANCES
2425#endif
2526
2627// global variables
27- ENGINE_API CApplication* pApp = nullptr ;
2828ENGINE_API CInifile* pGameIni = nullptr ;
2929ENGINE_API bool g_bBenchmark = false ;
3030string512 g_sBenchmarkName;
@@ -34,8 +34,6 @@ ENGINE_API string_path g_sLaunchWorkingFolder;
3434
3535namespace
3636{
37- HWND logoWindow = nullptr ;
38-
3937void RunBenchmark (pcstr name);
4038}
4139
@@ -166,13 +164,15 @@ ENGINE_API void Startup()
166164{
167165 execUserScript ();
168166 InitSound ();
167+
169168 // ...command line for auto start
170169 pcstr startArgs = strstr (Core.Params , " -start " );
171170 if (startArgs)
172171 Console->Execute (startArgs + 1 );
173172 pcstr loadArgs = strstr (Core.Params , " -load " );
174173 if (loadArgs)
175174 Console->Execute (loadArgs + 1 );
175+
176176 // Initialize APP
177177 Device.Create ();
178178 LALib.OnCreate ();
@@ -183,12 +183,8 @@ ENGINE_API void Startup()
183183 g_SpatialSpacePhysic = new ISpatial_DB (" Spatial phys" );
184184
185185 // Show main window and destroy splash
186+ splash::hide ();
186187 ShowWindow (Device.m_hWnd , SW_SHOWNORMAL);
187- if (logoWindow != nullptr )
188- {
189- DestroyWindow (logoWindow);
190- logoWindow = nullptr ;
191- }
192188
193189 // Main cycle
194190 Memory.mem_usage ();
@@ -212,39 +208,8 @@ ENGINE_API void Startup()
212208 destroySound ();
213209}
214210
215- static INT_PTR CALLBACK LogoWndProc (HWND hw, UINT msg, WPARAM wp, LPARAM lp)
216- {
217- switch (msg)
218- {
219- case WM_DESTROY: break ;
220- case WM_CLOSE: DestroyWindow (hw); break ;
221- case WM_COMMAND:
222- if (LOWORD (wp) == IDCANCEL)
223- DestroyWindow (hw);
224- break ;
225- default : return false ;
226- }
227- return true ;
228- }
229-
230211ENGINE_API int RunApplication (pcstr commandLine)
231212{
232- if (strstr (commandLine, " -nosplash" ) == 0 )
233- {
234- logoWindow = CreateDialog (GetModuleHandle (NULL ), MAKEINTRESOURCE (IDD_STARTUP), nullptr , LogoWndProc);
235- const HWND logoPicture = GetDlgItem (logoWindow, IDC_STATIC_LOGO);
236- RECT logoRect;
237- GetWindowRect (logoPicture, &logoRect);
238- #ifndef DEBUG
239- HWND prevWindow = (strstr (commandLine, " -splashnotop" ) == NULL ) ? HWND_TOPMOST : HWND_NOTOPMOST;
240- #else
241- const HWND prevWindow = HWND_NOTOPMOST;
242- #endif
243- SetWindowPos (logoWindow, prevWindow, 0 , 0 , logoRect.right - logoRect.left , logoRect.bottom - logoRect.top ,
244- SWP_NOMOVE | SWP_SHOWWINDOW);
245- UpdateWindow (logoWindow);
246- }
247-
248213 if (!IsDebuggerPresent ())
249214 {
250215 u32 heapFragmentation = 2 ;
0 commit comments