diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-28 11:43:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-28 11:43:06 +0400 |
commit | f89aeae10c0514a9237225c1d4a9c781652a86c6 (patch) | |
tree | 84e47c3769a98a14646913dce40d32ddf2c78304 /source/blender/modifiers | |
parent | 6d878810c62a64733c4078bb093b8d856a48bc5e (diff) |
sync some edits with bmesh
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_solidify.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index 2aa69526c10..0391f33184f 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -100,15 +100,21 @@ static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3]) /* This function adds an edge hash if its not there, and adds the face index */ #define NOCALC_EDGEWEIGHT_ADD_EDGEREF_FACE(EDV1, EDV2); \ - edge_ref = (EdgeFaceRef *)BLI_edgehash_lookup(edge_hash, EDV1, EDV2); \ + { \ + const unsigned int ed_v1 = EDV1; \ + const unsigned int ed_v2 = EDV2; \ + edge_ref = (EdgeFaceRef *)BLI_edgehash_lookup(edge_hash, ed_v1, ed_v2); \ if (!edge_ref) { \ edge_ref = &edge_ref_array[edge_ref_count]; edge_ref_count++; \ - edge_ref->f1=i; \ - edge_ref->f2=-1; \ - BLI_edgehash_insert(edge_hash, EDV1, EDV2, edge_ref); \ - } else { \ + edge_ref->f1 = i; \ + edge_ref->f2 =- 1; \ + BLI_edgehash_insert(edge_hash, ed_v1, ed_v2, edge_ref); \ + } \ + else { \ edge_ref->f2=i; \ - } + } \ + } + /* --- end define --- */ for(i = 0; i < numFaces; i++, mf++) { f_no = face_nors[i]; @@ -265,14 +271,19 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, #define INVALID_PAIR -2 #define ADD_EDGE_USER(_v1, _v2, edge_ord) \ - eidx= GET_INT_FROM_POINTER(BLI_edgehash_lookup(edgehash, _v1, _v2)); \ - if(edge_users[eidx] == INVALID_UNUSED) { \ - ed= orig_medge + eidx; \ - edge_users[eidx]= (_v1 < _v2) == (ed->v1 < ed->v2) ? i:(i+numFaces); \ - edge_order[eidx]= edge_ord; \ - } else { \ - edge_users[eidx]= INVALID_PAIR; \ - } \ + { \ + const unsigned int ml_v1 = _v1; \ + const unsigned int ml_v2 = _v2; \ + eidx= GET_INT_FROM_POINTER(BLI_edgehash_lookup(edgehash, ml_v1, ml_v2)); \ + if(edge_users[eidx] == INVALID_UNUSED) { \ + ed= orig_medge + eidx; \ + edge_users[eidx] = (ml_v1 < ml_v2) == (ed->v1 < ed->v2) ? i : (i + numFaces); \ + edge_order[eidx] = edge_ord; \ + } \ + else { \ + edge_users[eidx] = INVALID_PAIR; \ + } \ + } edge_users= MEM_mallocN(sizeof(int) * numEdges, "solid_mod edges"); |