Skip to content

Commit

Permalink
Reduce and clean up compile-time dependencies. Fix lzo include path f…
Browse files Browse the repository at this point in the history
…or xrGame Release build.
  • Loading branch information
tamlin-mike authored and Xottab-DUTY committed Aug 5, 2017
1 parent 884b4db commit 6e27c40
Show file tree
Hide file tree
Showing 51 changed files with 3,422 additions and 1,266 deletions.
1,514 changes: 1,514 additions & 0 deletions res/gamedata/scripts/xr_logic.script

Large diffs are not rendered by default.

31 changes: 2 additions & 29 deletions src/Common/Compiler.inl
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,13 @@
#include <intrin.h> // for __debugbreak
#endif

#if defined(__GNUC__)
#define XR_EXPORT __attribute__((visibility("default")))
#define XR_IMPORT __attribute__((visibility("default")))
#elif defined(_MSC_VER)
#define XR_EXPORT __declspec(dllexport)
#define XR_IMPORT __declspec(dllimport)
#endif
#include "xr_impexp_macros.h"
#include "inlining_macros.h"

#if defined(__GNUC__)
#define XR_ASSUME(expr) if (expr){} else __builtin_unreachable()
#elif defined(_MSC_VER)
#define XR_ASSUME(expr) __assume(expr)
#endif

#if defined(__GNUC__)
#define NO_INLINE __attribute__((noinline))
#define FORCE_INLINE __attribute__((always_inline)) inline
#define ALIGN(a) __attribute__((aligned(a)))
#define DEBUG_BREAK asm("int $3")
#elif defined(_MSC_VER)
#define NO_INLINE __declspec(noinline)
#define FORCE_INLINE __forceinline
#define ALIGN(a) __declspec(align(a))
#define DEBUG_BREAK __debugbreak()
#define __thread __declspec(thread)
#endif

// XXX: remove
#define _inline inline
#define __inline inline

// XXX: remove IC/ICF/ICN
#define IC inline
#define ICF FORCE_INLINE
#define ICN NO_INLINE

#define UNUSED(...) (void)(__VA_ARGS__)
29 changes: 29 additions & 0 deletions src/Common/inlining_macros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#ifdef _MSC_VER
#pragma once
#endif
#ifndef INLINING_MACROS_H
#define INLINING_MACROS_H

#if defined(__GNUC__)
#define NO_INLINE __attribute__((noinline))
#define FORCE_INLINE __attribute__((always_inline)) inline
#define ALIGN(a) __attribute__((aligned(a)))
#define DEBUG_BREAK asm("int $3")
#elif defined(_MSC_VER)
#define NO_INLINE __declspec(noinline)
#define FORCE_INLINE __forceinline
#define ALIGN(a) __declspec(align(a))
#define DEBUG_BREAK __debugbreak()
#define __thread __declspec(thread)
#endif

// XXX: remove
#define _inline inline
#define __inline inline

// XXX: remove IC/ICF/ICN
#define IC inline
#define ICF FORCE_INLINE
#define ICN NO_INLINE

#endif
15 changes: 15 additions & 0 deletions src/Common/xr_impexp_macros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifdef _MSC_VER
#pragma once
#endif
#ifndef XR_IMPEXP_MACROS_H
#define XR_IMPEXP_MACROS_H

#if defined(__GNUC__)
#define XR_EXPORT __attribute__ ((visibility("default")))
#define XR_IMPORT __attribute__ ((visibility("default")))
#elif defined(_MSC_VER)
#define XR_EXPORT __declspec(dllexport)
#define XR_IMPORT __declspec(dllimport)
#endif

