Skip to content

Commit da3e330

Browse files
tamlin-mikeXottab-DUTY
authored andcommitted
Compile-time refactoring.
A few Lock turned into Lock*, to reduce compile time dependencies (many remain). A bunch of new headers added to split dependencies up. A bunch of compiler warnings removed by commenting out unused function/method formal argument/parameters. xrCore/_stl_extensions.h almost taken out of the equation.
1 parent 5a3b1e4 commit da3e330

File tree

266 files changed

+2212
-1651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+2212
-1651
lines changed

Externals/openal/OpenAL-Windows/Router/Router.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
</Midl>
7777
<ClCompile>
7878
<Optimization>Disabled</Optimization>
79-
<AdditionalIncludeDirectories>$(xrExternals)\openal\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
79+
<AdditionalIncludeDirectories>$(xrExternals)openal\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
8080
<PreprocessorDefinitions>_USRDLL;ROUTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
8181
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
8282
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -118,7 +118,7 @@
118118
<OmitFramePointers>true</OmitFramePointers>
119119
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
120120
<WholeProgramOptimization>true</WholeProgramOptimization>
121-
<AdditionalIncludeDirectories>$(xrExternals)\openal\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
121+
<AdditionalIncludeDirectories>$(xrExternals)openal\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
122122
<PreprocessorDefinitions>_USRDLL;ROUTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
123123
<StringPooling>true</StringPooling>
124124
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -163,7 +163,7 @@
163163
<OmitFramePointers>true</OmitFramePointers>
164164
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
165165
<WholeProgramOptimization>true</WholeProgramOptimization>
166-
<AdditionalIncludeDirectories>$(xrExternals)\openal\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
166+
<AdditionalIncludeDirectories>$(xrExternals)openal\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
167167
<PreprocessorDefinitions>_USRDLL;ROUTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
168168
<StringPooling>true</StringPooling>
169169
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>

src/Common/Common.vcxproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@
106106
</Link>
107107
</ItemDefinitionGroup>
108108
<ItemGroup>
109+
<ClInclude Include="..\xrCommon\inlining_macros.h" />
110+
<ClInclude Include="..\xrCommon\math_funcs.h" />
111+
<ClInclude Include="..\xrCommon\math_funcs_inline.h" />
112+
<ClInclude Include="..\xrCommon\misc_math_types.h" />
113+
<ClInclude Include="..\xrCommon\predicates.h" />
114+
<ClInclude Include="..\xrCommon\xalloc.h" />
115+
<ClInclude Include="..\xrCommon\xr_deque.h" />
116+
<ClInclude Include="..\xrCommon\xr_list.h" />
117+
<ClInclude Include="..\xrCommon\xr_map.h" />
118+
<ClInclude Include="..\xrCommon\xr_set.h" />
119+
<ClInclude Include="..\xrCommon\xr_stack.h" />
120+
<ClInclude Include="..\xrCommon\xr_string.h" />
121+
<ClInclude Include="..\xrCommon\xr_vector.h" />
109122
<ClInclude Include="Compiler.inl" />
110123
<ClInclude Include="Config.hpp" />
111124
<ClInclude Include="face_smoth_flags.h" />

src/Common/Common.vcxproj.filters

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,45 @@
4242
<ClInclude Include="Compiler.inl">
4343
<Filter>Platform</Filter>
4444
</ClInclude>
45+
<ClInclude Include="..\xrCommon\inlining_macros.h">
46+
<Filter>xrCommon</Filter>
47+
</ClInclude>
48+
<ClInclude Include="..\xrCommon\math_funcs.h">
49+
<Filter>xrCommon</Filter>
50+
</ClInclude>
51+
<ClInclude Include="..\xrCommon\math_funcs_inline.h">
52+
<Filter>xrCommon</Filter>
53+
</ClInclude>
54+
<ClInclude Include="..\xrCommon\misc_math_types.h">
55+
<Filter>xrCommon</Filter>
56+
</ClInclude>
57+
<ClInclude Include="..\xrCommon\xalloc.h">
58+
<Filter>xrCommon</Filter>
59+
</ClInclude>
60+
<ClInclude Include="..\xrCommon\xr_map.h">
61+
<Filter>xrCommon</Filter>
62+
</ClInclude>
63+
<ClInclude Include="..\xrCommon\xr_set.h">
64+
<Filter>xrCommon</Filter>
65+
</ClInclude>
66+
<ClInclude Include="..\xrCommon\xr_stack.h">
67+
<Filter>xrCommon</Filter>
68+
</ClInclude>
69+
<ClInclude Include="..\xrCommon\xr_string.h">
70+
<Filter>xrCommon</Filter>
71+
</ClInclude>
72+
<ClInclude Include="..\xrCommon\xr_vector.h">
73+
<Filter>xrCommon</Filter>
74+
</ClInclude>
75+
<ClInclude Include="..\xrCommon\predicates.h">
76+
<Filter>xrCommon</Filter>
77+
</ClInclude>
78+
<ClInclude Include="..\xrCommon\xr_list.h">
79+
<Filter>xrCommon</Filter>
80+
</ClInclude>
81+
<ClInclude Include="..\xrCommon\xr_deque.h">
82+
<Filter>xrCommon</Filter>
83+
</ClInclude>
4584
</ItemGroup>
4685
<ItemGroup>
4786
<Filter Include="NvMender2003">
@@ -50,6 +89,9 @@
5089
<Filter Include="Platform">
5190
<UniqueIdentifier>{05b6dbf9-e387-495f-9d92-e2b8ecc350fa}</UniqueIdentifier>
5291
</Filter>
92+
<Filter Include="xrCommon">
93+
<UniqueIdentifier>{103b77e6-94b0-400a-a75f-3b0b45f13ee2}</UniqueIdentifier>
94+
</Filter>
5395
</ItemGroup>
5496
<ItemGroup>
5597
<ClCompile Include="NvMender2003\NVMeshMender.cpp">

