From c17c456d692246ee57a93a4793f6ecea80cdb6ba Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Fri, 23 Mar 2018 16:16:28 +0500 Subject: [PATCH] Add xrEditor project stub --- src/editors/xrEditor/entry_point.cpp | 49 ++++++++ src/editors/xrEditor/pch.cpp | 1 + src/editors/xrEditor/pch.hpp | 15 +++ src/editors/xrEditor/xrEditor.vcxproj | 117 ++++++++++++++++++ src/editors/xrEditor/xrEditor.vcxproj.filters | 10 ++ src/engine.sln | 15 +++ 6 files changed, 207 insertions(+) create mode 100644 src/editors/xrEditor/entry_point.cpp create mode 100644 src/editors/xrEditor/pch.cpp create mode 100644 src/editors/xrEditor/pch.hpp create mode 100644 src/editors/xrEditor/xrEditor.vcxproj create mode 100644 src/editors/xrEditor/xrEditor.vcxproj.filters diff --git a/src/editors/xrEditor/entry_point.cpp b/src/editors/xrEditor/entry_point.cpp new file mode 100644 index 00000000000..d5eaaaf1d0d --- /dev/null +++ b/src/editors/xrEditor/entry_point.cpp @@ -0,0 +1,49 @@ +#include "pch.hpp" +#include "editors/xrECore/Core/ELog.h" + +using namespace XRay; + +int entry_point(pcstr commandLine) +{ + System::Windows::Forms::Application::EnableVisualStyles(); + auto splash = gcnew ECore::Props::WindowSplash(); + splash->Show(); + + splash->SetStatus("Loading xrDebug..."); + xrDebug::Initialize(false); + + splash->SetStatus("Loading Core..."); + Core.Initialize("OpenXRayEditor", nullptr, true); + + splash->SetStatus("Loading finished."); + splash->Close(); + + auto windowMain = gcnew ECore::Props::WindowIDE(); + System::Windows::Forms::Application::Run(windowMain); + Core._destroy(); + return 0; +} + +int StackoverflowFilter(const int exceptionCode) +{ + if (exceptionCode == EXCEPTION_STACK_OVERFLOW) + return EXCEPTION_EXECUTE_HANDLER; + return EXCEPTION_CONTINUE_SEARCH; +} + +[System::STAThread] +int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR lpCmdLine, int) +{ + int result = 0; + // BugTrap can't handle stack overflow exception, so handle it here + __try + { + result = entry_point(lpCmdLine); + } + __except (StackoverflowFilter(GetExceptionCode())) + { + _resetstkoflw(); + FATAL("stack overflow"); + } + return 0; +} \ No newline at end of file diff --git a/src/editors/xrEditor/pch.cpp b/src/editors/xrEditor/pch.cpp new file mode 100644 index 00000000000..3854579ae1c --- /dev/null +++ b/src/editors/xrEditor/pch.cpp @@ -0,0 +1 @@ +#include "pch.hpp" diff --git a/src/editors/xrEditor/pch.hpp b/src/editors/xrEditor/pch.hpp new file mode 100644 index 00000000000..49d650799ea --- /dev/null +++ b/src/editors/xrEditor/pch.hpp @@ -0,0 +1,15 @@ +#pragma once + +#include "Common/Common.hpp" +#include "Common/FSMacros.hpp" +#include "xrCore/xrCore.h" +#include "xrCommon/xr_vector.h" +#include "xrCommon/xr_string.h" + +#include + +inline System::String^ BackSlashToSlash(pcstr originalString) +{ + System::String^ newString = gcnew System::String(originalString); + return newString->Replace('\\', '/'); +} diff --git a/src/editors/xrEditor/xrEditor.vcxproj b/src/editors/xrEditor/xrEditor.vcxproj new file mode 100644 index 00000000000..a5194a87c91 --- /dev/null +++ b/src/editors/xrEditor/xrEditor.vcxproj @@ -0,0 +1,117 @@ + + + + + Debug + Win32 + + + Mixed + Win32 + + + Release + Win32 + + + Debug + x64 + + + Mixed + x64 + + + Release + x64 + + + + 15.0 + {BE4B23E7-2CA8-4607-A473-116C4242F23D} + xrEditor + 10.0.16299.0 + + + + Application + v141 + MultiByte + true + + + true + + + + + + + + + + + + + + + true + pch.hpp + /Zc:twoPhase- %(AdditionalOptions) + /Zc:twoPhase- %(AdditionalOptions) + /Zc:twoPhase- %(AdditionalOptions) + /Zc:twoPhase- %(AdditionalOptions) + /Zc:twoPhase- %(AdditionalOptions) + /Zc:twoPhase- %(AdditionalOptions) + + + Windows + + + Windows + + + Windows + + + Windows + + + Windows + + + Windows + + + + + + + + + Create + + + + + {a0f7d1fb-59a7-4717-a7e4-96f37e91998e} + + + {87d068ec-1789-4f09-a9ec-54cf276955e0} + + + {e9dc16a3-d0fa-4924-af6e-f6fdf3ea0661} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/editors/xrEditor/xrEditor.vcxproj.filters b/src/editors/xrEditor/xrEditor.vcxproj.filters new file mode 100644 index 00000000000..744231c5ef2 --- /dev/null +++ b/src/editors/xrEditor/xrEditor.vcxproj.filters @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/engine.sln b/src/engine.sln index 219d2ea9f50..9be18dbe7f4 100644 --- a/src/engine.sln +++ b/src/engine.sln @@ -260,6 +260,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xr_3da", "xr_3da\xr_3da.vcx EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrECore", "editors\xrECore\xrECore.vcxproj", "{87D068EC-1789-4F09-A9EC-54CF276955E0}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrEditor", "editors\xrEditor\xrEditor.vcxproj", "{BE4B23E7-2CA8-4607-A473-116C4242F23D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -1197,6 +1199,18 @@ Global {87D068EC-1789-4F09-A9EC-54CF276955E0}.Release|x64.Build.0 = Release|x64 {87D068EC-1789-4F09-A9EC-54CF276955E0}.Release|x86.ActiveCfg = Release|Win32 {87D068EC-1789-4F09-A9EC-54CF276955E0}.Release|x86.Build.0 = Release|Win32 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Debug|x64.ActiveCfg = Debug|x64 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Debug|x64.Build.0 = Debug|x64 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Debug|x86.ActiveCfg = Debug|Win32 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Debug|x86.Build.0 = Debug|Win32 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Mixed|x64.ActiveCfg = Mixed|x64 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Mixed|x64.Build.0 = Mixed|x64 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Mixed|x86.ActiveCfg = Mixed|Win32 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Mixed|x86.Build.0 = Mixed|Win32 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Release|x64.ActiveCfg = Release|x64 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Release|x64.Build.0 = Release|x64 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Release|x86.ActiveCfg = Release|Win32 + {BE4B23E7-2CA8-4607-A473-116C4242F23D}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1274,6 +1288,7 @@ Global {0165B392-9E93-3AA3-89F3-20ACB545095D} = {8F5855A5-9F00-40E5-8B2A-EBDB4A31077D} {3AF44175-2EED-3C67-B324-93B1572B7EDD} = {8F5855A5-9F00-40E5-8B2A-EBDB4A31077D} {87D068EC-1789-4F09-A9EC-54CF276955E0} = {CB0C814D-FB4E-453B-B7A0-716F4A1EACA4} + {BE4B23E7-2CA8-4607-A473-116C4242F23D} = {CB0C814D-FB4E-453B-B7A0-716F4A1EACA4} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C5A32302-94F5-41B8-9606-017BB6BA69A6}