Skip to content

Commit

Permalink
xrRender: fix some linux compilation error (templates and typenames)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg authored and q4a committed Sep 29, 2018
1 parent bd553a0 commit 2a49ff9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
16 changes: 8 additions & 8 deletions src/Layers/xrRender/ShaderResourceTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct ShaderTypeTraits;
template <>
struct ShaderTypeTraits<SVS>
{
typedef CResourceManager::map_VS MapType;
using MapType = CResourceManager::map_VS;

#ifdef USE_OGL
using HWShaderType = GLuint;
Expand Down Expand Up @@ -65,7 +65,7 @@ struct ShaderTypeTraits<SVS>
template <>
struct ShaderTypeTraits<SPS>
{
typedef CResourceManager::map_PS MapType;
using MapType = CResourceManager::map_PS;

#ifdef USE_OGL
using HWShaderType = GLuint;
Expand Down Expand Up @@ -132,7 +132,7 @@ struct ShaderTypeTraits<SPS>
template <>
struct ShaderTypeTraits<SGS>
{
typedef CResourceManager::map_GS MapType;
using MapType = CResourceManager::map_GS;

#ifdef USE_OGL
using HWShaderType = GLuint;
Expand Down Expand Up @@ -191,7 +191,7 @@ struct ShaderTypeTraits<SGS>
template <>
struct ShaderTypeTraits<SHS>
{
typedef CResourceManager::map_HS MapType;
using MapType = CResourceManager::map_HS;

#ifdef USE_OGL
using HWShaderType = GLuint;
Expand Down Expand Up @@ -227,7 +227,7 @@ struct ShaderTypeTraits<SHS>
template <>
struct ShaderTypeTraits<SDS>
{
typedef CResourceManager::map_DS MapType;
using MapType = CResourceManager::map_DS;

#ifdef USE_OGL
using HWShaderType = GLuint;
Expand Down Expand Up @@ -263,7 +263,7 @@ struct ShaderTypeTraits<SDS>
template <>
struct ShaderTypeTraits<SCS>
{
typedef CResourceManager::map_CS MapType;
using MapType = CResourceManager::map_CS;

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

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

ShaderTypeTraits<T>::MapType& sh_map = GetShaderMap<ShaderTypeTraits<T>::MapType>();
typename ShaderTypeTraits<T>::MapType& sh_map = GetShaderMap<typename ShaderTypeTraits<T>::MapType>();

LPSTR N = LPSTR(*sh->cName);
auto iterator = sh_map.find(N);
Expand Down
6 changes: 3 additions & 3 deletions src/Layers/xrRender/SkeletonCustom.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "FHierrarhyVisual.h"
#include "xrCore/Animation/Bone.hpp"
#include "Include/xrRender/Kinematics.h"
#include "SkeletonX.h"

// consts
extern Lock UCalc_Mutex;
Expand All @@ -15,6 +14,7 @@ class CKinematics;
class CInifile;
class CBoneData;
struct SEnumVerticesCallback;
class CSkeletonX;

// MT-locker
struct UCalc_mtlock
Expand Down Expand Up @@ -107,7 +107,7 @@ class CKinematics : public FHierrarhyVisual, public IKinematics
friend class CSkeletonX;

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

public:
Expand Down Expand Up @@ -159,7 +159,7 @@ class CKinematics : public FHierrarhyVisual, public IKinematics
virtual CBoneData* CreateBoneData(u16 ID) { return new CBoneData(ID); }
virtual void IBoneInstances_Create();
virtual void IBoneInstances_Destroy();
void Visibility_Invalidate() { Update_Visibility = TRUE; };
void Visibility_Invalidate() { Update_Visibility = TRUE; }
void Visibility_Update();

void LL_Validate();
Expand Down
2 changes: 2 additions & 0 deletions src/Layers/xrRender/SkeletonX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
#include "stdafx.h"
#pragma hdrstop

#if defined(WINDOWS)
#pragma warning(push)
#pragma warning(disable : 4995)
#include <d3dx9.h>
#pragma warning(pop)
#endif

#ifndef _EDITOR
#include "xrEngine/Render.h"
Expand Down
3 changes: 2 additions & 1 deletion src/Layers/xrRender/SkeletonX.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "SkeletonCustom.h"
#include "SkeletonXVertRender.h"
#include "xrCDB/Intersect.hpp"

// refs
class CKinematics;
Expand Down Expand Up @@ -164,7 +165,7 @@ BOOL pick_bone(CKinematics* Parent, IKinematics::pick_result& r, float dist, con
VERIFY(!"Not implemented");
return FALSE;
}
#else USE_DX10
#elif USE_DX10
template <typename T>
BOOL pick_bone(CKinematics* Parent, IKinematics::pick_result& r, float dist, const Fvector& S, const Fvector& D,
Fvisual* V, u16* indices, CBoneData::FacesVec& faces)
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/r__dsgraph_render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ template <class T> IC bool cmp_first_h(const T &lhs, const T &rhs) { return (lhs
template<class T>
IC void sort_front_to_back_render_and_clean(T &vec)
{
std::sort(vec.begin(), vec.end(), cmp_first_l<T::value_type>); // front-to-back
std::sort(vec.begin(), vec.end(), cmp_first_l<typename T::value_type>); // front-to-back
for (auto &i : vec)
render_item(i);
vec.clear();
Expand All @@ -421,7 +421,7 @@ IC void sort_front_to_back_render_and_clean(T &vec)
template<class T>
IC void sort_back_to_front_render_and_clean(T &vec)
{
std::sort(vec.begin(), vec.end(), cmp_first_h<T::value_type>); // back-to-front
std::sort(vec.begin(), vec.end(), cmp_first_h<typename T::value_type>); // back-to-front
for (auto &i : vec)
render_item(i);
vec.clear();
Expand Down

0 comments on commit 2a49ff9

Please sign in to comment.