src/Common/LevelStructure.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include "Common/GUID.hpp"
4+
#include "xrCore/_fbox.h"
45

56
enum fsL_Chunks
67
{

src/Common/_d3d_extensions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
#pragma once
12
#ifndef _D3D_EXT_internal
23
#define _D3D_EXT_internal
4+
#include "xrCore/FixedVector.h"
35

46
#ifndef NO_XR_LIGHT
57
struct Flight

src/Common/object_comparer.h

Lines changed: 74 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
////////////////////////////////////////////////////////////////////////////
88

99
#pragma once
10+
#include "xrCore/FixedVector.h"
1011

1112
template <typename P>
1213
struct CComparer
@@ -15,174 +16,174 @@ struct CComparer
1516
struct CHelper
1617
{
1718
template <bool a>
18-
IC static bool compare(const T& _1, const T& _2, const P& p)
19+
IC static bool compare(const T& a1, const T& a2, const P& p)
1920
{
20-
return (p(_1, _2));
21+
return p(a1, a2);
2122
}
2223

2324
template <>
24-
IC static bool compare<true>(const T& _1, const T& _2, const P& p)
25+
IC static bool compare<true>(const T& a1, const T& a2, const P& p)
2526
{
26-
return (CComparer::compare(*_1, *_2, p));
27+
return CComparer::compare(*a1, *a2, p);
2728
}
2829
};
2930

30-
IC static bool compare(LPCSTR _1, LPCSTR _2, const P& p) { return (p(_1, _2)); }
31-
IC static bool compare(LPSTR _1, LPSTR _2, const P& p) { return (p(_1, _2)); }
32-
IC static bool compare(const shared_str& _1, const shared_str& _2, const P& p) { return (p(_1, _2)); }
31+
IC static bool compare(LPCSTR s1, LPCSTR s2, const P& p) { return p(s1, s2); }
32+
IC static bool compare(LPSTR s1, LPSTR s2, const P& p) { return p(s1, s2); }
33+
IC static bool compare(const shared_str& s1, const shared_str& s2, const P& p) { return p(s1, s2); }
3334
template <typename T1, typename T2>
34-
IC static bool compare(const std::pair<T1, T2>& _1, const std::pair<T1, T2>& _2, const P& p)
35+
IC static bool compare(const std::pair<T1, T2>& p1, const std::pair<T1, T2>& p2, const P& p)
3536
{
36-
return (compare(_1.first, _2.first, p) && compare(_1.second, _2.second, p));
37+
return compare(p1.first, p2.first, p) && compare(p1.second, p2.second, p);
3738
}
3839

3940
template <typename T, int size>
40-
IC static bool compare(const svector<T, size>& _1, const svector<T, size>& _2, const P& p)
41+
IC static bool compare(const svector<T, size>& v1, const svector<T, size>& v2, const P& p)
4142
{
42-
if (_1.size() != _2.size())
43-
return (p());
43+
if (v1.size() != v2.size())
44+
return p();
4445

45-
svector<T, size>::const_iterator I = _1.begin(), J = _2.begin();
46-
svector<T, size>::const_iterator E = _1.end();
46+
svector<T, size>::const_iterator I = v1.begin(), J = v2.begin();
47+
svector<T, size>::const_iterator E = v1.end();
4748
for (; I != E; ++I, ++J)
4849
if (!compare(*I, *J, p))
49-
return (false);
50-
return (true);
50+
return false;
51+
return true;
5152
}
5253

5354
template <typename T1, typename T2>
54-
IC static bool compare(const std::queue<T1, T2>& __1, const std::queue<T1, T2>& __2, const P& p)
55+
IC static bool compare(const std::queue<T1, T2>& q1, const std::queue<T1, T2>& q2, const P& p)
5556
{
56-
std::queue<T1, T2> _1 = __1;
57-
std::queue<T1, T2> _2 = __2;
57+
std::queue<T1, T2> lq1 = q1;
58+
std::queue<T1, T2> lq2 = q2;
5859

59-
if (_1.size() != _2.size())
60-
return (p());
60+
if (lq1.size() != lq2.size())
61+
return p();
6162

62-
for (; !_1.empty(); _1.pop(), _2.pop())
63-
if (!compare(_1.front(), _2.front(), p))
64-
return (false);
65-
return (true);
63+
for (; !lq1.empty(); lq1.pop(), lq2.pop())
64+
if (!compare(lq1.front(), lq2.front(), p))
65+
return false;
66+
return true;
6667
}
6768

68-
template <template <typename _1, typename _2> class T1, typename T2, typename T3>
69-
IC static bool compare(const T1<T2, T3>& __1, const T1<T2, T3>& __2, const P& p, bool)
69+
template <template <typename T1X, typename T2X> class T1, typename T2, typename T3>
70+
IC static bool compare(const T1<T2, T3>& a1, const T1<T2, T3>& a2, const P& p, bool)
7071
{
71-
T1<T2, T3> _1 = __1;
72-
T1<T2, T3> _2 = __2;
72+
T1<T2, T3> la1 = a1;
73+
T1<T2, T3> la2 = a2;
7374

74-
if (_1.size() != _2.size())
75-
return (p());
75+
if (la1.size() != la2.size())
76+
return p();
7677

77-
for (; !_1.empty(); _1.pop(), _2.pop())
78-
if (!compare(_1.top(), _2.top(), p))
79-
return (false);
80-
return (true);
78+
for (; !la1.empty(); la1.pop(), la2.pop())
79+
if (!compare(la1.top(), la2.top(), p))
80+
return false;
81+
return true;
8182
}
8283

83-
template <template <typename _1, typename _2, typename _3> class T1, typename T2, typename T3, typename T4>
84-
IC static bool compare(const T1<T2, T3, T4>& __1, const T1<T2, T3, T4>& __2, const P& p, bool)
84+
template <template <typename T1X, typename T2X, typename T3X> class T1, typename T2, typename T3, typename T4>
85+
IC static bool compare(const T1<T2, T3, T4>& a1, const T1<T2, T3, T4>& a2, const P& p, bool)
8586
{
86-
T1<T2, T3, T4> _1 = __1;
87-
T1<T2, T3, T4> _2 = __2;
87+
T1<T2, T3, T4> la1 = a1;
88+
T1<T2, T3, T4> la2 = a2;
8889

89-
if (_1.size() != _2.size())
90-
return (p());
90+
if (la1.size() != la2.size())
91+
return p();
9192

92-
for (; !_1.empty(); _1.pop(), _2.pop())
93-
if (!compare(_1.top(), _2.top(), p))
94-
return (false);
95-
return (true);
93+
for (; !la1.empty(); la1.pop(), la2.pop())
94+
if (!compare(la1.top(), la2.top(), p))
95+
return false;
96+
return true;
9697
}
9798

9899
template <typename T1, typename T2>
99-
IC static bool compare(const xr_stack<T1, T2>& _1, const xr_stack<T1, T2>& _2, const P& p)
100+
IC static bool compare(const xr_stack<T1, T2>& s1, const xr_stack<T1, T2>& s2, const P& p)
100101
{
101-
return (compare(_1, _2, p, true));
102+
return compare(s1, s2, p, true);
102103
}
103104

104105
template <typename T1, typename T2, typename T3>
105106
IC static bool compare(
106-
const std::priority_queue<T1, T2, T3>& _1, const std::priority_queue<T1, T2, T3>& _2, const P& p)
107+
const std::priority_queue<T1, T2, T3>& q1, const std::priority_queue<T1, T2, T3>& q2, const P& p)
107108
{
108-
return (compare(_1, _2, p, true));
109+
return compare(q1, q2, p, true);
109110
}
110111

