diff options
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_build.c | 34 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_explode.c | 10 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_mask.c | 34 |
3 files changed, 39 insertions, 39 deletions
diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index e877d5649d4..34b432fe805 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -138,7 +138,7 @@ static DerivedMesh *applyModifier( for (j = 0; j < mp->totloop; j++, ml++) { void **val_p; - if (!BLI_ghash_ensure_p(vertHash, SET_INT_IN_POINTER(ml->v), &val_p)) { + if (!BLI_ghash_ensure_p(vertHash, POINTER_FROM_INT(ml->v), &val_p)) { *val_p = (void *)hash_num; hash_num++; } @@ -157,8 +157,8 @@ static DerivedMesh *applyModifier( for (i = 0; i < numEdge_src; i++, hash_num_alt++) { MEdge *me = medge + i; - if (BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v1)) && - BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v2))) + if (BLI_ghash_haskey(vertHash, POINTER_FROM_INT(me->v1)) && + BLI_ghash_haskey(vertHash, POINTER_FROM_INT(me->v2))) { BLI_ghash_insert(edgeHash, (void *)hash_num, (void *)hash_num_alt); BLI_ghash_insert(edgeHash2, (void *)hash_num_alt, (void *)hash_num); @@ -184,11 +184,11 @@ static DerivedMesh *applyModifier( void **val_p; me = medge + edgeMap[i]; - if (!BLI_ghash_ensure_p(vertHash, SET_INT_IN_POINTER(me->v1), &val_p)) { + if (!BLI_ghash_ensure_p(vertHash, POINTER_FROM_INT(me->v1), &val_p)) { *val_p = (void *)hash_num; hash_num++; } - if (!BLI_ghash_ensure_p(vertHash, SET_INT_IN_POINTER(me->v2), &val_p)) { + if (!BLI_ghash_ensure_p(vertHash, POINTER_FROM_INT(me->v2), &val_p)) { *val_p = (void *)hash_num; hash_num++; } @@ -199,10 +199,10 @@ static DerivedMesh *applyModifier( for (i = 0; i < numEdges_dst; i++) { j = BLI_ghash_len(edgeHash); - BLI_ghash_insert(edgeHash, SET_INT_IN_POINTER(j), - SET_INT_IN_POINTER(edgeMap[i])); - BLI_ghash_insert(edgeHash2, SET_INT_IN_POINTER(edgeMap[i]), - SET_INT_IN_POINTER(j)); + BLI_ghash_insert(edgeHash, POINTER_FROM_INT(j), + POINTER_FROM_INT(edgeMap[i])); + BLI_ghash_insert(edgeHash2, POINTER_FROM_INT(edgeMap[i]), + POINTER_FROM_INT(j)); } } else { @@ -217,7 +217,7 @@ static DerivedMesh *applyModifier( * mapped to the new indices */ for (i = 0; i < numVerts; i++) { - BLI_ghash_insert(vertHash, SET_INT_IN_POINTER(vertMap[i]), SET_INT_IN_POINTER(i)); + BLI_ghash_insert(vertHash, POINTER_FROM_INT(vertMap[i]), POINTER_FROM_INT(i)); } } @@ -231,8 +231,8 @@ static DerivedMesh *applyModifier( GHASH_ITER (gh_iter, vertHash) { MVert source; MVert *dest; - int oldIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter)); - int newIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter)); + int oldIndex = POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter)); + int newIndex = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter)); source = mvert_src[oldIndex]; dest = CDDM_get_vert(result, newIndex); @@ -245,13 +245,13 @@ static DerivedMesh *applyModifier( for (i = 0; i < BLI_ghash_len(edgeHash); i++) { MEdge source; MEdge *dest; - int oldIndex = GET_INT_FROM_POINTER(BLI_ghash_lookup(edgeHash, SET_INT_IN_POINTER(i))); + int oldIndex = POINTER_AS_INT(BLI_ghash_lookup(edgeHash, POINTER_FROM_INT(i))); source = medge_src[oldIndex]; dest = CDDM_get_edge(result, i); - source.v1 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v1))); - source.v2 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v2))); + source.v1 = POINTER_AS_INT(BLI_ghash_lookup(vertHash, POINTER_FROM_INT(source.v1))); + source.v2 = POINTER_AS_INT(BLI_ghash_lookup(vertHash, POINTER_FROM_INT(source.v2))); DM_copy_edge_data(dm, result, oldIndex, i, 1); *dest = source; @@ -277,8 +277,8 @@ static DerivedMesh *applyModifier( ml_src = mloop_src + source->loopstart; for (j = 0; j < source->totloop; j++, k++, ml_src++, ml_dst++) { - ml_dst->v = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(ml_src->v))); - ml_dst->e = GET_INT_FROM_POINTER(BLI_ghash_lookup(edgeHash2, SET_INT_IN_POINTER(ml_src->e))); + ml_dst->v = POINTER_AS_INT(BLI_ghash_lookup(vertHash, POINTER_FROM_INT(ml_src->v))); + ml_dst->e = POINTER_AS_INT(BLI_ghash_lookup(edgeHash2, POINTER_FROM_INT(ml_src->e))); } } diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index a7f09aec481..2fc30f9fddd 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -189,7 +189,7 @@ static void createFacepa( static int edgecut_get(EdgeHash *edgehash, unsigned int v1, unsigned int v2) { - return GET_INT_FROM_POINTER(BLI_edgehash_lookup(edgehash, v1, v2)); + return POINTER_AS_INT(BLI_edgehash_lookup(edgehash, v1, v2)); } @@ -626,7 +626,7 @@ static DerivedMesh *cutEdges(ExplodeModifierData *emd, DerivedMesh *dm) ehi = BLI_edgehashIterator_new(edgehash); totesplit = totvert; for (; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) { - BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(totesplit)); + BLI_edgehashIterator_setValue(ehi, POINTER_FROM_INT(totesplit)); totesplit++; } BLI_edgehashIterator_free(ehi); @@ -665,7 +665,7 @@ static DerivedMesh *cutEdges(ExplodeModifierData *emd, DerivedMesh *dm) ehi = BLI_edgehashIterator_new(edgehash); for (; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) { BLI_edgehashIterator_getKey(ehi, &ed_v1, &ed_v2); - esplit = GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi)); + esplit = POINTER_AS_INT(BLI_edgehashIterator_getValue(ehi)); mv = CDDM_get_vert(splitdm, ed_v2); dupve = CDDM_get_vert(splitdm, esplit); @@ -859,7 +859,7 @@ static DerivedMesh *explodeMesh( /* make new vertice indexes & count total vertices after duplication */ ehi = BLI_edgehashIterator_new(vertpahash); for (; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) { - BLI_edgehashIterator_setValue(ehi, SET_INT_IN_POINTER(totdup)); + BLI_edgehashIterator_setValue(ehi, POINTER_FROM_INT(totdup)); totdup++; } BLI_edgehashIterator_free(ehi); @@ -883,7 +883,7 @@ static DerivedMesh *explodeMesh( /* get particle + vertex from hash */ BLI_edgehashIterator_getKey(ehi, &ed_v1, &ed_v2); ed_v2 -= totvert; - v = GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi)); + v = POINTER_AS_INT(BLI_edgehashIterator_getValue(ehi)); dm->getVert(dm, ed_v1, &source); dest = CDDM_get_vert(explode, v); diff --git a/source/blender/modifiers/intern/MOD_mask.c b/source/blender/modifiers/intern/MOD_mask.c index 25db2d5ff0b..93332fb0455 100644 --- a/source/blender/modifiers/intern/MOD_mask.c +++ b/source/blender/modifiers/intern/MOD_mask.c @@ -209,7 +209,7 @@ static DerivedMesh *applyModifier( } /* add to ghash for verts (numVerts acts as counter for mapping) */ - BLI_ghash_insert(vertHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numVerts)); + BLI_ghash_insert(vertHash, POINTER_FROM_INT(i), POINTER_FROM_INT(numVerts)); numVerts++; } @@ -234,7 +234,7 @@ static DerivedMesh *applyModifier( } /* add to ghash for verts (numVerts acts as counter for mapping) */ - BLI_ghash_insert(vertHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numVerts)); + BLI_ghash_insert(vertHash, POINTER_FROM_INT(i), POINTER_FROM_INT(numVerts)); numVerts++; } } @@ -258,10 +258,10 @@ static DerivedMesh *applyModifier( const MEdge *me = &medge_src[i]; /* only add if both verts will be in new mesh */ - if (BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v1)) && - BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me->v2))) + if (BLI_ghash_haskey(vertHash, POINTER_FROM_INT(me->v1)) && + BLI_ghash_haskey(vertHash, POINTER_FROM_INT(me->v2))) { - BLI_ghash_insert(edgeHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numEdges)); + BLI_ghash_insert(edgeHash, POINTER_FROM_INT(i), POINTER_FROM_INT(numEdges)); numEdges++; } } @@ -272,7 +272,7 @@ static DerivedMesh *applyModifier( int j; for (j = 0; j < mp_src->totloop; j++, ml_src++) { - if (!BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(ml_src->v))) { + if (!BLI_ghash_haskey(vertHash, POINTER_FROM_INT(ml_src->v))) { ok = false; break; } @@ -280,7 +280,7 @@ static DerivedMesh *applyModifier( /* all verts must be available */ if (ok) { - BLI_ghash_insert(polyHash, SET_INT_IN_POINTER(i), SET_INT_IN_POINTER(numPolys)); + BLI_ghash_insert(polyHash, POINTER_FROM_INT(i), POINTER_FROM_INT(numPolys)); loop_mapping[numPolys] = numLoops; numPolys++; numLoops += mp_src->totloop; @@ -303,8 +303,8 @@ static DerivedMesh *applyModifier( GHASH_ITER (gh_iter, vertHash) { const MVert *v_src; MVert *v_dst; - const int i_src = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter)); - const int i_dst = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter)); + const int i_src = POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter)); + const int i_dst = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter)); v_src = &mvert_src[i_src]; v_dst = &mvert_dst[i_dst]; @@ -317,22 +317,22 @@ static DerivedMesh *applyModifier( GHASH_ITER (gh_iter, edgeHash) { const MEdge *e_src; MEdge *e_dst; - const int i_src = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter)); - const int i_dst = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter)); + const int i_src = POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter)); + const int i_dst = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter)); e_src = &medge_src[i_src]; e_dst = &medge_dst[i_dst]; DM_copy_edge_data(dm, result, i_src, i_dst, 1); *e_dst = *e_src; - e_dst->v1 = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(e_src->v1))); - e_dst->v2 = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(e_src->v2))); + e_dst->v1 = POINTER_AS_UINT(BLI_ghash_lookup(vertHash, POINTER_FROM_UINT(e_src->v1))); + e_dst->v2 = POINTER_AS_UINT(BLI_ghash_lookup(vertHash, POINTER_FROM_UINT(e_src->v2))); } /* faces */ GHASH_ITER (gh_iter, polyHash) { - const int i_src = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(&gh_iter)); - const int i_dst = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter)); + const int i_src = POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter)); + const int i_dst = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter)); const MPoly *mp_src = &mpoly_src[i_src]; MPoly *mp_dst = &mpoly_dst[i_dst]; const int i_ml_src = mp_src->loopstart; @@ -346,8 +346,8 @@ static DerivedMesh *applyModifier( *mp_dst = *mp_src; mp_dst->loopstart = i_ml_dst; for (i = 0; i < mp_src->totloop; i++) { - ml_dst[i].v = GET_UINT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_UINT_IN_POINTER(ml_src[i].v))); - ml_dst[i].e = GET_UINT_FROM_POINTER(BLI_ghash_lookup(edgeHash, SET_UINT_IN_POINTER(ml_src[i].e))); + ml_dst[i].v = POINTER_AS_UINT(BLI_ghash_lookup(vertHash, POINTER_FROM_UINT(ml_src[i].v))); + ml_dst[i].e = POINTER_AS_UINT(BLI_ghash_lookup(edgeHash, POINTER_FROM_UINT(ml_src[i].e))); } } |