diff options
Diffstat (limited to 'source/gameengine/Converter/BL_SkinMeshObject.cpp')
-rw-r--r-- | source/gameengine/Converter/BL_SkinMeshObject.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/gameengine/Converter/BL_SkinMeshObject.cpp b/source/gameengine/Converter/BL_SkinMeshObject.cpp index 8bc78c7f757..69feb72f5dc 100644 --- a/source/gameengine/Converter/BL_SkinMeshObject.cpp +++ b/source/gameengine/Converter/BL_SkinMeshObject.cpp @@ -53,23 +53,27 @@ void BL_SkinMeshObject::AddPolygon(RAS_Polygon* poly) RAS_MeshObject::AddPolygon(poly); } -#ifdef __NLA_OLDDEFORM -int BL_SkinMeshObject::FindOrAddDeform(int vtxarray, struct MVert *mv, struct MDeformVert *dv, RAS_IPolyMaterial* mat) -#else int BL_SkinMeshObject::FindOrAddDeform(unsigned int vtxarray, unsigned int mv, struct MDeformVert *dv, RAS_IPolyMaterial* mat) -#endif { BL_SkinArrayOptimizer* ao = (BL_SkinArrayOptimizer*)GetArrayOptimizer(mat);//*(m_matVertexArrays[*mat]); int numvert = ao->m_MvertArrayCache1[vtxarray]->size(); - + /* Check to see if this has already been pushed */ - for (unsigned int i=0; i<ao->m_MvertArrayCache1[vtxarray]->size(); i++){ - if (mv == (*ao->m_MvertArrayCache1[vtxarray])[i]) - return i; + for (vector<BL_MDVertMap>::iterator it = m_mvert_to_dvert_mapping[mv].begin(); + it != m_mvert_to_dvert_mapping[mv].end(); + it++) + { + if(it->mat == mat) + return it->index; } ao->m_MvertArrayCache1[vtxarray]->push_back(mv); ao->m_DvertArrayCache1[vtxarray]->push_back(dv); + + BL_MDVertMap mdmap; + mdmap.mat = mat; + mdmap.index = numvert; + m_mvert_to_dvert_mapping[mv].push_back(mdmap); return numvert; }; @@ -105,11 +109,7 @@ int BL_SkinMeshObject::FindVertexArray(int numverts,RAS_IPolyMaterial* polymat) KX_IndexArray *ia = new KX_IndexArray(); ao->m_IndexArrayCache1.push_back(ia); -#ifdef __NLA_OLDDEFORM - BL_MVertArray *bva = new BL_MVertArray(); -#else KX_IndexArray *bva = new KX_IndexArray(); -#endif ao->m_MvertArrayCache1.push_back(bva); BL_DeformVertArray *dva = new BL_DeformVertArray(); |