111112
struct CHelper3
112113
{
113114
template <typename T>
114-
IC static bool compare(const T& _1, const T& _2, const P& p)
115+
IC static bool compare(const T& a1, const T& a2, const P& p)
115116
{
116-
if (_1.size() != _2.size())
117-
return (p());
117+
if (a1.size() != a2.size())
118+
return p();
118119

119-
T::const_iterator I = _1.begin(), J = _2.begin();
120-
T::const_iterator E = _1.end();
120+
T::const_iterator I = a1.begin(), J = a2.begin();
121+
T::const_iterator E = a1.end();
121122
for (; I != E; ++I, ++J)
122123
if (!CComparer::compare(*I, *J, p))
123-
return (false);
124-
return (true);
124+
return false;
125+
return true;
125126
}
126127
};
127128

128129
template <typename T>
129130
struct CHelper4
130131
{
131132
template <bool a>
132-
IC static bool compare(const T& _1, const T& _2, const P& p)
133+
IC static bool compare(const T& a1, const T& a2, const P& p)
133134
{
134-
return (CHelper<T>::compare<object_type_traits::is_pointer<T>::value>(_1, _2, p));
135+
return CHelper<T>::compare<object_type_traits::is_pointer<T>::value>(a1, a2, p);
135136
}
136137

137138
template <>
138-
IC static bool compare<true>(const T& _1, const T& _2, const P& p)
139+
IC static bool compare<true>(const T& a1, const T& a2, const P& p)
139140
{
140-
return (CHelper3::compare(_1, _2, p));
141+
return CHelper3::compare(a1, a2, p);
141142
}
142143
};
143144

