@@ -7,44 +7,45 @@ template <class T>
77class doug_lea_alloc
88{
99public:
10- typedef size_t size_type;
11- typedef ptrdiff_t difference_type;
12- typedef T* pointer ;
13- typedef const T* const_pointer ;
14- typedef T& reference ;
15- typedef const T& const_reference ;
16- typedef T value_type;
10+ using size_type = size_t ;
11+ using difference_type = ptrdiff_t ;
12+ using pointer = T* ;
13+ using const_pointer = const T*;
14+ using reference = T& ;
15+ using const_reference = const T&;
16+ using value_type = T ;
1717
18- public:
1918 template <class _Other >
2019 struct rebind
2120 {
22- typedef doug_lea_alloc<_Other> other ;
21+ using other = doug_lea_alloc<_Other>;
2322 };
2423
25- public:
2624 pointer address (reference _Val) const { return (&_Val); }
2725 const_pointer address (const_reference _Val) const { return (&_Val); }
2826 doug_lea_alloc () {}
2927 doug_lea_alloc (const doug_lea_alloc<T>&) {}
28+
3029 template <class _Other >
31- doug_lea_alloc (const doug_lea_alloc<_Other>&)
32- {
33- }
30+ doug_lea_alloc (const doug_lea_alloc<_Other>&) {}
31+
3432 template <class _Other >
3533 doug_lea_alloc<T>& operator =(const doug_lea_alloc<_Other>&)
3634 {
3735 return (*this );
3836 }
37+
3938 pointer allocate (size_type n, const void * /* p*/ = nullptr ) const
4039 {
4140 return (T*)g_render_allocator.malloc_impl (sizeof (T) * (u32 )n);
4241 }
42+
4343 void deallocate (pointer p, size_type) const { g_render_allocator.free_impl ((void *&)p); }
4444 void deallocate (void * p, size_type n) const { g_render_allocator.free_impl (p); }
4545 char * __charalloc (size_type n) { return (char *)allocate (n); }
4646 void construct (pointer p, const T& _Val) { new (p) T (_Val); }
4747 void destroy (pointer p) { p->~T (); }
48+
4849 size_type max_size () const
4950 {
5051 size_type _Count = (size_type)(-1 ) / sizeof (T);
@@ -57,6 +58,7 @@ bool operator==(const doug_lea_alloc<_Ty>&, const doug_lea_alloc<_Other>&)
5758{
5859 return (true );
5960}
61+
6062template <class _Ty , class _Other >
6163bool operator !=(const doug_lea_alloc<_Ty>&, const doug_lea_alloc<_Other>&)
6264{
@@ -68,10 +70,11 @@ struct doug_lea_allocator_wrapper
6870 template <typename T>
6971 struct helper
7072 {
71- typedef doug_lea_alloc<T> result ;
73+ using result = doug_lea_alloc<T>;
7274 };
7375
7476 static void * alloc (const u32 & n) { return g_render_allocator.malloc_impl ((u32 )n); }
77+
7578 template <typename T>
7679 static void dealloc (T*& p)
7780 {
@@ -80,7 +83,7 @@ struct doug_lea_allocator_wrapper
8083};
8184
8285#define render_alloc doug_lea_alloc
83- typedef doug_lea_allocator_wrapper render_allocator;
86+ using render_allocator = doug_lea_allocator_wrapper ;
8487
8588class dxRender_Visual ;
8689
@@ -115,54 +118,61 @@ struct _LodItem
115118};
116119
117120#ifdef USE_RESOURCE_DEBUGGER
118- typedef ref_vs vs_type;
119- typedef ref_ps ps_type;
121+ using vs_type = ref_vs ;
122+ using ps_type = ref_ps ;
120123#if defined(USE_DX10) || defined(USE_DX11)
121- typedef ref_gs gs_type;
124+ using gs_type = ref_gs ;
122125#ifdef USE_DX11
123- typedef ref_hs hs_type;
124- typedef ref_ds ds_type;
126+ using hs_type = ref_hs ;
127+ using ds_type = ref_ds ;
125128#endif
126129#endif // USE_DX10
127130#else
128- #if defined(USE_DX10) || defined(USE_DX11) // DX10 needs shader signature to propperly bind deometry to shader
129- typedef SVS* vs_type;
130- typedef ID3DGeometryShader* gs_type;
131+
132+ #if defined(USE_DX10) || defined(USE_DX11) // DX10 needs shader signature to properly bind geometry to shader
133+ using vs_type = SVS*;
134+ using gs_type = ID3DGeometryShader*;
131135#ifdef USE_DX11
132- typedef ID3D11HullShader* hs_type ;
133- typedef ID3D11DomainShader* ds_type ;
136+ using hs_type = ID3D11HullShader*;
137+ using ds_type = ID3D11DomainShader*;
134138#endif
135139#else // USE_DX10
136- typedef ID3DVertexShader* vs_type ;
140+ using vs_type = ID3DVertexShader* ;
137141#endif // USE_DX10
138- typedef ID3DPixelShader* ps_type ;
142+ using ps_type = ID3DPixelShader* ;
139143#endif
140144
141145// NORMAL
142- typedef xr_vector<_NormalItem, render_allocator::helper<_NormalItem>::result> mapNormalDirect;
146+ using mapNormalDirect = xr_vector<_NormalItem, render_allocator::helper<_NormalItem>::result>;
147+
143148struct mapNormalItems : public mapNormalDirect
144149{
145150 float ssa;
146151};
152+
147153struct mapNormalTextures : public FixedMAP <STextureList*, mapNormalItems, render_allocator>
148154{
149155 float ssa;
150156};
157+
151158struct mapNormalStates : public FixedMAP <ID3DState*, mapNormalTextures, render_allocator>
152159{
153160 float ssa;
154161};
162+
155163struct mapNormalCS : public FixedMAP <R_constant_table*, mapNormalStates, render_allocator>
156164{
157165 float ssa;
158166};
167+
159168#ifdef USE_DX11
160169struct mapNormalAdvStages
161170{
162171 hs_type hs;
163172 ds_type ds;
164173 mapNormalCS mapCS;
165174};
175+
166176struct mapNormalPS : public FixedMAP <ps_type, mapNormalAdvStages, render_allocator>
167177{
168178 float ssa;
@@ -173,47 +183,52 @@ struct mapNormalPS : public FixedMAP<ps_type, mapNormalCS, render_allocator>
173183 float ssa;
174184};
175185#endif // USE_DX11
186+
176187#if defined(USE_DX10) || defined(USE_DX11)
177188struct mapNormalGS : public FixedMAP <gs_type, mapNormalPS, render_allocator>
178189{
179190 float ssa;
180191};
181- struct mapNormalVS : public FixedMAP <vs_type, mapNormalGS, render_allocator>
182- {
183- };
192+
193+ struct mapNormalVS : public FixedMAP <vs_type, mapNormalGS, render_allocator> {};
184194#else // USE_DX10
185- struct mapNormalVS : public FixedMAP <vs_type, mapNormalPS, render_allocator>
186- {
187- };
195+ struct mapNormalVS : public FixedMAP <vs_type, mapNormalPS, render_allocator> {};
188196#endif // USE_DX10
189- typedef mapNormalVS mapNormal_T;
190- typedef mapNormal_T mapNormalPasses_T[SHADER_PASSES_MAX];
197+
198+ using mapNormal_T = mapNormalVS;
199+ using mapNormalPasses_T = mapNormal_T[SHADER_PASSES_MAX];
191200
192201// MATRIX
193- typedef xr_vector<_MatrixItem, render_allocator::helper<_MatrixItem>::result> mapMatrixDirect;
202+ using mapMatrixDirect = xr_vector<_MatrixItem, render_allocator::helper<_MatrixItem>::result>;
203+
194204struct mapMatrixItems : public mapMatrixDirect
195205{
196206 float ssa;
197207};
208+
198209struct mapMatrixTextures : public FixedMAP <STextureList*, mapMatrixItems, render_allocator>
199210{
200211 float ssa;
201212};
213+
202214struct mapMatrixStates : public FixedMAP <ID3DState*, mapMatrixTextures, render_allocator>
203215{
204216 float ssa;
205217};
218+
206219struct mapMatrixCS : public FixedMAP <R_constant_table*, mapMatrixStates, render_allocator>
207220{
208221 float ssa;
209222};
223+
210224#ifdef USE_DX11
211225struct mapMatrixAdvStages
212226{
213227 hs_type hs;
214228 ds_type ds;
215229 mapMatrixCS mapCS;
216230};
231+
217232struct mapMatrixPS : public FixedMAP <ps_type, mapMatrixAdvStages, render_allocator>
218233{
219234 float ssa;
@@ -224,29 +239,28 @@ struct mapMatrixPS : public FixedMAP<ps_type, mapMatrixCS, render_allocator>
224239 float ssa;
225240};
226241#endif // USE_DX11
242+
227243#if defined(USE_DX10) || defined(USE_DX11)
228244struct mapMatrixGS : public FixedMAP <gs_type, mapMatrixPS, render_allocator>
229245{
230246 float ssa;
231247};
232- struct mapMatrixVS : public FixedMAP <vs_type, mapMatrixGS, render_allocator>
233- {
234- };
248+
249+ struct mapMatrixVS : public FixedMAP <vs_type, mapMatrixGS, render_allocator> {};
235250#else // USE_DX10
236- struct mapMatrixVS : public FixedMAP <vs_type, mapMatrixPS, render_allocator>
237- {
238- };
251+ struct mapMatrixVS : public FixedMAP <vs_type, mapMatrixPS, render_allocator> {};
239252#endif // USE_DX10
240- typedef mapMatrixVS mapMatrix_T;
241- typedef mapMatrix_T mapMatrixPasses_T[SHADER_PASSES_MAX];
253+
254+ using mapMatrix_T = mapMatrixVS;
255+ using mapMatrixPasses_T = mapMatrix_T[SHADER_PASSES_MAX];
242256
243257// Top level
244- typedef FixedMAP<float , _MatrixItemS, render_allocator> mapSorted_T ;
245- typedef mapSorted_T::TNode mapSorted_Node ;
258+ using mapSorted_T = FixedMAP<float , _MatrixItemS, render_allocator>;
259+ using mapSorted_Node = mapSorted_T::TNode;
246260
247- typedef FixedMAP<float , _MatrixItemS, render_allocator> mapHUD_T ;
248- typedef mapHUD_T::TNode mapHUD_Node ;
261+ using mapHUD_T = FixedMAP<float , _MatrixItemS, render_allocator>;
262+ using mapHUD_Node = mapHUD_T::TNode;
249263
250- typedef FixedMAP<float , _LodItem, render_allocator> mapLOD_T ;
251- typedef mapLOD_T::TNode mapLOD_Node ;
252- };
264+ using mapLOD_T = FixedMAP<float , _LodItem, render_allocator>;
265+ using mapLOD_Node = mapLOD_T::TNode;
266+ }
0 commit comments