Skip to content

Commit 2a49ff9

Browse files
eagleivgq4a
authored andcommitted
xrRender: fix some linux compilation error (templates and typenames)
1 parent bd553a0 commit 2a49ff9

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

src/Layers/xrRender/ShaderResourceTraits.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct ShaderTypeTraits;
88
template <>
99
struct ShaderTypeTraits<SVS>
1010
{
11-
typedef CResourceManager::map_VS MapType;
11+
using MapType = CResourceManager::map_VS;
1212

1313
#ifdef USE_OGL
1414
using HWShaderType = GLuint;
@@ -65,7 +65,7 @@ struct ShaderTypeTraits<SVS>
6565
template <>
6666
struct ShaderTypeTraits<SPS>
6767
{
68-
typedef CResourceManager::map_PS MapType;
68+
using MapType = CResourceManager::map_PS;
6969

7070
#ifdef USE_OGL
7171
using HWShaderType = GLuint;
@@ -132,7 +132,7 @@ struct ShaderTypeTraits<SPS>
132132
template <>
133133
struct ShaderTypeTraits<SGS>
134134
{
135-
typedef CResourceManager::map_GS MapType;
135+
using MapType = CResourceManager::map_GS;
136136

137137
#ifdef USE_OGL
138138
using HWShaderType = GLuint;
@@ -191,7 +191,7 @@ struct ShaderTypeTraits<SGS>
191191
template <>
192192
struct ShaderTypeTraits<SHS>
193193
{
194-
typedef CResourceManager::map_HS MapType;
194+
using MapType = CResourceManager::map_HS;
195195

196196
#ifdef USE_OGL
197197
using HWShaderType = GLuint;
@@ -227,7 +227,7 @@ struct ShaderTypeTraits<SHS>
227227
template <>
228228
struct ShaderTypeTraits<SDS>
229229
{
230-
typedef CResourceManager::map_DS MapType;
230+
using MapType = CResourceManager::map_DS;
231231

232232
#ifdef USE_OGL
233233
using HWShaderType = GLuint;
@@ -263,7 +263,7 @@ struct ShaderTypeTraits<SDS>
263263
template <>
264264
struct ShaderTypeTraits<SCS>
265265
{
266-
typedef CResourceManager::map_CS MapType;
266+
using MapType = CResourceManager::map_CS;
267267

268268
#ifdef USE_OGL
269269
using HWShaderType = GLuint;
@@ -340,7 +340,7 @@ inline CResourceManager::map_CS& CResourceManager::GetShaderMap()
340340
template <typename T>
341341
inline T* CResourceManager::CreateShader(const char* name, const char* filename /*= nullptr*/, const bool searchForEntryAndTarget /*= false*/)
342342
{
343-
ShaderTypeTraits<T>::MapType& sh_map = GetShaderMap<ShaderTypeTraits<T>::MapType>();
343+
typename ShaderTypeTraits<T>::MapType& sh_map = GetShaderMap<typename ShaderTypeTraits<T>::MapType>();
344344
LPSTR N = LPSTR(name);
345345
auto iterator = sh_map.find(N);
346346

@@ -437,7 +437,7 @@ inline void CResourceManager::DestroyShader(const T* sh)
437437
if (0 == (sh->dwFlags & xr_resource_flagged::RF_REGISTERED))
438438
return;
439439

440-
ShaderTypeTraits<T>::MapType& sh_map = GetShaderMap<ShaderTypeTraits<T>::MapType>();
440+
typename ShaderTypeTraits<T>::MapType& sh_map = GetShaderMap<typename ShaderTypeTraits<T>::MapType>();
441441

442442
LPSTR N = LPSTR(*sh->cName);
443443
auto iterator = sh_map.find(N);

src/Layers/xrRender/SkeletonCustom.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "FHierrarhyVisual.h"
66
#include "xrCore/Animation/Bone.hpp"
77
#include "Include/xrRender/Kinematics.h"
8-
#include "SkeletonX.h"
98

109
// consts
1110
extern Lock UCalc_Mutex;
@@ -15,6 +14,7 @@ class CKinematics;
1514
class CInifile;
1615
class CBoneData;
1716
struct SEnumVerticesCallback;
17+
class CSkeletonX;
1818

1919
// MT-locker
2020
struct UCalc_mtlock
@@ -107,7 +107,7 @@ class CKinematics : public FHierrarhyVisual, public IKinematics
107107
friend class CSkeletonX;
108108

109109
protected: //--#SM+#--
110-
DEFINE_VECTOR(KinematicsABT::additional_bone_transform, BONE_TRANSFORM_VECTOR, BONE_TRANSFORM_VECTOR_IT);
110+
DEFINE_VECTOR(KinematicsABT::additional_bone_transform, BONE_TRANSFORM_VECTOR, BONE_TRANSFORM_VECTOR_IT)
111111
BONE_TRANSFORM_VECTOR m_bones_offsets;
112112

113113
public:
@@ -159,7 +159,7 @@ class CKinematics : public FHierrarhyVisual, public IKinematics
159159
virtual CBoneData* CreateBoneData(u16 ID) { return new CBoneData(ID); }
160160
virtual void IBoneInstances_Create();
161161
virtual void IBoneInstances_Destroy();
162-
void Visibility_Invalidate() { Update_Visibility = TRUE; };
162+
void Visibility_Invalidate() { Update_Visibility = TRUE; }
163163
void Visibility_Update();
164164

165165
void LL_Validate();

src/Layers/xrRender/SkeletonX.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
#include "stdafx.h"
66
#pragma hdrstop
77

8+
#if defined(WINDOWS)
89
#pragma warning(push)
910
#pragma warning(disable : 4995)
1011
#include <d3dx9.h>
1112
#pragma warning(pop)
13+
#endif
1214

1315
#ifndef _EDITOR
1416
#include "xrEngine/Render.h"

src/Layers/xrRender/SkeletonX.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "SkeletonCustom.h"
1010
#include "SkeletonXVertRender.h"
11+
#include "xrCDB/Intersect.hpp"
1112

1213
// refs
1314
class CKinematics;
@@ -164,7 +165,7 @@ BOOL pick_bone(CKinematics* Parent, IKinematics::pick_result& r, float dist, con
164165
VERIFY(!"Not implemented");
165166
return FALSE;
166167
}
167-
#else USE_DX10
168+
#elif USE_DX10
168169
template <typename T>
169170
BOOL pick_bone(CKinematics* Parent, IKinematics::pick_result& r, float dist, const Fvector& S, const Fvector& D,
170171
Fvisual* V, u16* indices, CBoneData::FacesVec& faces)

src/Layers/xrRender/r__dsgraph_render.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ template <class T> IC bool cmp_first_h(const T &lhs, const T &rhs) { return (lhs
412412
template<class T>
413413
IC void sort_front_to_back_render_and_clean(T &vec)
414414
{
415-
std::sort(vec.begin(), vec.end(), cmp_first_l<T::value_type>); // front-to-back
415+
std::sort(vec.begin(), vec.end(), cmp_first_l<typename T::value_type>); // front-to-back
416416
for (auto &i : vec)
417417
render_item(i);
418418
vec.clear();
@@ -421,7 +421,7 @@ IC void sort_front_to_back_render_and_clean(T &vec)
421421
template<class T>
422422
IC void sort_back_to_front_render_and_clean(T &vec)
423423
{
424-
std::sort(vec.begin(), vec.end(), cmp_first_h<T::value_type>); // back-to-front
424+
std::sort(vec.begin(), vec.end(), cmp_first_h<typename T::value_type>); // back-to-front
425425
for (auto &i : vec)
426426
render_item(i);
427427
vec.clear();

0 commit comments

Comments
 (0)