diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2009-04-18 13:14:51 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2009-04-18 13:14:51 +0400 |
commit | 53fd3847bcb577d580a16217a27b67fd3f679969 (patch) | |
tree | f04ae67085c3d3cae44081a9b83b86318c57beca /source | |
parent | df8cf26404c7e922751643b1095e38f1ab430811 (diff) |
BGE: restore a feature that was lost in 2.48: sharing of display lists between duplicated objects.
Diffstat (limited to 'source')
4 files changed, 11 insertions, 9 deletions
diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp index 5ddcdd310b0..6beab28d61f 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp @@ -60,7 +60,7 @@ RAS_MeshSlot::RAS_MeshSlot() RAS_MeshSlot::~RAS_MeshSlot() { - vector<RAS_DisplayArray*>::iterator it; + RAS_DisplayArrayList::iterator it; #ifdef USE_SPLIT Split(true); @@ -83,7 +83,7 @@ RAS_MeshSlot::~RAS_MeshSlot() RAS_MeshSlot::RAS_MeshSlot(const RAS_MeshSlot& slot) { - vector<RAS_DisplayArray*>::iterator it; + RAS_DisplayArrayList::iterator it; m_clientObj = NULL; m_pDeformer = NULL; @@ -205,7 +205,7 @@ RAS_DisplayArray *RAS_MeshSlot::CurrentDisplayArray() void RAS_MeshSlot::SetDisplayArray(int numverts) { - vector<RAS_DisplayArray*>::iterator it; + RAS_DisplayArrayList::iterator it; RAS_DisplayArray *darray = NULL; for(it=m_displayArrays.begin(); it!=m_displayArrays.end(); it++) { @@ -297,7 +297,7 @@ bool RAS_MeshSlot::Equals(RAS_MeshSlot *target) bool RAS_MeshSlot::Join(RAS_MeshSlot *target, MT_Scalar distance) { - vector<RAS_DisplayArray*>::iterator it; + RAS_DisplayArrayList::iterator it; iterator mit; size_t i; @@ -362,7 +362,7 @@ bool RAS_MeshSlot::Split(bool force) { list<RAS_MeshSlot*>::iterator jit; RAS_MeshSlot *target = m_joinSlot; - vector<RAS_DisplayArray*>::iterator it, jt; + RAS_DisplayArrayList::iterator it, jt; iterator mit; size_t i, found0 = 0, found1 = 0; diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index 211770318ae..f5c8cd3e107 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -86,9 +86,11 @@ public: }; /* Entry of a RAS_MeshObject into RAS_MaterialBucket */ +typedef std::vector<RAS_DisplayArray*> RAS_DisplayArrayList; class RAS_MeshSlot { + friend class RAS_ListRasterizer; private: // indices into display arrays int m_startarray; @@ -97,7 +99,7 @@ private: int m_endindex; int m_startvertex; int m_endvertex; - vector<RAS_DisplayArray*> m_displayArrays; + RAS_DisplayArrayList m_displayArrays; // for construction only RAS_DisplayArray* m_currentArray; diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp index 2c4b55ff964..65aadd63a40 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp @@ -136,10 +136,10 @@ RAS_ListSlot* RAS_ListRasterizer::FindOrAdd(RAS_MeshSlot& ms) */ RAS_ListSlot* localSlot = (RAS_ListSlot*)ms.m_DisplayList; if(!localSlot) { - RAS_Lists::iterator it = mLists.find(&ms); + RAS_Lists::iterator it = mLists.find(ms.m_displayArrays); if(it == mLists.end()) { localSlot = new RAS_ListSlot(this); - mLists.insert(std::pair<RAS_MeshSlot*, RAS_ListSlot*>(&ms, localSlot)); + mLists.insert(std::pair<RAS_DisplayArrayList, RAS_ListSlot*>(ms.m_displayArrays, localSlot)); } else { localSlot = static_cast<RAS_ListSlot*>(it->second->AddRef()); } diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h index 96d6d2a995d..653bb43e534 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h @@ -35,7 +35,7 @@ enum RAS_ListSlotFlags { LIST_REGEN =64 }; -typedef std::map<class RAS_MeshSlot*, RAS_ListSlot*> RAS_Lists; +typedef std::map<RAS_DisplayArrayList, RAS_ListSlot*> RAS_Lists; class RAS_ListRasterizer : public RAS_VAOpenGLRasterizer { |