diff --git a/Externals/cximage/cximage.vcxproj b/Externals/cximage/cximage.vcxproj
index 406855d93e3..72664690d32 100644
--- a/Externals/cximage/cximage.vcxproj
+++ b/Externals/cximage/cximage.vcxproj
@@ -191,6 +191,9 @@
{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}
+
+ {938c5808-85a1-4b5a-8cb4-d2d9d7851cb8}
+
diff --git a/Externals/cximage/ximacfg.h b/Externals/cximage/ximacfg.h
index edef7f9fe32..56e2e292daf 100644
--- a/Externals/cximage/ximacfg.h
+++ b/Externals/cximage/ximacfg.h
@@ -7,20 +7,18 @@ extern "C" void* cxrealloc(void* ptr, size_t size);
#ifdef CXIMAGE_AS_SHARED_LIBRARY //must be defined in Release_Shared configuration
+// XXX: dirty hack.
+#undef max
+#undef min
#include "xrCore/xrCore.h"
-#ifdef _MSC_VER // TODO: Remove this and instead depend on VS project "References"?
-#pragma comment(lib,"libjpeg.lib")
-#pragma comment(lib,"xrCore.lib")
-#endif
-
#ifdef CXIMAGE_BUILD
-# define CXIMAGE_API __declspec(dllexport)
+#define CXIMAGE_API XR_EXPORT
#else
-# define CXIMAGE_API __declspec(dllimport)
+#define CXIMAGE_API XR_IMPORT
#endif //#ifdef CXIMAGE_BUILD
#else //if CXIMAGE_AS_SHARED_LIBRARY linking as static library ...
-# define CXIMAGE_API
+#define CXIMAGE_API
#endif //CXIMAGE_AS_SHARED_LIBRARY
/////////////////////////////////////////////////////////////////////////////
diff --git a/Externals/cximage/ximajpg.h b/Externals/cximage/ximajpg.h
index 4fe8664fd04..e176ea3ca3d 100644
--- a/Externals/cximage/ximajpg.h
+++ b/Externals/cximage/ximajpg.h
@@ -27,7 +27,6 @@
#if CXIMAGE_SUPPORT_JPG
#define CXIMAGEJPG_SUPPORT_EXIF 1
-
#define XMD_H
#define HAVE_BOOLEAN
extern "C" {
@@ -37,8 +36,6 @@ extern "C" {
#undef HAVE_BOOLEAN
#undef XMD_H
-#pragma comment(lib, "libjpeg.lib")
-
class DLL_EXP CxImageJPG: public CxImage
{
public:
diff --git a/Externals/libvorbis_static.vcxproj b/Externals/libvorbis_static.vcxproj
index d1aff653099..6d8d1b4535f 100644
--- a/Externals/libvorbis_static.vcxproj
+++ b/Externals/libvorbis_static.vcxproj
@@ -22,6 +22,7 @@
{3A214E06-B95E-4D61-A291-1F8DF2EC10FD}
libvorbis
Win32Proj
+ 8.1
@@ -39,12 +40,12 @@
StaticLibrary
Unicode
true
- v140
+ v141
StaticLibrary
Unicode
- v140
+ v141
diff --git a/Externals/libvorbisfile_static.vcxproj b/Externals/libvorbisfile_static.vcxproj
index a906dbd1514..f0e03c85440 100644
--- a/Externals/libvorbisfile_static.vcxproj
+++ b/Externals/libvorbisfile_static.vcxproj
@@ -23,6 +23,7 @@
{CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}
libvorbisfile
Win32Proj
+ 8.1
@@ -38,12 +39,12 @@
StaticLibrary
Unicode
- v140
+ v141
StaticLibrary
Unicode
- v140
+ v141
diff --git a/src/Common/Common.vcxproj b/src/Common/Common.vcxproj
index a265ce8f8c6..6406363d855 100644
--- a/src/Common/Common.vcxproj
+++ b/src/Common/Common.vcxproj
@@ -143,6 +143,7 @@
+
diff --git a/src/Common/Common.vcxproj.filters b/src/Common/Common.vcxproj.filters
index 50e08a80b7e..9736fc9d023 100644
--- a/src/Common/Common.vcxproj.filters
+++ b/src/Common/Common.vcxproj.filters
@@ -81,6 +81,9 @@
xrCommon
+
+ Platform
+
diff --git a/src/Layers/xrRenderPC_GL/gl_R_sun.cpp b/src/Layers/xrRenderPC_R3/r2_R_sun.cpp
similarity index 100%
rename from src/Layers/xrRenderPC_GL/gl_R_sun.cpp
rename to src/Layers/xrRenderPC_R3/r2_R_sun.cpp
diff --git a/src/editors/ECore/Editor/EditObject.h b/src/editors/ECore/Editor/EditObject.h
index 516addf76ae..dd779230b5c 100644
--- a/src/editors/ECore/Editor/EditObject.h
+++ b/src/editors/ECore/Editor/EditObject.h
@@ -174,7 +174,6 @@ DEFINE_VECTOR(SBonePart, BPVec, BPIt);
const u32 FVF_SV = D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_NORMAL;
class ECORE_API CEditableObject :
-
public IKinematics,
public CPhysicsShellHolderEditorBase
{
diff --git a/src/editors/ECore/Editor/ExportObjectOGF.cpp b/src/editors/ECore/Editor/ExportObjectOGF.cpp
index 4125cc8b0de..d83bdec82a2 100644
--- a/src/editors/ECore/Editor/ExportObjectOGF.cpp
+++ b/src/editors/ECore/Editor/ExportObjectOGF.cpp
@@ -16,8 +16,8 @@
CObjectOGFCollectorPacked::CObjectOGFCollectorPacked(const Fbox& bb, int apx_vertices, int apx_faces)
{
// Params
- m_VMscale.set(bb.max.x - bb.min.x + EPS, bb.max.y - bb.min.y + EPS, bb.max.z - bb.min.z + EPS);
- m_VMmin.set(bb.min).sub(EPS);
+ m_VMscale.set(bb.vMax.x - bb.vMin.x + EPS, bb.vMax.y - bb.vMin.y + EPS, bb.vMax.z - bb.vMin.z + EPS);
+ m_VMmin.set(bb.vMin).sub(EPS);
m_VMeps.set(m_VMscale.x / clpOGFMX / 2, m_VMscale.y / clpOGFMY / 2, m_VMscale.z / clpOGFMZ / 2);
m_VMeps.x = (m_VMeps.x < EPS_L) ? m_VMeps.x : EPS_L;
m_VMeps.y = (m_VMeps.y < EPS_L) ? m_VMeps.y : EPS_L;
@@ -133,8 +133,8 @@ void CExportObjectOGF::SSplit::SavePart(IWriter& F, CObjectOGFCollectorPacked* p
H.format_version = xrOGF_FormatVersion;
H.type = (part->m_SWR.size()) ? MT_PROGRESSIVE : MT_NORMAL;
H.shader_id = 0;
- H.bb.min = part->m_Box.min;
- H.bb.max = part->m_Box.max;
+ H.bb.min = part->m_Box.vMin;
+ H.bb.max = part->m_Box.vMax;
part->m_Box.getsphere(H.bs.c, H.bs.r);
F.w(&H, sizeof(H));
F.close_chunk();
diff --git a/src/editors/ECore/Editor/ExportObjectOGF.h b/src/editors/ECore/Editor/ExportObjectOGF.h
index 2a4dca7bde1..48744e1aac8 100644
--- a/src/editors/ECore/Editor/ExportObjectOGF.h
+++ b/src/editors/ECore/Editor/ExportObjectOGF.h
@@ -4,6 +4,8 @@
#define ExportObjectOGFH
#include "utils/ETools/PropSlimTools.h"
+#include "xrCore/_fbox.h"
+
//---------------------------------------------------------------------------
const int clpOGFMX = 48, clpOGFMY = 16, clpOGFMZ = 48;
//---------------------------------------------------------------------------
@@ -37,8 +39,8 @@ struct SOGFVert
UV.set(uv);
}
- BOOL similar_pos(SOGFVert& V) { return P.similar(V.P, EPS_L); }
- BOOL similar(SOGFVert& V)
+ bool similar_pos(SOGFVert& V) { return P.similar(V.P, EPS_L); }
+ bool similar(SOGFVert& V)
{
if (!P.similar(V.P, EPS_L))
return FALSE;
@@ -78,25 +80,18 @@ class CObjectOGFCollectorPacked
void ComputeBounding();
void OptimizeTextureCoordinates();
-public:
CObjectOGFCollectorPacked(const Fbox& bb, int apx_vertices, int apx_faces);
void CalculateTB();
void MakeProgressive();
- IC
- bool
- check(SOGFFace& F)
+ bool check(SOGFFace& F)
{
if ((F.v[0] == F.v[1]) || (F.v[0] == F.v[2]) || (F.v[1] == F.v[2]))
return false;
- else
- return true;
+ return true;
}
- IC
-
- bool
- add_face(SOGFVert& v0, SOGFVert& v1, SOGFVert& v2)
+ bool add_face(SOGFVert& v0, SOGFVert& v1, SOGFVert& v2)
{
if (v0.P.similar(v1.P, EPS) || v0.P.similar(v2.P, EPS) || v1.P.similar(v2.P, EPS))
{
@@ -128,11 +123,11 @@ class CObjectOGFCollectorPacked
return true;
}
- IC OGFVertVec& getV_Verts() { return m_Verts; }
- IC OGFFaceVec& getV_Faces() { return m_Faces; }
- IC SOGFVert* getVert() { return &m_Verts.front(); }
- IC u32 getVS() { return m_Verts.size(); }
- IC u32 getTS() { return m_Faces.size(); }
+ OGFVertVec& getV_Verts() { return m_Verts; }
+ OGFFaceVec& getV_Faces() { return m_Faces; }
+ SOGFVert* getVert() { return &m_Verts.front(); }
+ u32 getVS() { return m_Verts.size(); }
+ u32 getTS() { return m_Faces.size(); }
};
//----------------------------------------------------
@@ -157,7 +152,7 @@ class ECORE_API CExportObjectOGF
void CalculateTB()
{
- for (COGFCPIt it = m_Parts.begin(); it != m_Parts.end(); it++)
+ for (COGFCPIt it = m_Parts.begin(); it != m_Parts.end(); ++it)
(*it)->CalculateTB();
}
void MakeProgressive();
diff --git a/src/plugins/Max/Material/Stdafx.h b/src/plugins/Max/Material/Stdafx.h
index 7b74b137859..5fe71b8a41d 100644
--- a/src/plugins/Max/Material/Stdafx.h
+++ b/src/plugins/Max/Material/Stdafx.h
@@ -12,7 +12,6 @@
#include "Max.h"
#include "xrCore/xrCore.h"
-#pragma comment(lib, "xrCore.lib")
#undef _MIN
#undef _MAX
@@ -41,9 +40,9 @@ using std::string;
#define FLT_MIN flt_max
#include
-#include
+#include
#include
-#include
+#include
#include "istdplug.h"
#include "iparamb2.h"
diff --git a/src/plugins/Maya/Maya_Export2008.vcxproj b/src/plugins/Maya/Maya_Export2008.vcxproj
index 946559d749f..a2f6f692d97 100644
--- a/src/plugins/Maya/Maya_Export2008.vcxproj
+++ b/src/plugins/Maya/Maya_Export2008.vcxproj
@@ -324,9 +324,6 @@
-
- {cc912a26-e688-49f5-99f4-7a0f9af4e438}
-
{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}
diff --git a/src/utils/xrMiscMath/matrix.cpp b/src/utils/xrMiscMath/matrix.cpp
index 8c1785421ad..abbe4c09023 100644
--- a/src/utils/xrMiscMath/matrix.cpp
+++ b/src/utils/xrMiscMath/matrix.cpp
@@ -427,7 +427,7 @@ template
void _matrix::getHPB(T& h, T& p, T& b) const
{
T cy = _sqrt(j.y*j.y + i.y*i.y);
- if (cy > 16.0f*type_epsilon(T))
+ if (cy > 16.0f*type_epsilon)
{
h = (T)-atan2(k.x, k.z);
p = (T)-atan2(-k.y, cy);
diff --git a/src/utils/xrMiscMath/xrMiscMath.cpp b/src/utils/xrMiscMath/xrMiscMath.cpp
index e9e41b5dde3..0ce4bdf2111 100644
--- a/src/utils/xrMiscMath/xrMiscMath.cpp
+++ b/src/utils/xrMiscMath/xrMiscMath.cpp
@@ -1,6 +1,4 @@
#include "xrCore/_vector3d.h"
-#include "xrCore/_random.h"
-#include "xrCore/xrDebug.h"
//#include "xrCore/math_constants.h"
#include "xrCore/vector.h"
@@ -74,8 +72,3 @@ bool exact_normalize(float* a)
}
bool exact_normalize(Fvector3& a) { return exact_normalize(&a.x); }
-
-//////////////////////////////////////////////////////////////////
-
-s32 CRandom::randI(s32 max) { VERIFY(max); return randI() % max; }
-
diff --git a/src/xrCDB/xrCDB.vcxproj b/src/xrCDB/xrCDB.vcxproj
index a4f440af0df..7cbb56942bc 100644
--- a/src/xrCDB/xrCDB.vcxproj
+++ b/src/xrCDB/xrCDB.vcxproj
@@ -351,6 +351,9 @@
{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}
false
+
+ {7885cf3c-ee04-4c67-9467-1fbf9a36b037}
+
diff --git a/src/xrCommon/xalloc.h b/src/xrCommon/xalloc.h
index 38490f9bdda..674a4b18927 100644
--- a/src/xrCommon/xalloc.h
+++ b/src/xrCommon/xalloc.h
@@ -33,8 +33,8 @@ class xalloc
char* _charalloc(size_type n) { return (char*)allocate(n); }
void deallocate(pointer p, size_type n) const { xr_free(p); }
void deallocate(void* p, size_type n) const { xr_free(p); }
- void construct(pointer p, const T& _Val) { std::_Construct(p, _Val); }
- void destroy(pointer p) { std::_Destroy(p); }
+ void construct(pointer p, const T& _Val) { new(p) T(_Val); }
+ void destroy(pointer p) { p->~T(); }
size_type max_size() const
{
size_type _Count = (size_type)(-1)/sizeof(T);
diff --git a/src/xrCore/_bitwise.h b/src/xrCore/_bitwise.h
index 05a4205d682..93384c9666d 100644
--- a/src/xrCore/_bitwise.h
+++ b/src/xrCore/_bitwise.h
@@ -23,22 +23,22 @@ IC bool positive(const float f) { return f >= 0; }
IC void set_negative(float& f) { f = -fabsf(f); }
IC void set_positive(float& f) { f = fabsf(f); }
#else
-IC BOOL negative(const float& f) { return (*((unsigned*)(&f)) & fdSGN); }
-IC BOOL positive(const float& f) { return (*((unsigned*)(&f)) & fdSGN) == 0; }
-IC void set_negative(float& f) { (*(unsigned*)(&f)) |= fdSGN; }
-IC void set_positive(float& f) { (*(unsigned*)(&f)) &= ~fdSGN; }
+IC bool negative(const float& f) { return *(unsigned*)&f & fdSGN; }
+IC bool positive(const float& f) { return (*(unsigned*)&f & fdSGN) == 0; }
+IC void set_negative(float& f) { *(unsigned*)&f |= fdSGN; }
+IC void set_positive(float& f) { *(unsigned*)&f &= ~fdSGN; }
#endif
/*
* Here are a few nice tricks for 2's complement based machines
* that I discovered a few months ago.
*/
-IC int btwLowestBitMask(int v) { return (v & -v); }
+IC int btwLowestBitMask(int v) { return v & -v; }
IC u32 btwLowestBitMask(u32 x) { return x & ~(x - 1); }
/* Ok, so now we are cooking on gass. Here we use this function for some */
/* rather useful utility functions */
-IC bool btwIsPow2(int v) { return (btwLowestBitMask(v) == v); }
-IC bool btwIsPow2(u32 v) { return (btwLowestBitMask(v) == v); }
+IC bool btwIsPow2(int v) { return btwLowestBitMask(v) == v; }
+IC bool btwIsPow2(u32 v) { return btwLowestBitMask(v) == v; }
IC int btwPow2_Ceil(int v)
{
int i = btwLowestBitMask(v);
@@ -58,9 +58,9 @@ IC u32 btwPow2_Ceil(u32 v)
// Counting number of nonzero bits for 8bit number:
IC u8 btwCount1(u8 v)
{
- v = (v & 0x55) + ((v >> 1) & 0x55);
- v = (v & 0x33) + ((v >> 2) & 0x33);
- return (v & 0x0f) + ((v >> 4) & 0x0f);
+ v = (v & 0x55) + (v >> 1 & 0x55);
+ v = (v & 0x33) + (v >> 2 & 0x33);
+ return (v & 0x0f) + (v >> 4 & 0x0f);
}
// same for 32bit
@@ -68,9 +68,9 @@ IC u32 btwCount1(u32 v)
{
const u32 g31 = 0x49249249ul; // = 0100_1001_0010_0100_1001_0010_0100_1001
const u32 g32 = 0x381c0e07ul; // = 0011_1000_0001_1100_0000_1110_0000_0111
- v = (v & g31) + ((v >> 1) & g31) + ((v >> 2) & g31);
- v = ((v + (v >> 3)) & g32) + ((v >> 6) & g32);
- return (v + (v >> 9) + (v >> 18) + (v >> 27)) & 0x3f;
+ v = (v & g31) + (v >> 1 & g31) + (v >> 2 & g31);
+ v = (v + (v >> 3) & g32) + (v >> 6 & g32);
+ return v + (v >> 9) + (v >> 18) + (v >> 27) & 0x3f;
}
IC u64 btwCount1(u64 v) { return btwCount1(u32(v & u32(-1))) + btwCount1(u32(v >> u64(32))); }
@@ -78,16 +78,16 @@ IC u64 btwCount1(u64 v) { return btwCount1(u32(v & u32(-1))) + btwCount1(u32(v >
// Additionally, doesn't SSE2 have a fast ftol() ?
ICF int iFloor(float x)
{
- int a = *(const int*)(&x);
- int exponent = (127 + 31) - ((a >> 23) & 0xFF);
- int r = (((u32)(a) << 8) | (1U << 31)) >> exponent;
+ int a = *(const int*)&x;
+ int exponent = 127 + 31 - (a >> 23 & 0xFF);
+ int r = ((u32)a << 8 | 1U << 31) >> exponent;
exponent += 31 - 127;
{
- int imask = (!(((((1 << (exponent))) - 1) >> 8) & a));
- exponent -= (31 - 127) + 32;
+ int imask = !((1 << exponent) - 1 >> 8 & a);
+ exponent -= 31 - 127 + 32;
exponent >>= 31;
a >>= 31;
- r -= (imask & a);
+ r -= imask & a;
r &= exponent;
r ^= a;
}
@@ -99,16 +99,16 @@ ICF int iFloor(float x)
*/
ICF int iCeil(float x)
{
- int a = (*(const int*)(&x));
- int exponent = (127 + 31) - ((a >> 23) & 0xFF);
- int r = (((u32)(a) << 8) | (1U << 31)) >> exponent;
+ int a = *(const int*)&x;
+ int exponent = 127 + 31 - (a >> 23 & 0xFF);
+ int r = ((u32)a << 8 | 1U << 31) >> exponent;
exponent += 31 - 127;
{
- int imask = (!(((((1 << (exponent))) - 1) >> 8) & a));
- exponent -= (31 - 127) + 32;
+ int imask = !((1 << exponent) - 1 >> 8 & a);
+ exponent -= 31 - 127 + 32;
exponent >>= 31;
- a = ~((a - 1) >> 31); /* change sign */
- r -= (imask & a);
+ a = ~(a - 1 >> 31); /* change sign */
+ r -= imask & a;
r &= exponent;
r ^= a;
r = -r; /* change sign */
@@ -126,7 +126,7 @@ IC bool fis_denormal(const float& f) { return !(*(int*)&f & 0x7f800000); }
// Approximated calculations
IC float apx_InvSqrt(const float& n)
{
- long tmp = (long(0xBE800000) - *(long*)&n) >> 1;
+ long tmp = long(0xBE800000) - *(long*)&n >> 1;
float y = *(float*)&tmp;
return y * (1.47f - 0.47f * n * y * y);
}
diff --git a/src/xrCore/_fbox.h b/src/xrCore/_fbox.h
index 054e740b45c..7a69ec3e59b 100644
--- a/src/xrCore/_fbox.h
+++ b/src/xrCore/_fbox.h
@@ -7,14 +7,13 @@ template
class _box3
{
public:
- typedef T TYPE;
- typedef _box3 Self;
- typedef Self& SelfRef;
- typedef const Self& SelfCRef;
- typedef _vector3 Tvector;
- typedef _matrix Tmatrix;
+ using TYPE = T;
+ using Self = _box3;
+ using SelfRef = Self&;
+ using SelfCRef = const Self&;
+ using Tvector = _vector3;
+ using Tmatrix = _matrix;
-public:
union
{
struct
@@ -29,96 +28,108 @@ class _box3
};
};
- IC bool is_valid() const throw() { return (x2 >= x1) && (y2 >= y1) && (z2 >= z1); }
- IC const T* data() const throw() { return &vMin.x; }
+ bool is_valid() const throw() { return (x2 >= x1) && (y2 >= y1) && (z2 >= z1); }
+ const T* data() const throw() { return &vMin.x; }
- IC SelfRef set(const Tvector& _min, const Tvector& _max)
+ SelfRef set(const Tvector& _min, const Tvector& _max)
{
vMin.set(_min);
vMax.set(_max);
return *this;
};
- IC SelfRef set(T x1, T y1, T z1, T x2, T y2, T z2)
+
+ SelfRef set(T x1, T y1, T z1, T x2, T y2, T z2)
{
vMin.set(x1, y1, z1);
vMax.set(x2, y2, z2);
return *this;
};
- IC SelfRef set(SelfCRef b)
+
+ SelfRef set(SelfCRef b)
{
vMin.set(b.vMin);
vMax.set(b.vMax);
return *this;
};
- IC SelfRef setb(const Tvector& center, const Tvector& dim)
+
+ SelfRef setb(const Tvector& center, const Tvector& dim)
{
vMin.sub(center, dim);
vMax.add(center, dim);
return *this;
}
- IC SelfRef set_zero()
+
+ SelfRef set_zero()
{
vMin.set(0, 0, 0);
vMax.set(0, 0, 0);
return *this;
};
- IC SelfRef identity()
+
+ SelfRef identity()
{
vMin.set(-0.5, -0.5, -0.5);
vMax.set(0.5, 0.5, 0.5);
return *this;
};
- IC SelfRef invalidate()
+
+ SelfRef invalidate()
{
vMin.set(type_max, type_max, type_max);
vMax.set(type_min, type_min, type_min);
return *this;
}
- IC SelfRef shrink(T s)
+ SelfRef shrink(T s)
{
vMin.add(s);
vMax.sub(s);
return *this;
};
- IC SelfRef shrink(const Tvector& s)
+
+ SelfRef shrink(const Tvector& s)
{
vMin.add(s);
vMax.sub(s);
return *this;
};
- IC SelfRef grow(T s)
+
+ SelfRef grow(T s)
{
vMin.sub(s);
vMax.add(s);
return *this;
};
- IC SelfRef grow(const Tvector& s)
+
+ SelfRef grow(const Tvector& s)
{
vMin.sub(s);
vMax.add(s);
return *this;
};
- IC SelfRef add(const Tvector& p)
+ SelfRef add(const Tvector& p)
{
vMin.add(p);
vMax.add(p);
return *this;
};
- IC SelfRef sub(const Tvector& p)
+
+ SelfRef sub(const Tvector& p)
{
vMin.sub(p);
vMax.sub(p);
return *this;
};
- IC SelfRef offset(const Tvector& p)
+
+ SelfRef offset(const Tvector& p)
{
vMin.add(p);
vMax.add(p);
return *this;
};
- IC SelfRef add(SelfCRef b, const Tvector& p)
+
+ SelfRef add(SelfCRef b, const Tvector& p)
{
vMin.add(b.min, p);
vMax.add(b.max, p);
@@ -131,7 +142,7 @@ class _box3
};
ICF BOOL contains(const Tvector& p) const { return contains(p.x, p.y, p.z); };
ICF BOOL contains(SelfCRef b) const { return contains(b.vMin) && contains(b.vMax); };
- IC BOOL similar(SelfCRef b) const { return vMin.similar(b.vMin) && vMax.similar(b.vMax); };
+ BOOL similar(SelfCRef b) const { return vMin.similar(b.vMin) && vMax.similar(b.vMax); };
ICF SelfRef modify(const Tvector& p)
{
@@ -145,13 +156,14 @@ class _box3
return modify(tmp);
}
- IC SelfRef merge(SelfCRef b)
+ SelfRef merge(SelfCRef b)
{
modify(b.vMin);
modify(b.vMax);
return *this;
};
- IC SelfRef merge(SelfCRef b1, SelfCRef b2)
+
+ SelfRef merge(SelfCRef b1, SelfCRef b2)
{
invalidate();
merge(b1);
@@ -218,45 +230,52 @@ class _box3
return xform(b, m);
}
- IC void getsize(Tvector& R) const { R.sub(vMax, vMin); };
- IC void getradius(Tvector& R) const
+ void getsize(Tvector& R) const { R.sub(vMax, vMin); };
+
+ void getradius(Tvector& R) const
{
getsize(R);
R.mul(0.5f);
};
- IC T getradius() const
+
+ T getradius() const
{
Tvector R;
getradius(R);
return R.magnitude();
};
- IC T getvolume() const
+
+ T getvolume() const
{
Tvector sz;
getsize(sz);
return sz.x * sz.y * sz.z;
};
- IC SelfCRef getcenter(Tvector& C) const
+
+ SelfCRef getcenter(Tvector& C) const
{
C.x = (vMin.x + vMax.x) * 0.5f;
C.y = (vMin.y + vMax.y) * 0.5f;
C.z = (vMin.z + vMax.z) * 0.5f;
return *this;
};
- IC SelfCRef get_CD(Tvector& bc, Tvector& bd) const // center + dimensions
+
+ SelfCRef get_CD(Tvector& bc, Tvector& bd) const // center + dimensions
{
bd.sub(vMax, vMin).mul(.5f);
bc.add(vMin, bd);
return *this;
}
- IC SelfRef scale(float s) // 0.1 means make 110%, -0.1 means make 90%
+
+ SelfRef scale(float s) // 0.1 means make 110%, -0.1 means make 90%
{
Fvector bd;
bd.sub(vMax, vMin).mul(s);
grow(bd);
return *this;
}
- IC SelfCRef getsphere(Tvector& C, T& R) const
+
+ SelfCRef getsphere(Tvector& C, T& R) const
{
getcenter(C);
R = C.distance_to(vMax);
@@ -282,7 +301,7 @@ class _box3
};
// Does the vector3 intersects box
- IC BOOL Pick(const Tvector& start, const Tvector& dir)
+ BOOL Pick(const Tvector& start, const Tvector& dir)
{
T alpha, xt, yt, zt;
Tvector rvmin, rvmax;
@@ -352,7 +371,7 @@ class _box3
return false;
};
- IC u32& IntRref(T& x) { return (u32&)x; }
+ u32& IntRref(T& x) { return (u32&)x; }
enum ERP_Result
{
rpNone = 0,
@@ -360,7 +379,8 @@ class _box3
rpOriginOutside = 2,
fcv_forcedword = u32(-1)
};
- IC ERP_Result Pick2(const Tvector& origin, const Tvector& dir, Tvector& coord)
+
+ ERP_Result Pick2(const Tvector& origin, const Tvector& dir, Tvector& coord)
{
BOOL Inside = TRUE;
Tvector MaxT;
@@ -470,7 +490,7 @@ class _box3
return rpNone;
}
- IC void getpoint(int index, Tvector& result) const
+ void getpoint(int index, Tvector& result) const
{
switch (index)
{
@@ -485,7 +505,8 @@ class _box3
default: result.set(0, 0, 0); break;
}
};
- IC void getpoints(Tvector* result)
+
+ void getpoints(Tvector* result)
{
result[0].set(vMin.x, vMin.y, vMin.z);
result[1].set(vMin.x, vMin.y, vMax.z);
@@ -497,7 +518,7 @@ class _box3
result[7].set(vMax.x, vMax.y, vMin.z);
};
- IC SelfRef modify(SelfCRef src, const Tmatrix& M)
+ SelfRef modify(SelfCRef src, const Tmatrix& M)
{
Tvector pt;
for (int i = 0; i < 8; i++)
diff --git a/src/xrCore/_random.h b/src/xrCore/_random.h
index 98cce5938b2..85bea9541cc 100644
--- a/src/xrCore/_random.h
+++ b/src/xrCore/_random.h
@@ -3,6 +3,7 @@
#include "_types.h"
#include "xrCommon/inlining_macros.h"
#include "xrCore_impexp.h"
+#include "xrCore/xrDebug.h"
/*
u32 dwRandSeed;
@@ -21,28 +22,27 @@ return(dwResult);
}
*/
-class CRandom
+class XRCORE_API CRandom
{
-private:
volatile s32 holdrand;
public:
CRandom() : holdrand(1){};
CRandom(s32 _seed) : holdrand(_seed){};
- IC void seed(s32 val) { holdrand = val; }
- IC s32 maxI() { return 32767; }
- ICN s32 randI() { return (((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff); }
- IC s32 randI(s32 max);
- IC s32 randI(s32 min, s32 max) { return min + randI(max - min); }
- IC s32 randIs(s32 range) { return randI(-range, range); }
- IC s32 randIs(s32 range, s32 offs) { return offs + randIs(range); }
- IC float maxF() { return 32767.f; }
- IC float randF() { return float(randI()) / maxF(); }
- IC float randF(float max) { return randF() * max; }
- IC float randF(float min, float max) { return min + randF(max - min); }
- IC float randFs(float range) { return randF(-range, range); }
- IC float randFs(float range, float offs) { return offs + randFs(range); }
+ void seed(s32 val) { holdrand = val; }
+ s32 maxI() { return 32767; }
+ ICN s32 randI() { return (holdrand = holdrand * 214013L + 2531011L) >> 16 & 0x7fff; }
+ s32 randI(s32 max) { VERIFY(max); return randI() % max; };
+ s32 randI(s32 min, s32 max) { return min + randI(max - min); }
+ s32 randIs(s32 range) { return randI(-range, range); }
+ s32 randIs(s32 range, s32 offs) { return offs + randIs(range); }
+ float maxF() { return 32767.f; }
+ float randF() { return float(randI()) / maxF(); }
+ float randF(float max) { return randF() * max; }
+ float randF(float min, float max) { return min + randF(max - min); }
+ float randFs(float range) { return randF(-range, range); }
+ float randFs(float range, float offs) { return offs + randFs(range); }
};
XRCORE_API extern CRandom Random;
diff --git a/src/xrCore/_types.h b/src/xrCore/_types.h
index d94a241657f..f07ea940d5a 100644
--- a/src/xrCore/_types.h
+++ b/src/xrCore/_types.h
@@ -1,8 +1,6 @@
#pragma once
#ifndef TYPES_H
#define TYPES_H
-#include // _MAX_PATH
-
#include
#include
diff --git a/src/xrCore/_vector3d.h b/src/xrCore/_vector3d.h
index 1396abc2714..c70ca69471f 100644
--- a/src/xrCore/_vector3d.h
+++ b/src/xrCore/_vector3d.h
@@ -1,6 +1,7 @@
#pragma once
#ifndef __V3D__
#define __V3D__
+#include
// XXX: review
//#include "Common/Platform.hpp"
#include "xrCommon/inlining_macros.h"
@@ -10,53 +11,56 @@
template
struct _vector3
{
-public:
- typedef T TYPE;
- typedef _vector3 Self;
- typedef Self& SelfRef;
- typedef const Self& SelfCRef;
+ using TYPE = T;
+ using Self = _vector3;
+ using SelfRef = Self&;
+ using SelfCRef = const Self&;
-public:
T x, y, z;
// access operators
ICF T& operator[](int i) { return *((T*)this + i); }
ICF T& operator[](int i) const { return *((T*)this + i); }
+
ICF SelfRef set(T _x, T _y, T _z)
{
x = _x;
y = _y;
z = _z;
return *this;
- };
+ }
+
ICF SelfRef set(const _vector3& v)
{
x = T(v.x);
y = T(v.y);
z = T(v.z);
return *this;
- };
+ }
+
ICF SelfRef set(const _vector3& v)
{
x = T(v.x);
y = T(v.y);
z = T(v.z);
return *this;
- };
+ }
+
ICF SelfRef set(float* p)
{
x = p[0];
y = p[1];
z = p[2];
return *this;
- };
+ }
+
ICF SelfRef set(double* p)
{
x = p[0];
y = p[1];
z = p[2];
return *this;
- };
+ }
ICF SelfRef add(const Self& v)
{
@@ -64,28 +68,31 @@ struct _vector3
y += v.y;
z += v.z;
return *this;
- };
+ }
+
ICF SelfRef add(T s)
{
x += s;
y += s;
z += s;
return *this;
- };
+ }
+
ICF SelfRef add(const Self& a, const Self& v)
{
x = a.x + v.x;
y = a.y + v.y;
z = a.z + v.z;
return *this;
- };
+ }
+
ICF SelfRef add(const Self& a, T s)
{
x = a.x + s;
y = a.y + s;
z = a.z + s;
return *this;
- };
+ }
ICF SelfRef sub(const Self& v)
{
@@ -93,28 +100,31 @@ struct _vector3
y -= v.y;
z -= v.z;
return *this;
- };
+ }
+
ICF SelfRef sub(T s)
{
x -= s;
y -= s;
z -= s;
return *this;
- };
+ }
+
ICF SelfRef sub(const Self& a, const Self& v)
{
x = a.x - v.x;
y = a.y - v.y;
z = a.z - v.z;
return *this;
- };
+ }
+
ICF SelfRef sub(const Self& a, T s)
{
x = a.x - s;
y = a.y - s;
z = a.z - s;
return *this;
- };
+ }
ICF SelfRef mul(const Self& v)
{
@@ -122,28 +132,31 @@ struct _vector3
y *= v.y;
z *= v.z;
return *this;
- };
+ }
+
ICF SelfRef mul(T s)
{
x *= s;
y *= s;
z *= s;
return *this;
- };
+ }
+
ICF SelfRef mul(const Self& a, const Self& v)
{
x = a.x * v.x;
y = a.y * v.y;
z = a.z * v.z;
return *this;
- };
+ }
+
ICF SelfRef mul(const Self& a, T s)
{
x = a.x * s;
y = a.y * s;
z = a.z * s;
return *this;
- };
+ }
ICF SelfRef div(const Self& v)
{
@@ -151,37 +164,41 @@ struct _vector3
y /= v.y;
z /= v.z;
return *this;
- };
+ }
+
ICF SelfRef div(T s)
{
x /= s;
y /= s;
z /= s;
return *this;
- };
+ }
+
ICF SelfRef div(const Self& a, const Self& v)
{
x = a.x / v.x;
y = a.y / v.y;
z = a.z / v.z;
return *this;
- };
+ }
+
ICF SelfRef div(const Self& a, T s)
{
x = a.x / s;
y = a.y / s;
z = a.z / s;
return *this;
- };
+ }
- IC SelfRef invert()
+ SelfRef invert()
{
x = -x;
y = -y;
z = -z;
return *this;
}
- IC SelfRef invert(const Self& a)
+
+ SelfRef invert(const Self& a)
{
x = -a.x;
y = -a.y;
@@ -189,28 +206,31 @@ struct _vector3
return *this;
}
- IC SelfRef min(const Self& v1, const Self& v2)
+ SelfRef min(const Self& v1, const Self& v2)
{
x = std::min(v1.x, v2.x);
y = std::min(v1.y, v2.y);
z = std::min(v1.z, v2.z);
return *this;
}
- IC SelfRef min(const Self& v)
+
+ SelfRef min(const Self& v)
{
x = std::min(x, v.x);
y = std::min(y, v.y);
z = std::min(z, v.z);
return *this;
}
- IC SelfRef max(const Self& v1, const Self& v2)
+
+ SelfRef max(const Self& v1, const Self& v2)
{
x = std::max(v1.x, v2.x);
y = std::max(v1.y, v2.y);
z = std::max(v1.z, v2.z);
return *this;
}
- IC SelfRef max(const Self& v)
+
+ SelfRef max(const Self& v)
{
x = std::max(x, v.x);
y = std::max(y, v.y);
@@ -218,14 +238,15 @@ struct _vector3
return *this;
}
- IC SelfRef abs(const Self& v)
+ SelfRef abs(const Self& v)
{
x = _abs(v.x);
y = _abs(v.y);
z = _abs(v.z);
return *this;
}
- ICF BOOL similar(const Self& v, T E = EPS_L) const
+
+ ICF bool similar(const Self& v, T E = EPS_L) const
{
return _abs(x - v.x) < E && _abs(y - v.y) < E && _abs(z - v.z) < E;
};
@@ -258,17 +279,17 @@ struct _vector3
SelfRef mad(const Self& p, const Self& d, const Self& s);
// SQ magnitude
- T square_magnitude(void) const;
+ T square_magnitude() const;
// magnitude
- T magnitude(void) const;
+ T magnitude() const;
// Normalize
- T normalize_magn(void);
+ T normalize_magn();
- SelfRef normalize(void);
+ SelfRef normalize();
// Safe-Normalize
- SelfRef normalize_safe(void);
+ SelfRef normalize_safe();
// Normalize
SelfRef normalize(const Self& v);
@@ -319,15 +340,18 @@ struct _vector3
static void generate_orthonormal_basis(const _vector3& dir, _vector3& up, _vector3& right);
static void generate_orthonormal_basis_normalized(_vector3& dir, _vector3& up, _vector3& right);
};
-typedef _vector3 Fvector;
-typedef _vector3 Fvector3;
-typedef _vector3 Dvector;
-typedef _vector3 Dvector3;
-typedef _vector3 Ivector;
-typedef _vector3 Ivector3;
+
+using Fvector = _vector3;
+using Fvector3 = _vector3;
+
+using Dvector = _vector3;
+using Dvector3 = _vector3;
+
+using Ivector = _vector3;
+using Ivector3 = _vector3;
template
-BOOL _valid(const _vector3& v)
+bool _valid(const _vector3& v)
{
return _valid((T)v.x) && _valid((T)v.y) && _valid((T)v.z);
}
diff --git a/src/xrCore/memory_monitor.cpp b/src/xrCore/memory_monitor.cpp
index 007d6919c26..4bd75d5f64a 100644
--- a/src/xrCore/memory_monitor.cpp
+++ b/src/xrCore/memory_monitor.cpp
@@ -84,8 +84,8 @@ STATIC void initialize()
XRCORE_API int memory_monitor::counter = 0;
XRCORE_API int memory_monitor::counter_alloc = 0;
XRCORE_API int memory_monitor::counter_free = 0;
-void memory_monitor::monitor_alloc(
- const void* allocation_address, const u32& allocation_size, LPCSTR allocation_description)
+XRCORE_API void memory_monitor::monitor_alloc(
+ const void* pointer, const u32& size, const char* description)
{
counter++;
counter_alloc++;
@@ -107,10 +107,10 @@ void memory_monitor::monitor_alloc(
_allocation_size temp;
temp.allocation = 1;
- temp.size = allocation_size;
+ temp.size = size;
fwrite(&temp, sizeof(temp), 1, file());
- fwrite(&allocation_address, sizeof(allocation_address), 1, file());
- fwrite(allocation_description, (xr_strlen(allocation_description) + 1) * sizeof(char), 1, file());
+ fwrite(&pointer, sizeof(pointer), 1, file());
+ fwrite(description, (xr_strlen(description) + 1) * sizeof(char), 1, file());
if (!detaching)
;
@@ -146,11 +146,11 @@ void memory_monitor::monitor_free(const void* deallocation_address)
LeaveCriticalSection(&critical_section);
}
-void memory_monitor::make_checkpoint(LPCSTR checkpoint_name)
+XRCORE_API void memory_monitor::make_checkpoint(const char* name)
{
fflush(file());
string_path fn;
- strconcat(sizeof(fn), fn, output_folder, checkpoint_name, output_extension);
+ strconcat(sizeof(fn), fn, output_folder, name, output_extension);
Msg("Creating memory checkpoint file[%s]...", fn);
CopyFile(file_name(), fn, FALSE);
diff --git a/src/xrCore/memory_monitor.h b/src/xrCore/memory_monitor.h
index e462b7cd1f0..e962d87ab3f 100644
--- a/src/xrCore/memory_monitor.h
+++ b/src/xrCore/memory_monitor.h
@@ -16,9 +16,9 @@
namespace memory_monitor
{
XRCORE_API void flush_each_time(const bool& value);
-XRCORE_API void monitor_alloc(const void* pointer, const u32& size, LPCSTR description);
+XRCORE_API void monitor_alloc(const void* pointer, const u32& size, const char* description);
XRCORE_API void monitor_free(const void* pointer);
-XRCORE_API void make_checkpoint(LPCSTR name);
+XRCORE_API void make_checkpoint(const char* name);
extern XRCORE_API int counter;
extern XRCORE_API int counter_alloc;
extern XRCORE_API int counter_free;
diff --git a/src/xrCore/xrCore.cpp b/src/xrCore/xrCore.cpp
index 1a02d760019..04414780a30 100644
--- a/src/xrCore/xrCore.cpp
+++ b/src/xrCore/xrCore.cpp
@@ -67,7 +67,7 @@ void xrCore::_initialize(LPCSTR _ApplicationName, LogCallback cb, BOOL init_fs,
// Mathematics & PSI detection
CPU::Detect();
- Memory._initialize(strstr(Params, "-mem_debug") ? TRUE : FALSE);
+ Memory._initialize(strstr(Params, "-mem_debug") ? true : false);
DUMP_PHASE;
diff --git a/src/xrCore/xrCore.vcxproj b/src/xrCore/xrCore.vcxproj
index 49f618fcc93..830eadcf00f 100644
--- a/src/xrCore/xrCore.vcxproj
+++ b/src/xrCore/xrCore.vcxproj
@@ -425,6 +425,9 @@
{614aa57f-58d7-45a8-a5ff-93f04b05fac6}
+
+ {7885cf3c-ee04-4c67-9467-1fbf9a36b037}
+
{c964d17a-05a8-4bfa-b0a8-7af5c6b627ec}
diff --git a/src/xrCore/xrDebug.h b/src/xrCore/xrDebug.h
index 89fe84483b0..98f4a11841e 100644
--- a/src/xrCore/xrDebug.h
+++ b/src/xrCore/xrDebug.h
@@ -1,4 +1,5 @@
#pragma once
+#include "Common/Platform.hpp"
#include "xrCore/_types.h"
#include
diff --git a/src/xrCore/xrMemory.cpp b/src/xrCore/xrMemory.cpp
index 3faf86be28a..aa505496b44 100644
--- a/src/xrCore/xrMemory.cpp
+++ b/src/xrCore/xrMemory.cpp
@@ -7,7 +7,7 @@
#include
xrMemory Memory;
-BOOL mem_initialized = FALSE;
+bool mem_initialized = false;
bool shared_str_initialized = false;
// fake fix of memory corruptions in multiplayer game :(
@@ -46,7 +46,7 @@ xrMemory::xrMemory()
BOOL g_bMEMO = FALSE;
#endif // DEBUG_MEMORY_MANAGER
-void xrMemory::_initialize(BOOL bDebug)
+void xrMemory::_initialize(bool bDebug)
{
#ifdef DEBUG_MEMORY_MANAGER
debug_mode = bDebug;
@@ -75,7 +75,7 @@ void xrMemory::_initialize(BOOL bDebug)
else
g_bMEMO = TRUE;
#else // DEBUG_MEMORY_MANAGER
- mem_initialized = TRUE;
+ mem_initialized = true;
#endif // DEBUG_MEMORY_MANAGER
// DUMP_PHASE;
@@ -114,7 +114,7 @@ void xrMemory::_destroy()
#endif // DEBUG_MEMORY_MANAGER
#endif // M_BORLAND
- mem_initialized = FALSE;
+ mem_initialized = true;
#ifdef DEBUG_MEMORY_MANAGER
debug_mode = FALSE;
#endif // DEBUG_MEMORY_MANAGER
@@ -142,7 +142,7 @@ ICF u8* acc_header(void* P)
return _P - 1;
}
ICF u32 get_header(void* P) { return (u32)*acc_header(P); }
-void xrMemory::mem_statistic(LPCSTR fn)
+void xrMemory::mem_statistic(const char* fn)
{
if (!debug_mode)
return;
diff --git a/src/xrCore/xrMemory.h b/src/xrCore/xrMemory.h
index fb6eaa0fa0e..b9d07e11f53 100644
--- a/src/xrCore/xrMemory.h
+++ b/src/xrCore/xrMemory.h
@@ -49,7 +49,7 @@ class XRCORE_API xrMemory
public:
xrMemory();
- void _initialize(BOOL _debug_mode = FALSE);
+ void _initialize(bool _debug_mode = false);
void _destroy();
#ifdef DEBUG_MEMORY_MANAGER
@@ -74,7 +74,7 @@ class XRCORE_API xrMemory
void mem_counter_set(u32 _val) { stat_counter = _val; }
u32 mem_counter_get() { return stat_counter; }
#ifdef DEBUG_MEMORY_NAME
- void mem_statistic(LPCSTR fn);
+ void mem_statistic(const char* fn);
void* mem_alloc(size_t size, const char* _name);
void* mem_realloc(void* p, size_t size, const char* _name);
#else // DEBUG_MEMORY_NAME
@@ -149,7 +149,7 @@ const u32 mem_pools_count = 54;
const u32 mem_pools_ebase = 16;
const u32 mem_generic = mem_pools_count + 1;
extern MEMPOOL mem_pools[mem_pools_count];
-extern BOOL mem_initialized;
+extern bool mem_initialized;
XRCORE_API void vminfo(size_t* _free, size_t* reserved, size_t* committed);
XRCORE_API void log_vminfo();
diff --git a/src/xrGameSpy/GameSpy_ATLAS.h b/src/xrGameSpy/GameSpy_ATLAS.h
index de3e98fae22..4e543e7ae33 100644
--- a/src/xrGameSpy/GameSpy_ATLAS.h
+++ b/src/xrGameSpy/GameSpy_ATLAS.h
@@ -1,7 +1,4 @@
-#ifndef GAMESPY_ATLAS_INCLUDED
-#define GAMESPY_ATLAS_INCLUDED
-
-#include "xrCore/xrCore.h"
+#pragma once
#include "xrGameSpy/xrGameSpy.h"
class XRGAMESPY_API CGameSpy_ATLAS
@@ -46,5 +43,3 @@ class XRGAMESPY_API CGameSpy_ATLAS
void Init();
}; // class CGameSpy_ATLAS
-
-#endif //#ifndef GAMESPY_ATLAS_INCLUDED
diff --git a/src/xrGameSpy/GameSpy_Available.h b/src/xrGameSpy/GameSpy_Available.h
index 17fce28bd6e..dc5497e6602 100644
--- a/src/xrGameSpy/GameSpy_Available.h
+++ b/src/xrGameSpy/GameSpy_Available.h
@@ -1,6 +1,4 @@
#pragma once
-
-#include "xrCore/xrCore.h"
#include "xrGameSpy/xrGameSpy.h"
class XRGAMESPY_API CGameSpy_Available
diff --git a/src/xrGameSpy/GameSpy_Browser.h b/src/xrGameSpy/GameSpy_Browser.h
index 8e7be01c99d..d12125cb8ef 100644
--- a/src/xrGameSpy/GameSpy_Browser.h
+++ b/src/xrGameSpy/GameSpy_Browser.h
@@ -1,6 +1,4 @@
#pragma once
-
-#include "xrCore/xrCore.h"
#include "xrGameSpy/xrGameSpy.h"
#include "xrCore/Threading/Lock.hpp"
diff --git a/src/xrGameSpy/GameSpy_Full.h b/src/xrGameSpy/GameSpy_Full.h
index 11b2282f9c2..3863e6e2b3d 100644
--- a/src/xrGameSpy/GameSpy_Full.h
+++ b/src/xrGameSpy/GameSpy_Full.h
@@ -1,6 +1,4 @@
#pragma once
-
-#include "xrCore/xrCore.h"
#include "xrGameSpy/xrGameSpy.h"
class CGameSpy_Available;
diff --git a/src/xrGameSpy/GameSpy_GCD_Client.cpp b/src/xrGameSpy/GameSpy_GCD_Client.cpp
index 45ab7e1bf43..5538549cfea 100644
--- a/src/xrGameSpy/GameSpy_GCD_Client.cpp
+++ b/src/xrGameSpy/GameSpy_GCD_Client.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+#include "stdafx.h"
#include "GameSpy_GCD_Client.h"
void CGameSpy_GCD_Client::CreateRespond(char* cdkey, char* RespondStr, char* ChallengeStr, u8 Reauth)
diff --git a/src/xrGameSpy/GameSpy_GCD_Client.h b/src/xrGameSpy/GameSpy_GCD_Client.h
index aa9da658a6f..5e88c2d08dd 100644
--- a/src/xrGameSpy/GameSpy_GCD_Client.h
+++ b/src/xrGameSpy/GameSpy_GCD_Client.h
@@ -1,6 +1,4 @@
#pragma once
-
-#include "xrCore/xrCore.h"
#include "xrGameSpy/xrGameSpy.h"
class XRGAMESPY_API CGameSpy_GCD_Client
diff --git a/src/xrGameSpy/GameSpy_GCD_Server.cpp b/src/xrGameSpy/GameSpy_GCD_Server.cpp
index 64e5bc8c7a5..9d18d42b931 100644
--- a/src/xrGameSpy/GameSpy_GCD_Server.cpp
+++ b/src/xrGameSpy/GameSpy_GCD_Server.cpp
@@ -1,30 +1,34 @@
-#include "StdAfx.h"
+#include "stdafx.h"
#include "GameSpy_GCD_Server.h"
bool CGameSpy_GCD_Server::Init()
{
- int res = gcd_init_qr2(NULL, GAMESPY_GAMEID);
+ int res = gcd_init_qr2(nullptr, GAMESPY_GAMEID);
if (res == -1)
{
Msg("! xrGS::CDKey : Failes to Initialize!");
return false;
- };
+ }
#ifndef MASTER_GOLD
Msg("- xrGS::CDKey : Initialized");
#endif // #ifndef MASTER_GOLD
return true;
-};
+}
+
+void CGameSpy_GCD_Server::ShutDown()
+{
+ gcd_shutdown();
+}
-void CGameSpy_GCD_Server::ShutDown() { gcd_shutdown(); }
void CGameSpy_GCD_Server::CreateRandomChallenge(char* challenge, int nchars)
{
if (nchars > GAMESPY_MAXCHALLANGESIZE)
nchars = GAMESPY_MAXCHALLANGESIZE;
+
challenge[nchars] = 0;
+
while (nchars--)
- {
- challenge[nchars] = char('a' + ::Random.randI(26));
- };
+ challenge[nchars] = char('a' + Random.randI(26));
}
class GSAuthContext
@@ -45,28 +49,39 @@ void __cdecl GSClientAuthCallback(int productid, int localid, int authenticated,
auto ctx = static_cast(instance);
if (ctx)
ctx->Auth(localid, authenticated, errmsg);
-};
+}
void __cdecl GSClientReauthCallback(int gameid, int localid, int hint, char* challenge, void* instance)
{
auto ctx = static_cast(instance);
if (ctx)
ctx->Reauth(localid, hint, challenge);
-};
+}
void CGameSpy_GCD_Server::AuthUser(int localid, u32 userip, char* challenge, char* response,
- ClientAuthCallback& authCallback, ClientReauthCallback& reauthCallback)
+ ClientAuthCallback& authCallback, ClientReauthCallback& reauthCallback)
{
GSAuthContext ctx(authCallback, reauthCallback);
gcd_authenticate_user(
GAMESPY_GAMEID, localid, userip, challenge, response, GSClientAuthCallback, GSClientReauthCallback, &ctx);
-};
+}
void CGameSpy_GCD_Server::ReAuthUser(int localid, int hint, char* response)
{
gcd_process_reauth(GAMESPY_GAMEID, localid, hint, response);
-};
+}
+
+void CGameSpy_GCD_Server::DisconnectUser(int localid)
+{
+ gcd_disconnect_user(GAMESPY_GAMEID, localid);
+}
+
+void CGameSpy_GCD_Server::Think()
+{
+ gcd_think();
+}
-void CGameSpy_GCD_Server::DisconnectUser(int localid) { gcd_disconnect_user(GAMESPY_GAMEID, localid); };
-void CGameSpy_GCD_Server::Think() { gcd_think(); };
-char* CGameSpy_GCD_Server::GetKeyHash(int localid) { return gcd_getkeyhash(GAMESPY_GAMEID, localid); };
+char* CGameSpy_GCD_Server::GetKeyHash(int localid)
+{
+ return gcd_getkeyhash(GAMESPY_GAMEID, localid);
+}
diff --git a/src/xrGameSpy/GameSpy_GCD_Server.h b/src/xrGameSpy/GameSpy_GCD_Server.h
index b7cb7eca4bd..0a5c876de00 100644
--- a/src/xrGameSpy/GameSpy_GCD_Server.h
+++ b/src/xrGameSpy/GameSpy_GCD_Server.h
@@ -1,6 +1,4 @@
#pragma once
-
-#include "xrCore/xrCore.h"
#include "xrGameSpy/xrGameSpy.h"
#define GAMESPY_MAXCHALLANGESIZE 32
diff --git a/src/xrGameSpy/GameSpy_GP.h b/src/xrGameSpy/GameSpy_GP.h
index 069e7c51e98..94f81216201 100644
--- a/src/xrGameSpy/GameSpy_GP.h
+++ b/src/xrGameSpy/GameSpy_GP.h
@@ -1,7 +1,4 @@
-#ifndef GAMESPY_GP_H
-#define GAMESPY_GP_H
-
-#include "xrCore/xrCore.h"
+#pragma once
#include "xrGameSpy/xrGameSpy.h"
class XRGAMESPY_API CGameSpy_GP
@@ -36,5 +33,3 @@ class XRGAMESPY_API CGameSpy_GP
// main callbacks
static void __cdecl OnGameSpyErrorCb(GPConnection* connection, void* arg, void* param);
}; // CGameSpy_GP
-
-#endif //#ifndef GAMESPY_GP_H
diff --git a/src/xrGameSpy/GameSpy_HTTP.cpp b/src/xrGameSpy/GameSpy_HTTP.cpp
index e94be3940a1..ab1378c1715 100644
--- a/src/xrGameSpy/GameSpy_HTTP.cpp
+++ b/src/xrGameSpy/GameSpy_HTTP.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+#include "stdafx.h"
#include "GameSpy_HTTP.h"
CGameSpy_HTTP::CGameSpy_HTTP()
diff --git a/src/xrGameSpy/GameSpy_HTTP.h b/src/xrGameSpy/GameSpy_HTTP.h
index 8a10f6af7b4..5de2829156e 100644
--- a/src/xrGameSpy/GameSpy_HTTP.h
+++ b/src/xrGameSpy/GameSpy_HTTP.h
@@ -1,6 +1,4 @@
#pragma once
-
-#include "xrCore/xrCore.h"
#include "xrGameSpy/xrGameSpy.h"
class XRGAMESPY_API CGameSpy_HTTP
diff --git a/src/xrGameSpy/GameSpy_Patching.cpp b/src/xrGameSpy/GameSpy_Patching.cpp
index 6028bf1f542..6a29811efee 100644
--- a/src/xrGameSpy/GameSpy_Patching.cpp
+++ b/src/xrGameSpy/GameSpy_Patching.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+#include "stdafx.h"
#include "GameSpy_Patching.h"
static char const* QueryPatchVersionString(char* dest, u32 dest_size)
diff --git a/src/xrGameSpy/GameSpy_Patching.h b/src/xrGameSpy/GameSpy_Patching.h
index 9158280c64c..d0a516414e8 100644
--- a/src/xrGameSpy/GameSpy_Patching.h
+++ b/src/xrGameSpy/GameSpy_Patching.h
@@ -1,6 +1,4 @@
#pragma once
-
-#include "xrCore/xrCore.h"
#include "xrGameSpy/xrGameSpy.h"
class XRGAMESPY_API CGameSpy_Patching
diff --git a/src/xrGameSpy/GameSpy_QR2.cpp b/src/xrGameSpy/GameSpy_QR2.cpp
index 748209a1702..d4de15f376b 100644
--- a/src/xrGameSpy/GameSpy_QR2.cpp
+++ b/src/xrGameSpy/GameSpy_QR2.cpp
@@ -1,4 +1,4 @@
-#include "StdAfx.h"
+#include "stdafx.h"
#include "GameSpy_QR2.h"
#include "GameSpy_Keys.h"
diff --git a/src/xrGameSpy/GameSpy_QR2.h b/src/xrGameSpy/GameSpy_QR2.h
index 7ae402d50b5..741ff0ec83f 100644
--- a/src/xrGameSpy/GameSpy_QR2.h
+++ b/src/xrGameSpy/GameSpy_QR2.h
@@ -1,6 +1,4 @@
#pragma once
-
-#include "xrCore/xrCore.h"
#include "xrGameSpy/xrGameSpy.h"
class xrGameSpyServer;
diff --git a/src/xrGameSpy/GameSpy_SAKE.h b/src/xrGameSpy/GameSpy_SAKE.h
index a3654bda401..f95ed3381bb 100644
--- a/src/xrGameSpy/GameSpy_SAKE.h
+++ b/src/xrGameSpy/GameSpy_SAKE.h
@@ -1,7 +1,4 @@
-#ifndef GAMESPY_SAKE
-#define GAMESPY_SAKE
-
-#include "xrCore/xrCore.h"
+#pragma once
#include "xrGameSpy/xrGameSpy.h"
namespace gamespy_sake
@@ -28,5 +25,3 @@ class XRGAMESPY_API CGameSpy_SAKE
void Init();
}; // class GameSpy_SAKE
-
-#endif //#ifndef GAMESPY_SAKE
diff --git a/src/xrGameSpy/stdafx.h b/src/xrGameSpy/stdafx.h
index 05cfc13e781..a1a1b2ba613 100644
--- a/src/xrGameSpy/stdafx.h
+++ b/src/xrGameSpy/stdafx.h
@@ -1,6 +1,7 @@
#pragma once
#include "Common/Platform.hpp"
+#include "xrCore/xrCore.h"
#include
#include
diff --git a/src/xrGameSpy/xrGameSpy.h b/src/xrGameSpy/xrGameSpy.h
index 3e5fb78502c..3104ce6dd4f 100644
--- a/src/xrGameSpy/xrGameSpy.h
+++ b/src/xrGameSpy/xrGameSpy.h
@@ -18,8 +18,6 @@
#include
#include
#include
-#undef min
-#undef max
#include "xrGameSpy/xrGameSpy_MainDefs.h"
#include "xrGameSpy/GameSpy_Available.h"
diff --git a/src/xrGameSpy/xrGameSpy.vcxproj b/src/xrGameSpy/xrGameSpy.vcxproj
index d026638f0ed..af50f2f437e 100644
--- a/src/xrGameSpy/xrGameSpy.vcxproj
+++ b/src/xrGameSpy/xrGameSpy.vcxproj
@@ -191,6 +191,9 @@
{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}
+
+ {7885cf3c-ee04-4c67-9467-1fbf9a36b037}
+
diff --git a/src/xrGameSpy/xrGameSpy_MainDefs.h b/src/xrGameSpy/xrGameSpy_MainDefs.h
index 94720fff594..e79d1a067fa 100644
--- a/src/xrGameSpy/xrGameSpy_MainDefs.h
+++ b/src/xrGameSpy/xrGameSpy_MainDefs.h
@@ -1,7 +1,5 @@
#pragma once
-#include "Common/Platform.hpp"
-
#define QRCDKEY_INTEGRATION
#define SB_ICMP_SUPPORT
diff --git a/src/xrParticles/xrParticles.vcxproj b/src/xrParticles/xrParticles.vcxproj
index 1fe8287b05d..c542ab3ba0f 100644
--- a/src/xrParticles/xrParticles.vcxproj
+++ b/src/xrParticles/xrParticles.vcxproj
@@ -209,6 +209,9 @@
{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}
false
+
+ {7885cf3c-ee04-4c67-9467-1fbf9a36b037}
+
diff --git a/src/xrPhysics/Physics.cpp b/src/xrPhysics/Physics.cpp
index 1ac2b30a743..9b55e478fd0 100644
--- a/src/xrPhysics/Physics.cpp
+++ b/src/xrPhysics/Physics.cpp
@@ -13,18 +13,10 @@
#pragma warning(push)
#pragma warning(disable : 4995)
#pragma warning(disable : 4267)
-<<<<<<< HEAD
-#include "Externals/ode/ode/src/collision_kernel.h"
-#include "Externals/ode/ode/src/joint.h"
-#include "Externals/ode/ode/src/objects.h"
-#pragma warning(pop)
-=======
#include "ode/ode/src/collision_kernel.h"
#include "ode/ode/src/joint.h"
#include "ode/ode/src/objects.h"
-#pragma warning(default : 4267)
-#pragma warning(default : 4995)
->>>>>>> 1ca44c6e... Move src/Externals to Externals.
+#pragma warning(pop)
extern CPHWorld* ph_world;
///////////////////////////////////////////////////////////////////
diff --git a/src/xrPhysics/SpaceUtils.h b/src/xrPhysics/SpaceUtils.h
index 2cc8a44752b..589d155068c 100644
--- a/src/xrPhysics/SpaceUtils.h
+++ b/src/xrPhysics/SpaceUtils.h
@@ -3,7 +3,7 @@
#pragma warning(push)
#pragma warning(disable : 4995)
#pragma warning(disable : 4267)
-#include "/ode/ode/src/collision_kernel.h"
+#include "ode/ode/src/collision_kernel.h"
#pragma warning(pop)
IC void spatialParsFromDGeom(dGeomID d_space, Fvector& center, Fvector& AABB, float& radius)
diff --git a/src/xrPhysics/xrPhysics.vcxproj b/src/xrPhysics/xrPhysics.vcxproj
index 22ed705d859..8f114c76ed0 100644
--- a/src/xrPhysics/xrPhysics.vcxproj
+++ b/src/xrPhysics/xrPhysics.vcxproj
@@ -335,6 +335,9 @@
{ccca7859-eb86-493e-9b53-c4235f45b3c5}
false
+
+ {7885cf3c-ee04-4c67-9467-1fbf9a36b037}
+
{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}
diff --git a/src/xrSound/xrSound.vcxproj b/src/xrSound/xrSound.vcxproj
index e3942643a20..4a2f7b25f18 100644
--- a/src/xrSound/xrSound.vcxproj
+++ b/src/xrSound/xrSound.vcxproj
@@ -227,6 +227,9 @@
{566551f4-4ef1-4cb4-a131-f982e7606907}
+
+ {7885cf3c-ee04-4c67-9467-1fbf9a36b037}
+
{c964d17a-05a8-4bfa-b0a8-7af5c6b627ec}