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:
authorRohan Rathi <rohanrathi08@gmail.com>2018-06-25 11:17:46 +0300
committerRohan Rathi <rohanrathi08@gmail.com>2018-06-25 11:17:46 +0300
commite8a1b4d6452fc6ea3582f0f178f4da696c0e9c20 (patch)
tree8e72f1e94f98b63f41796996690f8085a6ef5975 /source/blender/bmesh
parent1757b381790cd490e14b7ff7b6c4c84e4f1132e9 (diff)
Change bitmap to GHash in bevel_harden_normals_mode
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index c63fe69762a..186d3a3c8e0 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -1665,32 +1665,33 @@ static void bevel_harden_normals_mode(BMesh *bm, BevelParams *bp, BevVert *bv, B
float n_final[3] = { 0.0f, 0.0f, 0.0f };
if (bp->hnmode == BEVEL_HN_FACE) {
- BLI_bitmap *faces = BLI_BITMAP_NEW(bm->totface, __func__);
+ GHash *faceHash = BLI_ghash_int_new(__func__);
+
BM_ITER_ELEM(e, &eiter, bv->v, BM_EDGES_OF_VERT) {
if (BM_elem_flag_test(e, BM_ELEM_TAG)) {
BMFace *f_a, *f_b;
BM_edge_face_pair(e, &f_a, &f_b);
- if (f_a && !BLI_BITMAP_TEST(faces, BM_elem_index_get(f_a))) {
+ if(f_a && !BLI_ghash_haskey(faceHash, SET_UINT_IN_POINTER(BM_elem_index_get(f_a)))) {
int f_area = BM_face_calc_area(f_a);
float f_no[3];
copy_v3_v3(f_no, f_a->no);
mul_v3_fl(f_no, f_area);
add_v3_v3(n_final, f_no);
- BLI_BITMAP_ENABLE(faces, BM_elem_index_get(f_a));
+ BLI_ghash_insert(faceHash, SET_UINT_IN_POINTER(BM_elem_index_get(f_a)), NULL);
}
- if (f_b && !BLI_BITMAP_TEST(faces, BM_elem_index_get(f_b))) {
+ if(f_b && !BLI_ghash_haskey(faceHash, SET_UINT_IN_POINTER(BM_elem_index_get(f_b)))) {
int f_area = BM_face_calc_area(f_b);
float f_no[3];
copy_v3_v3(f_no, f_b->no);
mul_v3_fl(f_no, f_area);
add_v3_v3(n_final, f_no);
- BLI_BITMAP_ENABLE(faces, BM_elem_index_get(f_b));
+ BLI_ghash_insert(faceHash, SET_UINT_IN_POINTER(BM_elem_index_get(f_b)), NULL);
}
}
}
- MEM_freeN(faces);
+ BLI_ghash_free(faceHash, NULL, NULL);
normalize_v3(n_final);
}
else if (bp->hnmode == BEVEL_HN_ADJ) {