Skip to content

Commit

Permalink
Add xrEditor project stub
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Mar 23, 2018
1 parent fc57908 commit c17c456
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/editors/xrEditor/entry_point.cpp
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions src/editors/xrEditor/pch.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "pch.hpp"
15 changes: 15 additions & 0 deletions src/editors/xrEditor/pch.hpp
Original file line number Diff line number Diff line change
@@ -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 <msclr/marshal.h>

inline System::String^ BackSlashToSlash(pcstr originalString)
{
System::String^ newString = gcnew System::String(originalString);
return newString->Replace('\\', '/');
}
117 changes: 117 additions & 0 deletions src/editors/xrEditor/xrEditor.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Mixed|Win32">
<Configuration>Mixed</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Mixed|x64">
<Configuration>Mixed</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{BE4B23E7-2CA8-4607-A473-116C4242F23D}</ProjectGuid>
<RootNamespace>xrEditor</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\Common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<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>
</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>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="pch.hpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="entry_point.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
<ProjectReference Include="..\xrECore\xrECore.vcxproj">
<Project>{87d068ec-1789-4f09-a9ec-54cf276955e0}</Project>
</ProjectReference>
<ProjectReference Include="..\xrSdkControls\xrSdkControls.csproj">
<Project>{e9dc16a3-d0fa-4924-af6e-f6fdf3ea0661}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
10 changes: 10 additions & 0 deletions src/editors/xrEditor/xrEditor.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClInclude Include="pch.hpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="entry_point.cpp" />
</ItemGroup>
</Project>
15 changes: 15 additions & 0 deletions src/engine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit c17c456

Please sign in to comment.