Skip to content

Commit f0d7e55

Browse files
committed
Merge branch 'xd_dev' of github.com:OpenXRay/xray-16 into xd_dev
2 parents 8f2a99e + d95f3fd commit f0d7e55

File tree

5 files changed

+33
-26
lines changed

5 files changed

+33
-26
lines changed

src/xrEngine/main.cpp

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Entry point is in xr_3da/entry_point.cpp
22
#include "stdafx.h"
33
#include "main.h"
4-
#include "xr_3da/resource.h"
54

65
#include <process.h>
76
#include <locale.h>
@@ -33,6 +32,7 @@ ENGINE_API string_path g_sLaunchWorkingFolder;
3332

3433
namespace
3534
{
35+
bool CheckBenchmark();
3636
void RunBenchmark(pcstr name);
3737
}
3838

@@ -231,26 +231,8 @@ ENGINE_API int RunApplication()
231231
InitConsole();
232232
Engine.External.CreateRendererList();
233233

234-
pcstr benchName = "-batch_benchmark ";
235-
if (strstr(Core.Params, benchName))
236-
{
237-
u32 sz = xr_strlen(benchName);
238-
string64 benchmarkName;
239-
sscanf(strstr(Core.Params, benchName) + sz, "%[^ ] ", benchmarkName);
240-
RunBenchmark(benchmarkName);
241-
return 0;
242-
}
243-
244-
pcstr sashName = "-openautomate ";
245-
if (strstr(Core.Params, sashName))
246-
{
247-
u32 sz = xr_strlen(sashName);
248-
string512 sashArg;
249-
sscanf(strstr(Core.Params, sashName) + sz, "%[^ ] ", sashArg);
250-
g_SASH.Init(sashArg);
251-
g_SASH.MainLoop();
234+
if (CheckBenchmark())
252235
return 0;
253-
}
254236

255237
if (!GEnv.isDedicatedServer)
256238
{
@@ -295,13 +277,38 @@ ENGINE_API int RunApplication()
295277

296278
namespace
297279
{
280+
bool CheckBenchmark()
281+
{
282+
pcstr benchName = "-batch_benchmark ";
283+
if (strstr(Core.Params, benchName))
284+
{
285+
const u32 sz = xr_strlen(benchName);
286+
string64 benchmarkName;
287+
sscanf(strstr(Core.Params, benchName) + sz, "%[^ ] ", benchmarkName);
288+
RunBenchmark(benchmarkName);
289+
return true;
290+
}
291+
292+
pcstr sashName = "-openautomate ";
293+
if (strstr(Core.Params, sashName))
294+
{
295+
const u32 sz = xr_strlen(sashName);
296+
string512 sashArg;
297+
sscanf(strstr(Core.Params, sashName) + sz, "%[^ ] ", sashArg);
298+
g_SASH.Init(sashArg);
299+
g_SASH.MainLoop();
300+
return true;
301+
}
302+
303+
return false;
304+
}
298305
void RunBenchmark(pcstr name)
299306
{
300307
g_bBenchmark = true;
301308
string_path cfgPath;
302309
FS.update_path(cfgPath, "$app_data_root$", name);
303310
CInifile ini(cfgPath);
304-
u32 benchmarkCount = ini.line_count("benchmark");
311+
const u32 benchmarkCount = ini.line_count("benchmark");
305312
for (u32 i = 0; i < benchmarkCount; i++)
306313
{
307314
LPCSTR benchmarkName, t;

src/xrEngine/xrEngine.vcxproj.filters

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@
555555
<ClInclude Include="profiler_inline.h">
556556
<Filter>General\Profiler</Filter>
557557
</ClInclude>
558-
<ClInclude Include="main.h" />
559558
<ClInclude Include="splash.h">
560559
<Filter>General</Filter>
561560
</ClInclude>
@@ -565,6 +564,9 @@
565564
<ClInclude Include="ShadersExternalData.h">
566565
<Filter>Render\Visibility</Filter>
567566
</ClInclude>
567+
<ClInclude Include="main.h">
568+
<Filter>General</Filter>
569+
</ClInclude>
568570
</ItemGroup>
569571
<ItemGroup>
570572
<ClCompile Include="defines.cpp">

src/xrGame/ik/limb.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,7 @@ int Limb::try_singularities(int solves, float& swivel_angle, float x[])
738738
//
739739
// Assumes that either SetGoal or SetGoalPos has been called first
740740
//
741-
// XXX: Shouldn't the phInfinity declaration be in a header for xrPhysics?
742-
extern XRPHYSICS_API const float phInfinity;
741+
743742
int Limb::Solve(float x[], float* new_swivel, float* new_pos)
744743
{
745744
int success;

src/xrPhysics/MathUtils.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "xrCore/_cylinder.h"
44
#include <ode/common.h>
55

6-
XRPHYSICS_API const float phInfinity = dInfinity;
76
/*
87
#include "MathUtils.h"
98
enum EBoxSideNearestPointCode

src/xrPhysics/MathUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifdef DEBUG
99
#include "xrCore/dump_string.h"
1010
#endif
11-
extern XRPHYSICS_API const float phInfinity;
11+
constexpr float phInfinity = std::numeric_limits<float>::infinity();
1212

1313
template <class T> struct _quaternion;
1414
typedef _quaternion<float> Fquaternion;

0 commit comments

Comments
 (0)