11#include " pch.hpp"
22#include " editors/xrECore/Core/ELog.h"
3+ #include " xrCore/Threading/Event.hpp"
4+ #include " xrEngine/main.h"
5+ #include " xrEngine/device.h"
6+ #include " xrEngine/XR_IOConsole.h"
7+ #include " xrEngine/xr_ioc_cmd.h"
8+
39
410using namespace XRay ;
511using namespace XRay ::Editor;
612using namespace XRay ::Editor::Controls;
713using namespace XRay ::Editor::Windows;
814
9- int entry_point (pcstr commandLine)
15+ Event UICreated;
16+ Event UIThreadExit;
17+ Event ReadyToShowUI;
18+ [System::STAThread]
19+ void UIThreadProc (void *)
1020{
1121 System::Windows::Forms::Application::EnableVisualStyles ();
22+
23+ auto windowIDE = gcnew WindowIDE ();
24+
25+ Core.Initialize (" OpenXRayEditor" , LogCallback (ELogCallback, windowIDE->Log ().Handle .ToPointer ()), true );
26+
27+ #ifdef XR_X64
28+ Device.m_hWnd = (HWND)windowIDE->View ().GetViewHandle ().ToInt64 ();
29+ #else
30+ Device.m_hWnd = (HWND)windowIDE->View ().GetViewHandle ().ToInt32 ();
31+ #endif
32+ VERIFY (Device.m_hWnd != INVALID_HANDLE_VALUE);
33+
34+ UICreated.Set ();
35+ ReadyToShowUI.Wait ();
36+ System::Windows::Forms::Application::Run (windowIDE);
37+ UIThreadExit.Set ();
38+ }
39+
40+ int entry_point (pcstr commandLine)
41+ {
1242 auto splash = gcnew WindowSplash ();
1343 splash->Show ();
1444
1545 splash->SetStatus (" Loading xrDebug..." );
1646 xrDebug::Initialize (false );
1747
1848 splash->SetStatus (" Loading Core..." );
19- Core.Initialize (" OpenXRayEditor" , nullptr , true );
49+ thread_spawn (UIThreadProc, " OpenXRay Editor UI Thread" , 0 , nullptr );
50+
51+ UICreated.Wait ();
52+ ReadyToShowUI.Set ();
53+
54+ RunApplication ();
55+ // splash->SetStatus("Loading Settings...");
56+ // InitSettings();
57+ // // Adjust player & computer name for Asian
58+ // if (pSettings->line_exist("string_table", "no_native_input"))
59+ // {
60+ // xr_strcpy(Core.UserName, sizeof(Core.UserName), "Player");
61+ // xr_strcpy(Core.CompName, sizeof(Core.CompName), "Computer");
62+ // }
63+ //
64+ // FPU::m24r();
65+ //
66+ // splash->SetStatus("Loading Engine...");
67+ // InitEngine();
68+ //
69+ // splash->SetStatus("Loading Input...");
70+ // InitInput();
71+ //
72+ // splash->SetStatus("Loading Console...");
73+ // InitConsole();
74+ //
75+ // splash->SetStatus("Creating Renderer List...");
76+ // Engine.External.CreateRendererList();
77+ //
78+ // CCC_LoadCFG_custom cmd("renderer ");
79+ // cmd.Execute(Console->ConfigFile);
80+
81+ splash->SetStatus (" Loading Engine API..." );
82+ // Engine.External.Initialize();
83+
84+ splash->SetStatus (" Loading Device..." );
85+ // Device.Initialize();
86+ // Device.Create();
2087
2188 splash->SetStatus (" Loading finished." );
89+ // ReadyToShowUI.Set();
2290 splash->Close ();
2391
24- auto windowMain = gcnew WindowIDE ();
25- System::Windows::Forms::Application::Run (windowMain);
92+ // Startup();
93+ UIThreadExit.Wait ();
94+
2695 Core._destroy ();
2796 return 0 ;
2897}
@@ -34,7 +103,6 @@ int StackoverflowFilter(const int exceptionCode)
34103 return EXCEPTION_CONTINUE_SEARCH;
35104}
36105
37- [System::STAThread]
38106int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int )
39107{
40108 int result = 0 ;
0 commit comments