diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-26 10:19:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-26 10:19:49 +0400 |
commit | 2d39533da8d69425759628f42acd80534c65c122 (patch) | |
tree | abf1d98caf5abb802a400abc3d246d5bb45174f7 /source | |
parent | 3b7dee7cbac6c55e1ecf56e1d344bc82aa767c51 (diff) |
add a function for merging 2 bmesh element flags into a 3rd item.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_decimate_unsubdivide.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_inline.h | 6 |
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 |