Skip to content

Commit ae05a5e

Browse files
committed
xrEngine is a DLL now, xr_3da used as an entry point instead
1 parent 7d4dcfc commit ae05a5e

17 files changed

+218
-61
lines changed

src/engine.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OSDependent", "..\Externals
255255
EndProject
256256
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SPIRV", "..\Externals\SPIRV.vcxproj", "{3AF44175-2EED-3C67-B324-93B1572B7EDD}"
257257
EndProject
258+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xr_3da", "xr_3da\xr_3da.vcxproj", "{F4757631-E6E8-469B-AD5A-516BAA01DABD}"
259+
EndProject
258260
Global
259261
GlobalSection(SolutionConfigurationPlatforms) = preSolution
260262
Debug|x64 = Debug|x64
@@ -1168,6 +1170,18 @@ Global
11681170
{3AF44175-2EED-3C67-B324-93B1572B7EDD}.Release|x64.Build.0 = Release|x64
11691171
{3AF44175-2EED-3C67-B324-93B1572B7EDD}.Release|x86.ActiveCfg = Release|Win32
11701172
{3AF44175-2EED-3C67-B324-93B1572B7EDD}.Release|x86.Build.0 = Release|Win32
1173+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Debug|x64.ActiveCfg = Debug|x64
1174+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Debug|x64.Build.0 = Debug|x64
1175+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Debug|x86.ActiveCfg = Debug|Win32
1176+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Debug|x86.Build.0 = Debug|Win32
1177+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Mixed|x64.ActiveCfg = Mixed|x64
1178+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Mixed|x64.Build.0 = Mixed|x64
1179+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Mixed|x86.ActiveCfg = Mixed|Win32
1180+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Mixed|x86.Build.0 = Mixed|Win32
1181+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Release|x64.ActiveCfg = Release|x64
1182+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Release|x64.Build.0 = Release|x64
1183+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Release|x86.ActiveCfg = Release|Win32
1184+
{F4757631-E6E8-469B-AD5A-516BAA01DABD}.Release|x86.Build.0 = Release|Win32
11711185
EndGlobalSection
11721186
GlobalSection(SolutionProperties) = preSolution
11731187
HideSolutionNode = FALSE

src/xrEngine/Device_Initialize.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "stdafx.h"
2-
#include "resource.h"
2+
#include "xr_3da/resource.h"
3+
34
#include "Include/editor/ide.hpp"
45
#include "engine_impl.hpp"
56
#include "GameFont.h"

src/xrEngine/OutOfVirtError.RES

-3.47 KB
Binary file not shown.

src/xrEngine/main.cpp

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
// Entry point is in xr_3da/entry_point.cpp
12
#include "stdafx.h"
3+
#include "xr_3da/resource.h"
4+
5+
#include <process.h>
6+
#include <locale.h>
7+
28
#include "IGame_Persistent.h"
39
#include "xrNetServer/NET_AuthCheck.h"
410
#include "xr_input.h"
511
#include "XR_IOConsole.h"
612
#include "x_ray.h"
713
#include "std_classes.h"
8-
#include "resource.h"
14+
915
#include "LightAnimLibrary.h"
1016
#include "xrCDB/ISpatial.h"
1117
#include "Text_Console.h"
12-
#include <process.h>
13-
#include <locale.h>
1418
#include "xrSASH.h"
1519
#include "xr_ioc_cmd.h"
1620

@@ -300,7 +304,7 @@ class StickyKeyFilter
300304
}
301305
};
302306

303-
int RunApplication(pcstr commandLine)
307+
XR_EXPORT int RunApplication(pcstr commandLine)
304308
{
305309
if (strstr(commandLine, "-dedicated"))
306310
GEnv.isDedicatedServer = true;
@@ -464,27 +468,4 @@ void RunBenchmark(pcstr name)
464468
Startup();
465469
}
466470
}
467-
468-
int StackoverflowFilter(int exceptionCode)
469-
{
470-
if (exceptionCode == EXCEPTION_STACK_OVERFLOW)
471-
return EXCEPTION_EXECUTE_HANDLER;
472-
return EXCEPTION_CONTINUE_SEARCH;
473-
}
474-
}
475-
476-
int APIENTRY WinMain(HINSTANCE inst, HINSTANCE prevInst, char* commandLine, int cmdShow)
477-
{
478-
int result = 0;
479-
// BugTrap can't handle stack overflow exception, so handle it here
480-
__try
481-
{
482-
result = RunApplication(commandLine);
483-
}
484-
__except (StackoverflowFilter(GetExceptionCode()))
485-
{
486-
_resetstkoflw();
487-
FATAL("stack overflow");
488-
}
489-
return result;
490471
}

src/xrEngine/splash_xrcs_kri_demo.bmp

-393 KB
Binary file not shown.

src/xrEngine/ui_splash3.bmp

-393 KB
Binary file not shown.