#endif
3 changes: 3 additions & 0 deletions src/Layers/xrRenderPC_R1/xrRender_R1.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,9 @@
<Project>{1daec516-e52c-4a3c-a4da-ae3553e6e0f8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
<ProjectReference Include="..\..\xrScriptEngine\xrScriptEngine.vcxproj">
<Project>{132c62de-de85-4978-9675-c78ed4da46f0}</Project>
<Private>true</Private>
Expand Down
3 changes: 3 additions & 0 deletions src/Layers/xrRenderPC_R2/xrRender_R2.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,9 @@
<Project>{1daec516-e52c-4a3c-a4da-ae3553e6e0f8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
<ProjectReference Include="..\..\xrScriptEngine\xrScriptEngine.vcxproj">
<Project>{132c62de-de85-4978-9675-c78ed4da46f0}</Project>
</ProjectReference>
Expand Down
3 changes: 3 additions & 0 deletions src/Layers/xrRenderPC_R3/xrRender_R3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@
<Project>{1daec516-e52c-4a3c-a4da-ae3553e6e0f8}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
<ProjectReference Include="..\..\xrScriptEngine\xrScriptEngine.vcxproj">
<Project>{132c62de-de85-4978-9675-c78ed4da46f0}</Project>
</ProjectReference>
Expand Down
3 changes: 3 additions & 0 deletions src/Layers/xrRenderPC_R4/xrRender_R4.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,9 @@
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
<ProjectReference Include="..\..\xrEngine\xrEngine.vcxproj">
<Project>{2578c6d8-660d-48ae-9322-7422f8664f06}</Project>
</ProjectReference>
Expand Down
38 changes: 38 additions & 0 deletions src/engine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "oalib", "Externals\OpenAutomate\oalib\oalib.vcxproj", "{61D4856F-FA82-4F02-BB88-909DDFB1FE74}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "Externals\cryptlib.vcxproj", "{C39F4B46-6E89-4074-902E-CA57073044D2}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xrMiscMath_lib", "utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj", "{CC912A26-E688-49F5-99F4-7A0F9AF4E438}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -913,6 +914,42 @@ Global
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release_Dedicated|Win32.Build.0 = Release|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|Win32.ActiveCfg = Release|Win32
{C39F4B46-6E89-4074-902E-CA57073044D2}.Release|Win32.Build.0 = Release|Win32
{614AA57F-58D7-45A8-A5FF-93F04B05FAC6}.Release|x64.ActiveCfg = Release|x64
{614AA57F-58D7-45A8-A5FF-93F04B05FAC6}.Release|x64.Build.0 = Release|x64
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|Mixed Platforms.ActiveCfg = Debug|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|Mixed Platforms.Build.0 = Debug|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|Win32.ActiveCfg = Debug|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|Win32.Build.0 = Debug|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|x64.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug_Dedicated|x64.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug|Win32.ActiveCfg = Debug|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug|Win32.Build.0 = Debug|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Debug|x64.ActiveCfg = Debug|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|Mixed Platforms.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|Mixed Platforms.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|Win32.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|Win32.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|x64.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed_Dedicated|x64.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|Mixed Platforms.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|Mixed Platforms.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|Win32.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|Win32.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|x64.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Mixed|x64.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|Mixed Platforms.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|Mixed Platforms.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|Win32.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|Win32.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|x64.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release_Dedicated|x64.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release|Mixed Platforms.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release|Win32.ActiveCfg = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release|Win32.Build.0 = Release|Win32
{CC912A26-E688-49F5-99F4-7A0F9AF4E438}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -976,6 +1013,7 @@ Global
{848E8AB3-9962-4C04-B813-5690399C8A3E} = {2BFC806B-CE92-4EA4-8FE8-5F2EA54BA348}
{61D4856F-FA82-4F02-BB88-909DDFB1FE74} = {2BFC806B-CE92-4EA4-8FE8-5F2EA54BA348}
{C39F4B46-6E89-4074-902E-CA57073044D2} = {2BFC806B-CE92-4EA4-8FE8-5F2EA54BA348}
{CC912A26-E688-49F5-99F4-7A0F9AF4E438} = {89F6A7EE-3BBE-45D3-A8A8-5D9366CD987B}
EndGlobalSection
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/Max/MAX_Export60.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@
<None Include="Export\Utility.def" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/Maya/Maya_Export2008.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@
<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="..\..\xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/Maya/Maya_Export2009.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@
<None Include="..\..\editors\ECore\WildMagic\WmlVector4.inl" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/lw/LW_Export80.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@
<ClInclude Include="Export\stdafx.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\utils\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
Expand Down
3 changes: 3 additions & 0 deletions src/utils/ETools/ETools.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
<ProjectReference Include="..\xrQSlim\xrQSlim.vcxproj">
<Project>{f1836ce2-59ef-4189-8b9c-d103a511cb27}</Project>
</ProjectReference>
Expand Down
3 changes: 3 additions & 0 deletions src/utils/xrAI/xrAI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@
<ProjectReference Include="..\..\xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
<ProjectReference Include="..\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
3 changes: 3 additions & 0 deletions src/utils/xrDXT/DXT.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@
<ProjectReference Include="$(SolutionDir)xrCore\xrCore.vcxproj">
<Project>{a0f7d1fb-59a7-4717-a7e4-96f37e91998e}</Project>
</ProjectReference>
<ProjectReference Include="..\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
5 changes: 3 additions & 2 deletions src/utils/xrLC/b_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ const u32 c_PM_FaceLimit = 128; // face-limit
const float c_PM_MetricLimit_static = 0.10f; // vertex-count-simplification-limit
const float c_PM_MetricLimit_mu = 0.05f; // vertex-count-simplification-limit

BOOL exact_normalize(Fvector3& a);
BOOL exact_normalize(float* a);
// XXX: The following two 'exact_normalize' are also declared in xrCore/_vector3d.h
bool exact_normalize(Fvector3& a);
bool exact_normalize(float* a);

struct SBuildOptions
{
Expand Down
5 changes: 5 additions & 0 deletions src/utils/xrLC/xrLC.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@
<ClCompile Include="xrSectors.cpp" />
<ClCompile Include="xrT_Junction.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/utils/xrLC_Light/xrLC_Light.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@
</ProjectReference>
<ProjectReference Include="..\..\Externals\zlib.vcxproj">
<Project>{745dec58-ebb3-47a9-a9b8-4c6627c01bf8}</Project>
<ProjectReference Include="..\xrMiscMath_lib\xrMiscMath_lib.vcxproj">
<Project>{cc912a26-e688-49f5-99f4-7a0f9af4e438}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
Loading

0 comments on commit 6e27c40

Please sign in to comment.