Cleanup: Use references for mesh poly variables

Similar to the previous commit, this simplifies future refactoring
to change the way edges are stored, and further differentiates
single poly variables from array pointers.
This commit is contained in:
2023-03-03 11:40:34 -05:00
parent 45cff837bc
commit 915ff8d152
56 changed files with 455 additions and 468 deletions

View File

@@ -477,19 +477,19 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
/* create polys and loops */
for (k = 0; k < totpoly; k++) {
const MPoly *inMP = &orig_polys[k];
MPoly *poly = &polys[p_skip * totpoly + k];
const MPoly &in_poly = orig_polys[k];
MPoly &poly = polys[p_skip * totpoly + k];
CustomData_copy_data(&mesh->pdata, &result->pdata, k, p_skip * totpoly + k, 1);
*poly = *inMP;
poly->loopstart += p_skip * totloop;
poly = in_poly;
poly.loopstart += p_skip * totloop;
{
const MLoop *inML = &orig_loops[inMP->loopstart];
MLoop *ml = &loops[poly->loopstart];
int j = poly->totloop;
const MLoop *inML = &orig_loops[in_poly.loopstart];
MLoop *ml = &loops[poly.loopstart];
int j = poly.totloop;
CustomData_copy_data(&mesh->ldata, &result->ldata, inMP->loopstart, poly->loopstart, j);
CustomData_copy_data(&mesh->ldata, &result->ldata, in_poly.loopstart, poly.loopstart, j);
for (; j; j--, ml++, inML++) {
ml->v = inML->v + (p_skip * totvert);
ml->e = inML->e + (p_skip * totedge);