Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_MaterialBucket.h')
-rw-r--r--source/gameengine/Rasterizer/RAS_MaterialBucket.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h
index f5c8cd3e107..8db75b8b735 100644
--- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h
+++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h
@@ -32,6 +32,7 @@
#include "RAS_TexVert.h"
#include "GEN_Map.h"
#include "STR_HashedString.h"
+#include "SG_QList.h"
#include "MT_Transform.h"
#include "RAS_IPolygonMaterial.h"
@@ -69,6 +70,7 @@ class RAS_DisplayArray;
class RAS_MeshSlot;
class RAS_MeshMaterial;
class RAS_MaterialBucket;
+struct DerivedMesh;
/* An array with data used for OpenGL drawing */
@@ -88,7 +90,9 @@ public:
/* Entry of a RAS_MeshObject into RAS_MaterialBucket */
typedef std::vector<RAS_DisplayArray*> RAS_DisplayArrayList;
-class RAS_MeshSlot
+// The QList is used to link the mesh slots to the object
+// The DList is used to link the visible mesh slots to the material bucket
+class RAS_MeshSlot : public SG_QList
{
friend class RAS_ListRasterizer;
private:
@@ -110,6 +114,7 @@ public:
RAS_MeshObject* m_mesh;
void* m_clientObj;
RAS_Deformer* m_pDeformer;
+ DerivedMesh* m_pDerivedMesh;
double* m_OpenGLMatrix;
// visibility
bool m_bVisible;
@@ -148,6 +153,7 @@ public:
/* used during construction */
void SetDisplayArray(int numverts);
RAS_DisplayArray *CurrentDisplayArray();
+ void SetDeformer(RAS_Deformer* deformer);
void AddPolygon(int numverts);
int AddVertex(const RAS_TexVert& tv);
@@ -157,7 +163,11 @@ public:
bool Split(bool force=false);
bool Join(RAS_MeshSlot *target, MT_Scalar distance);
bool Equals(RAS_MeshSlot *target);
+#ifdef USE_SPLIT
bool IsCulled();
+#else
+ bool IsCulled() { return m_bCulled; }
+#endif
void SetCulled(bool culled) { m_bCulled = culled; }
};
@@ -168,7 +178,6 @@ class RAS_MeshMaterial
public:
RAS_MeshSlot *m_baseslot;
class RAS_MaterialBucket *m_bucket;
-
GEN_Map<GEN_HashedPtr,RAS_MeshSlot*> m_slots;
};
@@ -205,10 +214,23 @@ public:
class RAS_MeshSlot* CopyMesh(class RAS_MeshSlot *ms);
void RemoveMesh(class RAS_MeshSlot* ms);
void Optimize(MT_Scalar distance);
+ void ActivateMesh(RAS_MeshSlot* slot)
+ {
+ m_activeMeshSlotsHead.AddBack(slot);
+ }
+ SG_DList& GetActiveMeshSlots()
+ {
+ return m_activeMeshSlotsHead;
+ }
+ RAS_MeshSlot* GetNextActiveMeshSlot()
+ {
+ return (RAS_MeshSlot*)m_activeMeshSlotsHead.Remove();
+ }
private:
- list<RAS_MeshSlot> m_meshSlots;
+ list<RAS_MeshSlot> m_meshSlots; // all the mesh slots
RAS_IPolyMaterial* m_material;
+ SG_DList m_activeMeshSlotsHead; // only those which must be rendered
};