Skip to content

Commit

Permalink
xrECore: work in progress
Browse files Browse the repository at this point in the history
This is a test and maybe everything will be made in a different way
  • Loading branch information
Xottab-DUTY committed Mar 30, 2018
1 parent 56e829e commit dab7351
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 27 deletions.
3 changes: 3 additions & 0 deletions src/editors/xrECore/Windows/WindowIDE.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public ref class WindowIDE : public System::Windows::Forms::Form
Initialize();
}

WindowView% View() { return *windowView; }
WindowLog% Log() { return *windowLog; }

protected:
~WindowIDE()
{
Expand Down
78 changes: 73 additions & 5 deletions src/editors/xrEditor/entry_point.cpp
Original file line number Diff line number Diff line change
@@ -1,28 +1,97 @@
#include "pch.hpp"
#include "editors/xrECore/Core/ELog.h"
#include "xrCore/Threading/Event.hpp"
#include "xrEngine/main.h"
#include "xrEngine/device.h"
#include "xrEngine/XR_IOConsole.h"
#include "xrEngine/xr_ioc_cmd.h"


using namespace XRay;
using namespace XRay::Editor;
using namespace XRay::Editor::Controls;
using namespace XRay::Editor::Windows;

int entry_point(pcstr commandLine)
Event UICreated;
Event UIThreadExit;
Event ReadyToShowUI;
[System::STAThread]
void UIThreadProc(void*)
{
System::Windows::Forms::Application::EnableVisualStyles();

auto windowIDE = gcnew WindowIDE();

Core.Initialize("OpenXRayEditor", LogCallback(ELogCallback, windowIDE->Log().Handle.ToPointer()), true);

#ifdef XR_X64
Device.m_hWnd = (HWND)windowIDE->View().GetViewHandle().ToInt64();
#else
Device.m_hWnd = (HWND)windowIDE->View().GetViewHandle().ToInt32();
#endif
VERIFY(Device.m_hWnd != INVALID_HANDLE_VALUE);

UICreated.Set();
ReadyToShowUI.Wait();
System::Windows::Forms::Application::Run(windowIDE);
UIThreadExit.Set();
}

int entry_point(pcstr commandLine)
{
auto splash = gcnew WindowSplash();
splash->Show();

splash->SetStatus("Loading xrDebug...");
xrDebug::Initialize(false);

splash->SetStatus("Loading Core...");
Core.Initialize("OpenXRayEditor", nullptr, true);
thread_spawn(UIThreadProc, "OpenXRay Editor UI Thread", 0, nullptr);

UICreated.Wait();
ReadyToShowUI.Set();

RunApplication();
// splash->SetStatus("Loading Settings...");
// InitSettings();
// // Adjust player & computer name for Asian
// if (pSettings->line_exist("string_table", "no_native_input"))
// {
// xr_strcpy(Core.UserName, sizeof(Core.UserName), "Player");
// xr_strcpy(Core.CompName, sizeof(Core.CompName), "Computer");
// }
//
// FPU::m24r();
//
// splash->SetStatus("Loading Engine...");
// InitEngine();
//
// splash->SetStatus("Loading Input...");
// InitInput();
//
// splash->SetStatus("Loading Console...");
// InitConsole();
//
// splash->SetStatus("Creating Renderer List...");
// Engine.External.CreateRendererList();
//
// CCC_LoadCFG_custom cmd("renderer ");
// cmd.Execute(Console->ConfigFile);

splash->SetStatus("Loading Engine API...");
//Engine.External.Initialize();

splash->SetStatus("Loading Device...");
//Device.Initialize();
//Device.Create();

splash->SetStatus("Loading finished.");
//ReadyToShowUI.Set();
splash->Close();

auto windowMain = gcnew WindowIDE();
System::Windows::Forms::Application::Run(windowMain);
//Startup();
UIThreadExit.Wait();

Core._destroy();
return 0;
}
Expand All @@ -34,7 +103,6 @@ int StackoverflowFilter(const int exceptionCode)
return EXCEPTION_CONTINUE_SEARCH;
}

[System::STAThread]
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int)
{
int result = 0;
Expand Down
30 changes: 8 additions & 22 deletions src/editors/xrEditor/xrEditor.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,30 +57,10 @@
<ClCompile>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeaderFile>pch.hpp</PrecompiledHeaderFile>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Mixed|Win32'">/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Mixed|x64'">/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Windows</SubSystem>
</Link>
<Link>
<SubSystem Condition="'$(Configuration)|$(Platform)'=='Mixed|Win32'">Windows</SubSystem>
</Link>
<Link>
<SubSystem Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Windows</SubSystem>
</Link>
<Link>
<SubSystem Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Windows</SubSystem>
</Link>
<Link>
<SubSystem Condition="'$(Configuration)|$(Platform)'=='Mixed|x64'">Windows</SubSystem>
</Link>
<Link>
<SubSystem Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Windows</SubSystem>
<AdditionalDependencies>xrECore.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -96,6 +76,9 @@
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
<ProjectReference Include="..\..\xrEngine\xrEngine.vcxproj">
<Project>{2578c6d8-660d-48ae-9322-7422f8664f06}</Project>
</ProjectReference>
<ProjectReference Include="..\xrECore\xrECore.vcxproj">
<Project>{87d068ec-1789-4f09-a9ec-54cf276955e0}</Project>
</ProjectReference>
Expand All @@ -109,6 +92,9 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WeifenLuo.WinFormsUI.Docking">
<HintPath>..\..\..\sdk\binaries\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down

0 comments on commit dab7351

Please sign in to comment.