Skip to content

Commit

Permalink
Compilation fixes
Browse files Browse the repository at this point in the history
Speedup xrGameSpy compilation.
  • Loading branch information
Xottab-DUTY committed Aug 5, 2017
1 parent 6ca6df8 commit 5975b4f
Show file tree
Hide file tree
Showing 54 changed files with 294 additions and 272 deletions.
3 changes: 3 additions & 0 deletions Externals/cximage/cximage.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@
<ProjectReference Include="$(SolutionDir)xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
<ProjectReference Include="..\jpeg\libjpeg.vcxproj">
<Project>{938c5808-85a1-4b5a-8cb4-d2d9d7851cb8}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
14 changes: 6 additions & 8 deletions Externals/cximage/ximacfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/////////////////////////////////////////////////////////////////////////////
Expand Down
3 changes: 0 additions & 3 deletions Externals/cximage/ximajpg.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#if CXIMAGE_SUPPORT_JPG

#define CXIMAGEJPG_SUPPORT_EXIF 1

#define XMD_H
#define HAVE_BOOLEAN
extern "C" {
Expand All @@ -37,8 +36,6 @@ extern "C" {
#undef HAVE_BOOLEAN
#undef XMD_H

#pragma comment(lib, "libjpeg.lib")

class DLL_EXP CxImageJPG: public CxImage
{
public:
Expand Down
5 changes: 3 additions & 2 deletions Externals/libvorbis_static.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<ProjectGuid>{3A214E06-B95E-4D61-A291-1F8DF2EC10FD}</ProjectGuid>
<RootNamespace>libvorbis</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
Expand All @@ -39,12 +40,12 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
5 changes: 3 additions & 2 deletions Externals/libvorbisfile_static.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<ProjectGuid>{CEBDE98B-A6AA-46E6-BC79-FAAF823DB9EC}</ProjectGuid>
<RootNamespace>libvorbisfile</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
Expand All @@ -38,12 +39,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
1 change: 1 addition & 0 deletions src/Common/Common.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
<ClInclude Include="PlatformLinux.inl" />
<ClInclude Include="PlatformWindows.inl" />
<ClInclude Include="Util.hpp" />
<ClInclude Include="xr_impexp_macros.h" />
<ClInclude Include="_d3d_extensions.h" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/Common/Common.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
<ClInclude Include="..\xrCommon\xr_deque.h">
<Filter>xrCommon</Filter>
</ClInclude>
<ClInclude Include="xr_impexp_macros.h">
<Filter>Platform</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="NvMender2003">
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion src/editors/ECore/Editor/EditObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions src/editors/ECore/Editor/ExportObjectOGF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
31 changes: 13 additions & 18 deletions src/editors/ECore/Editor/ExportObjectOGF.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#define ExportObjectOGFH

#include "utils/ETools/PropSlimTools.h"
#include "xrCore/_fbox.h"

//---------------------------------------------------------------------------
const int clpOGFMX = 48, clpOGFMY = 16, clpOGFMZ = 48;
//---------------------------------------------------------------------------
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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(); }
};

//----------------------------------------------------
Expand All @@ -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();
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/Max/Material/Stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "Max.h"

#include "xrCore/xrCore.h"
#pragma comment(lib, "xrCore.lib")

#undef _MIN
#undef _MAX
Expand Down Expand Up @@ -41,9 +40,9 @@ using std::string;
#define FLT_MIN flt_max

#include <io.h>
#include <sys\stat.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys\utime.h>
#include <sys/utime.h>

#include "istdplug.h"
#include "iparamb2.h"
Expand Down
3 changes: 0 additions & 3 deletions src/plugins/Maya/Maya_Export2008.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,6 @@
<None Include="Export\xraySkinMotionExportOptions.mel" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/xrMiscMath/matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ template <typename T>
void _matrix<T>::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<T>)
{
h = (T)-atan2(k.x, k.z);
p = (T)-atan2(-k.y, cy);
Expand Down
7 changes: 0 additions & 7 deletions src/utils/xrMiscMath/xrMiscMath.cpp
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -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; }

3 changes: 3 additions & 0 deletions src/xrCDB/xrCDB.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\utils\xrMiscMath\xrMiscMath.vcxproj">
<Project>{7885cf3c-ee04-4c67-9467-1fbf9a36b037}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
4 changes: 2 additions & 2 deletions src/xrCommon/xalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading

0 comments on commit 5975b4f

Please sign in to comment.