diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-06-05 12:37:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-06-05 12:37:53 +0400 |
commit | 6f47d054fff7eff1d26d9f4d7c49349c8159a692 (patch) | |
tree | 1c1f7374531958e9e24d79903c6cb49261ed8358 /source/blender | |
parent | ee5f43247b0446467f015b665a8c84cf05c62de7 (diff) |
Code cleanup: mixup hflag/htype
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/modifiers_bmesh.c | 14 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh.c | 30 |
2 files changed, 22 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/modifiers_bmesh.c b/source/blender/blenkernel/intern/modifiers_bmesh.c index c1726da32ae..645567eea67 100644 --- a/source/blender/blenkernel/intern/modifiers_bmesh.c +++ b/source/blender/blenkernel/intern/modifiers_bmesh.c @@ -70,7 +70,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal) int i, j, totvert, totedge /* , totface */ /* UNUSED */ ; bool is_init = (bm->totvert == 0) && (bm->totedge == 0) && (bm->totface == 0); bool is_cddm = (dm->type == DM_TYPE_CDDM); /* duplicate the arrays for non cddm */ - char has_orig_hflag = 0; + char has_orig_htype = 0; int cd_vert_bweight_offset; int cd_edge_bweight_offset; @@ -78,9 +78,9 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal) if (is_init == false) { /* check if we have an origflag */ - has_orig_hflag |= CustomData_has_layer(&bm->vdata, CD_ORIGINDEX) ? BM_VERT : 0; - has_orig_hflag |= CustomData_has_layer(&bm->edata, CD_ORIGINDEX) ? BM_EDGE : 0; - has_orig_hflag |= CustomData_has_layer(&bm->pdata, CD_ORIGINDEX) ? BM_FACE : 0; + has_orig_htype |= CustomData_has_layer(&bm->vdata, CD_ORIGINDEX) ? BM_VERT : 0; + has_orig_htype |= CustomData_has_layer(&bm->edata, CD_ORIGINDEX) ? BM_EDGE : 0; + has_orig_htype |= CustomData_has_layer(&bm->pdata, CD_ORIGINDEX) ? BM_FACE : 0; } /*merge custom data layout*/ @@ -118,7 +118,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal) /* add bevel weight */ if (cd_vert_bweight_offset != -1) BM_ELEM_CD_SET_FLOAT(v, cd_vert_bweight_offset, (float)mv->bweight / 255.0f); - if (UNLIKELY(has_orig_hflag & BM_VERT)) { + if (UNLIKELY(has_orig_htype & BM_VERT)) { int *orig_index = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_ORIGINDEX); *orig_index = ORIGINDEX_NONE; } @@ -141,7 +141,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal) if (cd_edge_bweight_offset != -1) BM_ELEM_CD_SET_FLOAT(e, cd_edge_bweight_offset, (float)me->bweight / 255.0f); if (cd_edge_crease_offset != -1) BM_ELEM_CD_SET_FLOAT(e, cd_edge_crease_offset, (float)me->crease / 255.0f); - if (UNLIKELY(has_orig_hflag & BM_EDGE)) { + if (UNLIKELY(has_orig_htype & BM_EDGE)) { int *orig_index = CustomData_bmesh_get(&bm->edata, e->head.data, CD_ORIGINDEX); *orig_index = ORIGINDEX_NONE; } @@ -188,7 +188,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm, const bool calc_face_normal) } } - if (UNLIKELY(has_orig_hflag & BM_FACE)) { + if (UNLIKELY(has_orig_htype & BM_FACE)) { int *orig_index = CustomData_bmesh_get(&bm->pdata, f->head.data, CD_ORIGINDEX); *orig_index = ORIGINDEX_NONE; } diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index 0c50cca5de1..56a57023ccd 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -449,14 +449,14 @@ static void bm_mesh_edges_sharp_tag(BMesh *bm, const float (*vnos)[3], const flo } { - char hflag = BM_LOOP; + char htype = BM_LOOP; if (vnos) { - hflag |= BM_VERT; + htype |= BM_VERT; } if (fnos) { - hflag |= BM_FACE; + htype |= BM_FACE; } - BM_mesh_elem_index_ensure(bm, hflag); + BM_mesh_elem_index_ensure(bm, htype); } /* This first loop checks which edges are actually smooth, and pre-populate lnos with vnos (as if they were @@ -515,14 +515,14 @@ static void bm_mesh_loops_calc_normals(BMesh *bm, const float (*vcos)[3], const BLI_SMALLSTACK_DECLARE(normal, float *); { - char hflag = BM_LOOP; + char htype = BM_LOOP; if (vcos) { - hflag |= BM_VERT; + htype |= BM_VERT; } if (fnos) { - hflag |= BM_FACE; + htype |= BM_FACE; } - BM_mesh_elem_index_ensure(bm, hflag); + BM_mesh_elem_index_ensure(bm, htype); } /* We now know edges that can be smoothed (they are tagged), and edges that will be hard (they aren't). @@ -787,7 +787,7 @@ void bmesh_edit_end(BMesh *bm, BMOpTypeFlag type_flag) } } -void BM_mesh_elem_index_ensure(BMesh *bm, const char hflag) +void BM_mesh_elem_index_ensure(BMesh *bm, const char htype) { #ifdef DEBUG BM_ELEM_INDEX_VALIDATE(bm, "Should Never Fail!", __func__); @@ -797,7 +797,7 @@ void BM_mesh_elem_index_ensure(BMesh *bm, const char hflag) { #pragma omp section { - if (hflag & BM_VERT) { + if (htype & BM_VERT) { if (bm->elem_index_dirty & BM_VERT) { BMIter iter; BMElem *ele; @@ -816,7 +816,7 @@ void BM_mesh_elem_index_ensure(BMesh *bm, const char hflag) #pragma omp section { - if (hflag & BM_EDGE) { + if (htype & BM_EDGE) { if (bm->elem_index_dirty & BM_EDGE) { BMIter iter; BMElem *ele; @@ -835,13 +835,13 @@ void BM_mesh_elem_index_ensure(BMesh *bm, const char hflag) #pragma omp section { - if (hflag & (BM_FACE | BM_LOOP)) { + if (htype & (BM_FACE | BM_LOOP)) { if (bm->elem_index_dirty & (BM_FACE | BM_LOOP)) { BMIter iter; BMElem *ele; - const bool update_face = (hflag & BM_FACE) && (bm->elem_index_dirty & BM_FACE); - const bool update_loop = (hflag & BM_LOOP) && (bm->elem_index_dirty & BM_LOOP); + const bool update_face = (htype & BM_FACE) && (bm->elem_index_dirty & BM_FACE); + const bool update_loop = (htype & BM_LOOP) && (bm->elem_index_dirty & BM_LOOP); int index; int index_loop = 0; @@ -873,7 +873,7 @@ void BM_mesh_elem_index_ensure(BMesh *bm, const char hflag) } } - bm->elem_index_dirty &= ~hflag; + bm->elem_index_dirty &= ~htype; } |