diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-14 00:40:34 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-14 00:40:34 +0400 |
commit | 5996242291f925cae6c2d70dde5ec42c8f922396 (patch) | |
tree | 9ad20f0cf92402051c19069d0b1722fd6ea8c960 /source/blender/blenkernel | |
parent | 6da961775f7fd38a5fca40fa9571426dd61c68d8 (diff) |
fix for error in editmesh derived callbacks, emDM_getVert(), emDM_getEdge(), emDM_getTessFace().
Currently the functions aren't used since they would fail have failed immediately.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/editderivedmesh.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index f01b550ff7a..923edab0a66 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -370,10 +370,6 @@ typedef struct EditDerivedBMesh { float (*vertexCos)[3]; float (*vertexNos)[3]; float (*polyNos)[3]; - - /* private variables, for number of verts/edges/faces - * within the above hash/table members */ - int tv, te, tf; } EditDerivedBMesh; static void emDM_calcNormals(DerivedMesh *UNUSED(dm)) @@ -1387,8 +1383,8 @@ static void emDM_getVert(DerivedMesh *dm, int index, MVert *vert_r) EditDerivedBMesh *bmdm = (EditDerivedBMesh *)dm; BMVert *ev; - if (index < 0 || index >= bmdm->tv) { - printf("error in emDM_getVert.\n"); + if (UNLIKELY(index < 0 || index >= bmdm->em->bm->totvert)) { + BLI_assert(!"error in emDM_getVert"); return; } @@ -1407,8 +1403,8 @@ static void emDM_getEdge(DerivedMesh *dm, int index, MEdge *edge_r) BMEdge *e; float *f; - if (index < 0 || index >= bmdm->te) { - printf("error in emDM_getEdge.\n"); + if (UNLIKELY(index < 0 || index >= bmdm->em->bm->totedge)) { + BLI_assert(!"error in emDM_getEdge"); return; } @@ -1434,8 +1430,8 @@ static void emDM_getTessFace(DerivedMesh *dm, int index, MFace *face_r) BMFace *ef; BMLoop **ltri; - if (index < 0 || index >= bmdm->tf) { - printf("error in emDM_getTessFace.\n"); + if (UNLIKELY(index < 0 || index >= bmdm->em->tottri)) { + BLI_assert(!"error in emDM_getTessFace"); return; } |