src/xrEngine/xrEngine.vcxproj

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,34 @@
3333
</PropertyGroup>
3434
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36-
<ConfigurationType>Application</ConfigurationType>
36+
<ConfigurationType>DynamicLibrary</ConfigurationType>
3737
<PlatformToolset>v141</PlatformToolset>
3838
<CharacterSet>MultiByte</CharacterSet>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
4040
</PropertyGroup>
4141
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
42-
<ConfigurationType>Application</ConfigurationType>
42+
<ConfigurationType>DynamicLibrary</ConfigurationType>
4343
<PlatformToolset>v141</PlatformToolset>
4444
<CharacterSet>MultiByte</CharacterSet>
4545
<WholeProgramOptimization>true</WholeProgramOptimization>
4646
</PropertyGroup>
4747
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Mixed|Win32'" Label="Configuration">
48-
<ConfigurationType>Application</ConfigurationType>
48+
<ConfigurationType>DynamicLibrary</ConfigurationType>
4949
<PlatformToolset>v141</PlatformToolset>
5050
<CharacterSet>MultiByte</CharacterSet>
5151
</PropertyGroup>
5252
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Mixed|x64'" Label="Configuration">
53-
<ConfigurationType>Application</ConfigurationType>
53+
<ConfigurationType>DynamicLibrary</ConfigurationType>
5454
<PlatformToolset>v141</PlatformToolset>
5555
<CharacterSet>MultiByte</CharacterSet>
5656
</PropertyGroup>
5757
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
58-
<ConfigurationType>Application</ConfigurationType>
58+
<ConfigurationType>DynamicLibrary</ConfigurationType>
5959
<PlatformToolset>v141</PlatformToolset>
6060
<CharacterSet>MultiByte</CharacterSet>
6161
</PropertyGroup>
6262
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
63-
<ConfigurationType>Application</ConfigurationType>
63+
<ConfigurationType>DynamicLibrary</ConfigurationType>
6464
<PlatformToolset>v141</PlatformToolset>
6565
<CharacterSet>MultiByte</CharacterSet>
6666
</PropertyGroup>
@@ -267,7 +267,6 @@
267267
<ClInclude Include="pure_relcase.h" />
268268
<ClInclude Include="Rain.h" />
269269
<ClInclude Include="Render.h" />
270-
<ClInclude Include="resource.h" />
271270
<ClInclude Include="StatGraph.h" />
272271
<ClInclude Include="Stats.h" />
273272
<ClInclude Include="stdafx.h" />
@@ -404,13 +403,6 @@
404403
<ClCompile Include="x_ray.cpp" />
405404
<ClCompile Include="main.cpp" />
406405
</ItemGroup>
407-
<ItemGroup>
408-
<ResourceCompile Include="resource.rc" />
409-
</ItemGroup>
410-
<ItemGroup>
411-
<Image Include="splash_xrcs_en.bmp" />
412-
<Image Include="stalker_cs.ico" />
413-
</ItemGroup>
414406
<ItemGroup>
415407
<Text Include="ClientServer.txt" />
416408
<Text Include="Effects description.txt" />

src/xrEngine/xrEngine.vcxproj.filters

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
<Filter Include="General">
55
<UniqueIdentifier>{789b2b01-e97a-4aef-b3c2-0281708942c5}</UniqueIdentifier>
66
</Filter>
7-
<Filter Include="General\Resources">
8-
<UniqueIdentifier>{e11e63ee-7e2c-4cae-8562-81d199ac71df}</UniqueIdentifier>
9-
</Filter>
107
<Filter Include="Interfaces">
118
<UniqueIdentifier>{fad49c5d-63ff-41cf-acdd-a213a33d84e0}</UniqueIdentifier>
129
</Filter>
@@ -252,9 +249,6 @@
252249
<ClInclude Include="x_ray.h">
253250
<Filter>General</Filter>
254251
</ClInclude>
255-
<ClInclude Include="resource.h">
256-
<Filter>General\Resources</Filter>
257-
</ClInclude>
258252
<ClInclude Include="IInputReceiver.h">
259253
<Filter>Interfaces\Input</Filter>
260254
</ClInclude>
@@ -879,19 +873,6 @@
879873
<Filter>General\Profiler</Filter>
880874
</ClCompile>
881875
</ItemGroup>
882-
<ItemGroup>
883-
<ResourceCompile Include="resource.rc">
884-
<Filter>General\Resources</Filter>
885-
</ResourceCompile>
886-
</ItemGroup>
887-
<ItemGroup>
888-
<Image Include="splash_xrcs_en.bmp">
889-
<Filter>General\Resources</Filter>
890-
</Image>
891-
<Image Include="stalker_cs.ico">
892-
<Filter>General\Resources</Filter>
893-
</Image>
894-
</ItemGroup>
895876
<ItemGroup>
896877
<Text Include="ClientServer.txt" />
897878
<Text Include="Effects description.txt" />

src/xr_3da/entry_point.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include "stdafx.h"
2+
#include "xrCore/xrDebug_macros.h"
3+
4+
extern ENGINE_API int RunApplication(pcstr);
5+
6+
int StackoverflowFilter(const int exceptionCode)
7+
{
8+
if (exceptionCode == EXCEPTION_STACK_OVERFLOW)
9+
return EXCEPTION_EXECUTE_HANDLER;
10+
return EXCEPTION_CONTINUE_SEARCH;
11+
}
12+
13+
int APIENTRY WinMain(HINSTANCE inst, HINSTANCE prevInst, char* commandLine, int cmdShow)
14+
{
15+
int result = 0;
16+
// BugTrap can't handle stack overflow exception, so handle it here
17+
__try
18+
{
19+
result = RunApplication(commandLine);
20+
}
21+
__except (StackoverflowFilter(GetExceptionCode()))
22+
{
23+
_resetstkoflw();
24+
FATAL("stack overflow");
25+
}
26+
return result;
27+
}
File renamed without changes.

0 commit comments

Comments
 (0)