diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 18:47:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 18:47:53 +0400 |
commit | c8ebfe1d12f87ae453fc9191fa7e3ae30aa800d4 (patch) | |
tree | 5fec94cb3019a6957fb8f094e51d34577c6dbeaa /source/blender/blenkernel/intern/mesh.c | |
parent | a55e97058b409dc9d62cbfc1634acd3810a2af0e (diff) |
code cleanup:
- use bmesh iterator macros in more places
- rename scanfill variables (were using same names as mesh faces/verts which was confusing)
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 537c64a4dbc..d478302931f 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -2391,8 +2391,8 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata, MFace *mface = NULL, *mf; BLI_array_declare(mface); ScanFillContext sf_ctx; - ScanFillVert *v, *lastv, *firstv; - ScanFillFace *f; + ScanFillVert *sf_vert, *sf_vert_last, *sf_vert_first; + ScanFillFace *sf_tri; int *mface_orig_index = NULL; BLI_array_declare(mface_orig_index); int *mface_to_poly_map = NULL; @@ -2485,21 +2485,21 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata, ml = mloop + mp->loopstart; BLI_scanfill_begin(&sf_ctx); - firstv = NULL; - lastv = NULL; + sf_vert_first = NULL; + sf_vert_last = NULL; for (j = 0; j < mp->totloop; j++, ml++) { - v = BLI_scanfill_vert_add(&sf_ctx, mvert[ml->v].co); + sf_vert = BLI_scanfill_vert_add(&sf_ctx, mvert[ml->v].co); - v->keyindex = mp->loopstart + j; + sf_vert->keyindex = mp->loopstart + j; - if (lastv) - BLI_scanfill_edge_add(&sf_ctx, lastv, v); + if (sf_vert_last) + BLI_scanfill_edge_add(&sf_ctx, sf_vert_last, sf_vert); - if (!firstv) - firstv = v; - lastv = v; + if (!sf_vert_first) + sf_vert_first = sf_vert; + sf_vert_last = sf_vert; } - BLI_scanfill_edge_add(&sf_ctx, lastv, firstv); + BLI_scanfill_edge_add(&sf_ctx, sf_vert_last, sf_vert_first); totfilltri = BLI_scanfill_calc(&sf_ctx, FALSE); if (totfilltri) { @@ -2509,14 +2509,14 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata, BLI_array_grow_items(mface_orig_index, totfilltri); } - for (f = sf_ctx.fillfacebase.first; f; f = f->next, mf++) { + for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next, mf++) { mface_to_poly_map[mface_index] = poly_index; mf = &mface[mface_index]; /* set loop indices, transformed to vert indices later */ - mf->v1 = f->v1->keyindex; - mf->v2 = f->v2->keyindex; - mf->v3 = f->v3->keyindex; + mf->v1 = sf_tri->v1->keyindex; + mf->v2 = sf_tri->v2->keyindex; + mf->v3 = sf_tri->v3->keyindex; mf->v4 = 0; mf->mat_nr = mp->mat_nr; |