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/blender/bmesh/intern/bmesh_log.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_log.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c
index a2510129df6..68f8f38fb26 100644
--- a/source/blender/bmesh/intern/bmesh_log.c
+++ b/source/blender/bmesh/intern/bmesh_log.c
@@ -215,7 +215,8 @@ static BMLogFace *bm_log_face_alloc(BMLog *log, BMFace *f)
BLI_assert(f->len == 3);
- BM_iter_as_array(NULL, BM_VERTS_OF_FACE, f, (void **)v, 3);
+ // BM_iter_as_array(NULL, BM_VERTS_OF_FACE, f, (void **)v, 3);
+ BM_face_as_array_vert_tri(f, v);
lf->v_ids[0] = bm_log_vert_id_get(log, v[0]);
lf->v_ids[1] = bm_log_vert_id_get(log, v[1]);
@@ -276,11 +277,11 @@ static void bm_log_faces_restore(BMesh *bm, BMLog *log, GHash *faces)
void *key = BLI_ghashIterator_getKey(&gh_iter);
BMLogFace *lf = BLI_ghashIterator_getValue(&gh_iter);
BMVert *v[3] = {bm_log_vert_from_id(log, lf->v_ids[0]),
- bm_log_vert_from_id(log, lf->v_ids[1]),
- bm_log_vert_from_id(log, lf->v_ids[2])};
+ bm_log_vert_from_id(log, lf->v_ids[1]),
+ bm_log_vert_from_id(log, lf->v_ids[2])};
BMFace *f;
- f = BM_face_create_quad_tri_v(bm, v, 3, NULL, FALSE);
+ f = BM_face_create_quad_tri_v(bm, v, 3, NULL, false);
bm_log_face_id_set(log, f, GET_INT_FROM_POINTER(key));
}
}
@@ -805,8 +806,11 @@ void BM_log_vert_removed(BMesh *bm, BMLog *log, BMVert *v)
unsigned int v_id = bm_log_vert_id_get(log, v);
void *key = SET_INT_IN_POINTER(v_id);
- if (BLI_ghash_lookup(entry->added_verts, key)) {
- BLI_ghash_remove(entry->added_verts, key, NULL, NULL);
+ /* if it has a key, it shouldn't be NULL */
+ BLI_assert(!!BLI_ghash_lookup(entry->added_verts, key) ==
+ !!BLI_ghash_haskey(entry->added_verts, key));
+
+ if (BLI_ghash_remove(entry->added_verts, key, NULL, NULL)) {
range_tree_uint_release(log->unused_ids, v_id);
}
else {
@@ -843,8 +847,11 @@ void BM_log_face_removed(BMLog *log, BMFace *f)
unsigned int f_id = bm_log_face_id_get(log, f);
void *key = SET_INT_IN_POINTER(f_id);
- if (BLI_ghash_lookup(entry->added_faces, key)) {
- BLI_ghash_remove(entry->added_faces, key, NULL, NULL);
+ /* if it has a key, it shouldn't be NULL */
+ BLI_assert(!!BLI_ghash_lookup(entry->added_faces, key) ==
+ !!BLI_ghash_haskey(entry->added_faces, key));
+
+ if (BLI_ghash_remove(entry->added_faces, key, NULL, NULL)) {
range_tree_uint_release(log->unused_ids, f_id);
}
else {