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>2011-12-28 11:43:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-28 11:43:06 +0400
commitf89aeae10c0514a9237225c1d4a9c781652a86c6 (patch)
tree84e47c3769a98a14646913dce40d32ddf2c78304 /source/blender/modifiers
parent6d878810c62a64733c4078bb093b8d856a48bc5e (diff)
sync some edits with bmesh
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c39
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");