Removed ListInstance* singletons

This commit is contained in:
Elderme 2015-11-20 22:39:42 +01:00
parent db52543655
commit be1178871b
3 changed files with 0 additions and 74 deletions

View File

@ -63,7 +63,6 @@ void DrawCalls::clearLists()
m_immediate_draw_list.clear();
m_billboard_list.clear();
m_particles_list.clear();
ListInstancedGlow::getInstance()->clear();
}
@ -482,16 +481,6 @@ void DrawCalls::prepareDrawCalls( ShadowMatrices& shadow_matrices, scene::ICamer
{
enableOpenMP = 1;
}
ListInstancedMatDefault::getInstance()->clear();
ListInstancedMatAlphaRef::getInstance()->clear();
ListInstancedMatGrass::getInstance()->clear();
ListInstancedMatNormalMap::getInstance()->clear();
ListInstancedMatSphereMap::getInstance()->clear();
ListInstancedMatDetails::getInstance()->clear();
ListInstancedMatUnlit::getInstance()->clear();
size_t SolidPoly = 0, ShadowPoly = 0, MiscPoly = 0;

View File

@ -670,7 +670,6 @@ struct DefaultMaterial
typedef InstancedObjectPass2Shader InstancedSecondPassShader;
typedef InstancedShadowShader InstancedShadowPassShader;
typedef CInstancedRSMShader InstancedRSMShader;
typedef ListInstancedMatDefault InstancedList;
typedef Shaders::ObjectPass1Shader FirstPassShader;
typedef Shaders::ObjectPass2Shader SecondPassShader;
typedef ShadowShader ShadowPassShader;
@ -693,7 +692,6 @@ struct AlphaRef
typedef InstancedObjectRefPass2Shader InstancedSecondPassShader;
typedef InstancedRefShadowShader InstancedShadowPassShader;
typedef CInstancedRSMShader InstancedRSMShader;
typedef ListInstancedMatAlphaRef InstancedList;
typedef ObjectRefPass1Shader FirstPassShader;
typedef ObjectRefPass2Shader SecondPassShader;
typedef RefShadowShader ShadowPassShader;
@ -715,7 +713,6 @@ struct SphereMap
typedef InstancedSphereMapShader InstancedSecondPassShader;
typedef InstancedShadowShader InstancedShadowPassShader;
typedef CInstancedRSMShader InstancedRSMShader;
typedef ListInstancedMatSphereMap InstancedList;
typedef Shaders::ObjectPass1Shader FirstPassShader;
typedef SphereMapShader SecondPassShader;
typedef ShadowShader ShadowPassShader;
@ -738,7 +735,6 @@ struct UnlitMat
typedef InstancedObjectUnlitShader InstancedSecondPassShader;
typedef InstancedRefShadowShader InstancedShadowPassShader;
typedef CInstancedRSMShader InstancedRSMShader;
typedef ListInstancedMatUnlit InstancedList;
typedef ObjectRefPass1Shader FirstPassShader;
typedef ObjectUnlitShader SecondPassShader;
typedef RefShadowShader ShadowPassShader;
@ -761,7 +757,6 @@ struct GrassMat
typedef InstancedGrassPass2Shader InstancedSecondPassShader;
typedef InstancedGrassShadowShader InstancedShadowPassShader;
typedef CInstancedRSMShader InstancedRSMShader;
typedef ListInstancedMatGrass InstancedList;
typedef GrassPass1Shader FirstPassShader;
typedef GrassPass2Shader SecondPassShader;
typedef GrassShadowShader ShadowPassShader;
@ -784,7 +779,6 @@ struct NormalMat
typedef InstancedObjectPass2Shader InstancedSecondPassShader;
typedef InstancedShadowShader InstancedShadowPassShader;
typedef CInstancedRSMShader InstancedRSMShader;
typedef ListInstancedMatNormalMap InstancedList;
typedef NormalMapShader FirstPassShader;
typedef Shaders::ObjectPass2Shader SecondPassShader;
typedef ShadowShader ShadowPassShader;
@ -807,7 +801,6 @@ struct DetailMat
typedef InstancedDetailedObjectPass2Shader InstancedSecondPassShader;
typedef InstancedShadowShader InstancedShadowPassShader;
typedef CInstancedRSMShader InstancedRSMShader;
typedef ListInstancedMatDetails InstancedList;
typedef Shaders::ObjectPass1Shader FirstPassShader;
typedef DetailedObjectPass2Shader SecondPassShader;
typedef ShadowShader ShadowPassShader;

View File

@ -87,15 +87,6 @@ public:
virtual bool isImmediateDraw() const { return false; }
}; // STKMeshCommon
/*
// ----------------------------------------------------------------------------
//TODO: template function in order to avoid duplicate code (clear method)
template<typename T>
clearMeshList()
{
}
*/
// ----------------------------------------------------------------------------
template<typename T, typename... Args>
@ -112,67 +103,33 @@ public:
}
}; // MeshList
// ----------------------------------------------------------------------------
template<typename T>
class InstancedMeshList : public Singleton<T>
{
public:
std::vector<GLMesh *> SolidPass, Shadows[4], RSM;
void clear()
{
SolidPass.clear();
RSM.clear();
for (unsigned i = 0; i < 4; i++)
Shadows[i].clear();
}
}; // InstancedMeshList
// ----------------------------------------------------------------------------
class ListMatDefault : public MeshList<ListMatDefault, GLMesh *, core::matrix4,
core::matrix4, core::matrix4>
{};
// ----------------------------------------------------------------------------
class ListInstancedMatDefault : public InstancedMeshList<ListInstancedMatDefault>
{};
// ----------------------------------------------------------------------------
class ListMatAlphaRef : public MeshList<ListMatAlphaRef, GLMesh *, core::matrix4,
core::matrix4, core::matrix4>
{};
// ----------------------------------------------------------------------------
class ListInstancedMatAlphaRef : public InstancedMeshList<ListInstancedMatAlphaRef>
{};
// ----------------------------------------------------------------------------
class ListMatNormalMap : public MeshList<ListMatNormalMap, GLMesh *, core::matrix4,
core::matrix4, core::matrix4>
{};
// ----------------------------------------------------------------------------
class ListInstancedMatNormalMap : public InstancedMeshList<ListInstancedMatNormalMap>
{};
// ----------------------------------------------------------------------------
class ListMatGrass : public MeshList<ListMatGrass, GLMesh *, core::matrix4,
core::matrix4, core::vector3df>
{};
// ----------------------------------------------------------------------------
class ListInstancedMatGrass : public InstancedMeshList<ListInstancedMatGrass>
{};
// ----------------------------------------------------------------------------
class ListMatSphereMap : public MeshList<ListMatSphereMap, GLMesh *,
core::matrix4, core::matrix4,
core::matrix4>
{};
// ----------------------------------------------------------------------------
class ListInstancedMatSphereMap : public InstancedMeshList<ListInstancedMatSphereMap>
{};
// ----------------------------------------------------------------------------
class ListMatSplatting : public MeshList<ListMatSplatting, GLMesh *,
core::matrix4, core::matrix4>
@ -183,19 +140,11 @@ class ListMatUnlit : public MeshList<ListMatUnlit, GLMesh *, core::matrix4,
core::matrix4, core::matrix4>
{};
// ----------------------------------------------------------------------------
class ListInstancedMatUnlit : public InstancedMeshList<ListInstancedMatUnlit>
{};
// ----------------------------------------------------------------------------
class ListMatDetails : public MeshList<ListMatDetails, GLMesh *, core::matrix4,
core::matrix4, core::matrix4>
{};
// ----------------------------------------------------------------------------
class ListInstancedMatDetails : public InstancedMeshList<ListInstancedMatDetails>
{};
// ----------------------------------------------------------------------------
// Transparent
template <typename T, typename ...Args>
@ -234,11 +183,6 @@ class ListDisplacement : public MiscList<ListDisplacement, GLMesh *,
core::matrix4>
{};
// ----------------------------------------------------------------------------
class ListInstancedGlow : public Singleton<ListInstancedGlow>
, public std::vector<GLMesh *>
{};
// ----------------------------------------------------------------------------
Material::ShaderType getMeshMaterialFromType(video::E_MATERIAL_TYPE MaterialType,
video::E_VERTEX_TYPE tp,