Skip to content

Commit

Permalink
Merge branch 'xd_dev' of github.com:OpenXRay/xray-16 into xd_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed May 23, 2018
2 parents 8f2a99e + d95f3fd commit f0d7e55
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 26 deletions.
49 changes: 28 additions & 21 deletions src/xrEngine/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Entry point is in xr_3da/entry_point.cpp
#include "stdafx.h"
#include "main.h"
#include "xr_3da/resource.h"

#include <process.h>
#include <locale.h>
Expand Down Expand Up @@ -33,6 +32,7 @@ ENGINE_API string_path g_sLaunchWorkingFolder;

namespace
{
bool CheckBenchmark();
void RunBenchmark(pcstr name);
}

Expand Down Expand Up @@ -231,26 +231,8 @@ ENGINE_API int RunApplication()
InitConsole();
Engine.External.CreateRendererList();

pcstr benchName = "-batch_benchmark ";
if (strstr(Core.Params, benchName))
{
u32 sz = xr_strlen(benchName);
string64 benchmarkName;
sscanf(strstr(Core.Params, benchName) + sz, "%[^ ] ", benchmarkName);
RunBenchmark(benchmarkName);
return 0;
}

pcstr sashName = "-openautomate ";
if (strstr(Core.Params, sashName))
{
u32 sz = xr_strlen(sashName);
string512 sashArg;
sscanf(strstr(Core.Params, sashName) + sz, "%[^ ] ", sashArg);
g_SASH.Init(sashArg);
g_SASH.MainLoop();
if (CheckBenchmark())
return 0;
}

if (!GEnv.isDedicatedServer)
{
Expand Down Expand Up @@ -295,13 +277,38 @@ ENGINE_API int RunApplication()

namespace
{
bool CheckBenchmark()
{
pcstr benchName = "-batch_benchmark ";
if (strstr(Core.Params, benchName))
{
const u32 sz = xr_strlen(benchName);
string64 benchmarkName;
sscanf(strstr(Core.Params, benchName) + sz, "%[^ ] ", benchmarkName);
RunBenchmark(benchmarkName);
return true;
}

pcstr sashName = "-openautomate ";
if (strstr(Core.Params, sashName))
{
const u32 sz = xr_strlen(sashName);
string512 sashArg;
sscanf(strstr(Core.Params, sashName) + sz, "%[^ ] ", sashArg);
g_SASH.Init(sashArg);
g_SASH.MainLoop();
return true;
}

return false;
}
void RunBenchmark(pcstr name)
{
g_bBenchmark = true;
string_path cfgPath;
FS.update_path(cfgPath, "$app_data_root$", name);
CInifile ini(cfgPath);
u32 benchmarkCount = ini.line_count("benchmark");
const u32 benchmarkCount = ini.line_count("benchmark");
for (u32 i = 0; i < benchmarkCount; i++)
{
LPCSTR benchmarkName, t;
Expand Down
4 changes: 3 additions & 1 deletion src/xrEngine/xrEngine.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@
<ClInclude Include="profiler_inline.h">
<Filter>General\Profiler</Filter>
</ClInclude>
<ClInclude Include="main.h" />
<ClInclude Include="splash.h">
<Filter>General</Filter>
</ClInclude>
Expand All @@ -565,6 +564,9 @@
<ClInclude Include="ShadersExternalData.h">
<Filter>Render\Visibility</Filter>
</ClInclude>
<ClInclude Include="main.h">
<Filter>General</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="defines.cpp">
Expand Down
3 changes: 1 addition & 2 deletions src/xrGame/ik/limb.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,7 @@ int Limb::try_singularities(int solves, float& swivel_angle, float x[])
//
// Assumes that either SetGoal or SetGoalPos has been called first
//
// XXX: Shouldn't the phInfinity declaration be in a header for xrPhysics?
extern XRPHYSICS_API const float phInfinity;

int Limb::Solve(float x[], float* new_swivel, float* new_pos)
{
int success;
Expand Down
1 change: 0 additions & 1 deletion src/xrPhysics/MathUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "xrCore/_cylinder.h"
#include <ode/common.h>

XRPHYSICS_API const float phInfinity = dInfinity;
/*
#include "MathUtils.h"
enum EBoxSideNearestPointCode
Expand Down
2 changes: 1 addition & 1 deletion src/xrPhysics/MathUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifdef DEBUG
#include "xrCore/dump_string.h"
#endif
extern XRPHYSICS_API const float phInfinity;
constexpr float phInfinity = std::numeric_limits<float>::infinity();

template <class T> struct _quaternion;
typedef _quaternion<float> Fquaternion;
Expand Down

0 comments on commit f0d7e55

Please sign in to comment.