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:
authorCampbell Barton <ideasman42@gmail.com>2012-10-26 10:19:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-26 10:19:49 +0400
commit2d39533da8d69425759628f42acd80534c65c122 (patch)
treeabf1d98caf5abb802a400abc3d246d5bb45174f7 /source/blender/bmesh/intern
parent3b7dee7cbac6c55e1ecf56e1d344bc82aa767c51 (diff)
add a function for merging 2 bmesh element flags into a 3rd item.
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r--source/blender/bmesh/intern/bmesh_decimate_unsubdivide.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_inline.h6
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_decimate_unsubdivide.c b/source/blender/bmesh/intern/bmesh_decimate_unsubdivide.c
index 0cb200cc997..68c0652d2c4 100644
--- a/source/blender/bmesh/intern/bmesh_decimate_unsubdivide.c
+++ b/source/blender/bmesh/intern/bmesh_decimate_unsubdivide.c
@@ -146,7 +146,7 @@ static int bm_vert_dissolve_fan(BMesh *bm, BMVert *v)
BMLoop *l_new;
BLI_assert(l->prev->v != l->next->v);
BM_face_split(bm, l->f, l->prev->v, l->next->v, &l_new, NULL, TRUE);
- BM_elem_flag_enable(l_new->e, l->e->head.hflag | l->prev->e->head.hflag);
+ BM_elem_flag_merge_into(l_new->e, l->e, l->prev->e);
}
}
diff --git a/source/blender/bmesh/intern/bmesh_inline.h b/source/blender/bmesh/intern/bmesh_inline.h
index 400f4a55b0e..04b214f725a 100644
--- a/source/blender/bmesh/intern/bmesh_inline.h
+++ b/source/blender/bmesh/intern/bmesh_inline.h
@@ -37,6 +37,7 @@
#define BM_elem_flag_set( ele, hflag, val) _bm_elem_flag_set (&(ele)->head, hflag, val)
#define BM_elem_flag_toggle( ele, hflag) _bm_elem_flag_toggle (&(ele)->head, hflag)
#define BM_elem_flag_merge( ele_a, ele_b) _bm_elem_flag_merge (&(ele_a)->head, &(ele_b)->head)
+#define BM_elem_flag_merge_into(ele, ele_a, ele_b)_bm_elem_flag_merge_into (&(ele)->head, &(ele_a)->head, &(ele_b)->head)
BLI_INLINE char _bm_elem_flag_test(const BMHeader *head, const char hflag)
{
@@ -74,6 +75,11 @@ BLI_INLINE void _bm_elem_flag_merge(BMHeader *head_a, BMHeader *head_b)
head_a->hflag = head_b->hflag = head_a->hflag | head_b->hflag;
}
+BLI_INLINE void _bm_elem_flag_merge_into(BMHeader *head, const BMHeader *head_a, const BMHeader *head_b)
+{
+ head->hflag = head_a->hflag | head_b->hflag;
+}
+
/**
* notes on #BM_elem_index_set(...) usage,
* Set index is sometimes abused as temp storage, other times we cant be