From be1178871b264a82b59b9ada7fda10a1e20cafd3 Mon Sep 17 00:00:00 2001 From: Elderme Date: Fri, 20 Nov 2015 22:39:42 +0100 Subject: [PATCH] Removed ListInstance* singletons --- src/graphics/draw_calls.cpp | 11 -------- src/graphics/materials.hpp | 7 ----- src/graphics/stk_mesh.hpp | 56 ------------------------------------- 3 files changed, 74 deletions(-) diff --git a/src/graphics/draw_calls.cpp b/src/graphics/draw_calls.cpp index d1d0a6efd..a5ecef2b9 100644 --- a/src/graphics/draw_calls.cpp +++ b/src/graphics/draw_calls.cpp @@ -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; diff --git a/src/graphics/materials.hpp b/src/graphics/materials.hpp index bbf1ad020..544b331ea 100644 --- a/src/graphics/materials.hpp +++ b/src/graphics/materials.hpp @@ -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; diff --git a/src/graphics/stk_mesh.hpp b/src/graphics/stk_mesh.hpp index bc8671e1c..f24c34c41 100644 --- a/src/graphics/stk_mesh.hpp +++ b/src/graphics/stk_mesh.hpp @@ -87,15 +87,6 @@ public: virtual bool isImmediateDraw() const { return false; } }; // STKMeshCommon -/* -// ---------------------------------------------------------------------------- -//TODO: template function in order to avoid duplicate code (clear method) -template -clearMeshList() -{ - -} -*/ // ---------------------------------------------------------------------------- template @@ -112,67 +103,33 @@ public: } }; // MeshList -// ---------------------------------------------------------------------------- -template -class InstancedMeshList : public Singleton -{ -public: - std::vector 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 {}; -// ---------------------------------------------------------------------------- -class ListInstancedMatDefault : public InstancedMeshList -{}; - // ---------------------------------------------------------------------------- class ListMatAlphaRef : public MeshList {}; -// ---------------------------------------------------------------------------- -class ListInstancedMatAlphaRef : public InstancedMeshList -{}; - // ---------------------------------------------------------------------------- class ListMatNormalMap : public MeshList {}; -// ---------------------------------------------------------------------------- -class ListInstancedMatNormalMap : public InstancedMeshList -{}; - // ---------------------------------------------------------------------------- class ListMatGrass : public MeshList {}; -// ---------------------------------------------------------------------------- -class ListInstancedMatGrass : public InstancedMeshList -{}; - // ---------------------------------------------------------------------------- class ListMatSphereMap : public MeshList {}; -// ---------------------------------------------------------------------------- -class ListInstancedMatSphereMap : public InstancedMeshList -{}; - // ---------------------------------------------------------------------------- class ListMatSplatting : public MeshList @@ -183,19 +140,11 @@ class ListMatUnlit : public MeshList {}; -// ---------------------------------------------------------------------------- -class ListInstancedMatUnlit : public InstancedMeshList -{}; - // ---------------------------------------------------------------------------- class ListMatDetails : public MeshList {}; -// ---------------------------------------------------------------------------- -class ListInstancedMatDetails : public InstancedMeshList -{}; - // ---------------------------------------------------------------------------- // Transparent template @@ -234,11 +183,6 @@ class ListDisplacement : public MiscList {}; -// ---------------------------------------------------------------------------- -class ListInstancedGlow : public Singleton - , public std::vector -{}; - // ---------------------------------------------------------------------------- Material::ShaderType getMeshMaterialFromType(video::E_MATERIAL_TYPE MaterialType, video::E_VERTEX_TYPE tp,