144145
template <typename T>
145-
IC static bool compare(const T& _1, const T& _2, const P& p)
146+
IC static bool compare(const T& a1, const T& a2, const P& p)
146147
{
147-
return (CHelper4<T>::compare<object_type_traits::is_stl_container<T>::value>(_1, _2, p));
148+
return CHelper4<T>::compare<object_type_traits::is_stl_container<T>::value>(a1, a2, p);
148149
}
149150
};
150151

151152
template <typename P>
152153
IC bool compare(LPCSTR p0, LPSTR p1, const P& p)
153154
{
154-
return (p(p0, p1));
155+
return p(p0, p1);
155156
}
156157

157158
template <typename P>
158159
IC bool compare(LPSTR p0, LPCSTR p1, const P& p)
159160
{
160-
return (p(p0, p1));
161+
return p(p0, p1);
161162
}
162163

163164
template <typename T, typename P>
164165
IC bool compare(const T& p0, const T& p1, const P& p)
165166
{
166-
return (CComparer<P>::compare(p0, p1, p));
167+
return CComparer<P>::compare(p0, p1, p);
167168
}
168169

169170
namespace object_comparer
170171
{
171172
namespace detail
172173
{
173-
template <template <typename _1> class P>
174+
template <template <typename TX> class P>
174175
struct comparer
175176
{
176177
template <typename T>
177-
IC bool operator()(const T& _1, const T& _2) const
178+
IC bool operator()(const T& a1, const T& a2) const
178179
{
179-
return (P<T>()(_1, _2));
180+
return P<T>()(a1, a2);
180181
}
181-
IC bool operator()() const { return (P<bool>()(false, true)); }
182-
IC bool operator()(LPCSTR _1, LPCSTR _2) const { return (P<int>()(xr_strcmp(_1, _2), 0)); }
183-
IC bool operator()(LPSTR _1, LPSTR _2) const { return (P<int>()(xr_strcmp(_1, _2), 0)); }
184-
IC bool operator()(LPCSTR _1, LPSTR _2) const { return (P<int>()(xr_strcmp(_1, _2), 0)); }
185-
IC bool operator()(LPSTR _1, LPCSTR _2) const { return (P<int>()(xr_strcmp(_1, _2), 0)); }
182+
IC bool operator()() const { return P<bool>()(false, true); }
183+
IC bool operator()(LPCSTR s1, LPCSTR s2) const { return (P<int>()(xr_strcmp(s1, s2), 0)); }
184+
IC bool operator()(LPSTR s1, LPSTR s2) const { return (P<int>()(xr_strcmp(s1, s2), 0)); }
185+
IC bool operator()(LPCSTR s1, LPSTR s2) const { return (P<int>()(xr_strcmp(s1, s2), 0)); }
186+
IC bool operator()(LPSTR s1, LPCSTR s2) const { return (P<int>()(xr_strcmp(s1, s2), 0)); }
186187
};
187188
};
188189
};

0 commit comments

Comments
 (0)