diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-30 02:32:44 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-30 02:32:44 +0300 |
commit | 1c1dc5f8440d918aca480904c53e31a528aef42f (patch) | |
tree | 86e44149f759960a2ccf118463b12a1aae00cce4 /source/blender/blenkernel | |
parent | 7db79feecd657039f3e97e2ef6445400070ab42f (diff) |
Cleanup: Move files that use mesh runtime data to C++
In preparation for moving the mesh runtime struct out of DNA.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_editmesh.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/editmesh.cc (renamed from source/blender/blenkernel/intern/editmesh.c) | 106 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_iterators.cc (renamed from source/blender/blenkernel/intern/mesh_iterators.c) | 77 |
4 files changed, 92 insertions, 97 deletions
diff --git a/source/blender/blenkernel/BKE_editmesh.h b/source/blender/blenkernel/BKE_editmesh.h index 5916e7e83fb..dbfc9fd0799 100644 --- a/source/blender/blenkernel/BKE_editmesh.h +++ b/source/blender/blenkernel/BKE_editmesh.h @@ -69,7 +69,7 @@ typedef struct BMEditMesh { } BMEditMesh; -/* editmesh.c */ +/* editmesh.cc */ void BKE_editmesh_looptri_calc_ex(BMEditMesh *em, const struct BMeshCalcTessellation_Params *params); diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 4c5deead9d4..627e34be424 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -125,7 +125,7 @@ set(SRC intern/displist.cc intern/dynamicpaint.c intern/editlattice.c - intern/editmesh.c + intern/editmesh.cc intern/editmesh_bvh.c intern/editmesh_cache.cc intern/editmesh_tangent.cc @@ -199,7 +199,7 @@ set(SRC intern/mesh_debug.cc intern/mesh_evaluate.cc intern/mesh_fair.cc - intern/mesh_iterators.c + intern/mesh_iterators.cc intern/mesh_legacy_convert.cc intern/mesh_mapping.cc intern/mesh_merge.c diff --git a/source/blender/blenkernel/intern/editmesh.c b/source/blender/blenkernel/intern/editmesh.cc index a952da6fa52..deca24afc0f 100644 --- a/source/blender/blenkernel/intern/editmesh.c +++ b/source/blender/blenkernel/intern/editmesh.cc @@ -28,14 +28,14 @@ BMEditMesh *BKE_editmesh_create(BMesh *bm) { - BMEditMesh *em = MEM_callocN(sizeof(BMEditMesh), __func__); + BMEditMesh *em = MEM_cnew<BMEditMesh>(__func__); em->bm = bm; return em; } BMEditMesh *BKE_editmesh_copy(BMEditMesh *em) { - BMEditMesh *em_copy = MEM_callocN(sizeof(BMEditMesh), __func__); + BMEditMesh *em_copy = MEM_cnew<BMEditMesh>(__func__); *em_copy = *em; em_copy->bm = BM_mesh_copy(em->bm); @@ -46,7 +46,7 @@ BMEditMesh *BKE_editmesh_copy(BMEditMesh *em) * it in the case of errors in an operation. For performance reasons, * in that case it makes more sense to do the * tessellation only when/if that copy ends up getting used. */ - em_copy->looptris = NULL; + em_copy->looptris = nullptr; /* Copy various settings. */ em_copy->selectmode = em->selectmode; @@ -70,7 +70,7 @@ BMEditMesh *BKE_editmesh_from_object(Object *ob) } static void editmesh_tessface_calc_intern(BMEditMesh *em, - const struct BMeshCalcTessellation_Params *params) + const BMeshCalcTessellation_Params *params) { /* allocating space before calculating the tessellation */ @@ -86,7 +86,7 @@ static void editmesh_tessface_calc_intern(BMEditMesh *em, BMLoop *(*looptris)[3]; /* this means no reallocs for quad dominant models, for */ - if ((em->looptris != NULL) && + if ((em->looptris != nullptr) && /* (*em->tottri >= looptris_tot)) */ /* Check against allocated size in case we over allocated a little. */ ((looptris_tot_prev_alloc >= looptris_tot) && @@ -97,7 +97,8 @@ static void editmesh_tessface_calc_intern(BMEditMesh *em, if (em->looptris) { MEM_freeN(em->looptris); } - looptris = MEM_mallocN(sizeof(*looptris) * looptris_tot, __func__); + looptris = static_cast<BMLoop *(*)[3]>( + MEM_mallocN(sizeof(*looptris) * looptris_tot, __func__)); } em->looptris = looptris; @@ -107,8 +108,7 @@ static void editmesh_tessface_calc_intern(BMEditMesh *em, BM_mesh_calc_tessellation_ex(em->bm, em->looptris, params); } -void BKE_editmesh_looptri_calc_ex(BMEditMesh *em, - const struct BMeshCalcTessellation_Params *params) +void BKE_editmesh_looptri_calc_ex(BMEditMesh *em, const BMeshCalcTessellation_Params *params) { editmesh_tessface_calc_intern(em, params); @@ -126,56 +126,46 @@ void BKE_editmesh_looptri_calc_ex(BMEditMesh *em, void BKE_editmesh_looptri_calc(BMEditMesh *em) { - BKE_editmesh_looptri_calc_ex(em, - &(const struct BMeshCalcTessellation_Params){ - .face_normals = false, - }); + BMeshCalcTessellation_Params params{}; + params.face_normals = false; + BKE_editmesh_looptri_calc_ex(em, ¶ms); } void BKE_editmesh_looptri_and_normals_calc(BMEditMesh *em) { - BKE_editmesh_looptri_calc_ex(em, - &(const struct BMeshCalcTessellation_Params){ - .face_normals = true, - }); - BM_mesh_normals_update_ex(em->bm, - &(const struct BMeshNormalsUpdate_Params){ - .face_normals = false, - }); + BMeshCalcTessellation_Params looptri_params{}; + looptri_params.face_normals = true; + BKE_editmesh_looptri_calc_ex(em, &looptri_params); + BMeshNormalsUpdate_Params normals_params{}; + normals_params.face_normals = false; + BM_mesh_normals_update_ex(em->bm, &normals_params); } void BKE_editmesh_looptri_calc_with_partial_ex(BMEditMesh *em, - struct BMPartialUpdate *bmpinfo, - const struct BMeshCalcTessellation_Params *params) + BMPartialUpdate *bmpinfo, + const BMeshCalcTessellation_Params *params) { BLI_assert(em->tottri == poly_to_tri_count(em->bm->totface, em->bm->totloop)); - BLI_assert(em->looptris != NULL); + BLI_assert(em->looptris != nullptr); BM_mesh_calc_tessellation_with_partial_ex(em->bm, em->looptris, bmpinfo, params); } -void BKE_editmesh_looptri_calc_with_partial(BMEditMesh *em, struct BMPartialUpdate *bmpinfo) +void BKE_editmesh_looptri_calc_with_partial(BMEditMesh *em, BMPartialUpdate *bmpinfo) { - BKE_editmesh_looptri_calc_with_partial_ex(em, - bmpinfo, - &(const struct BMeshCalcTessellation_Params){ - .face_normals = false, - }); + BMeshCalcTessellation_Params looptri_params{}; + looptri_params.face_normals = false; + BKE_editmesh_looptri_calc_with_partial_ex(em, bmpinfo, &looptri_params); } -void BKE_editmesh_looptri_and_normals_calc_with_partial(BMEditMesh *em, - struct BMPartialUpdate *bmpinfo) +void BKE_editmesh_looptri_and_normals_calc_with_partial(BMEditMesh *em, BMPartialUpdate *bmpinfo) { - BKE_editmesh_looptri_calc_with_partial_ex(em, - bmpinfo, - &(const struct BMeshCalcTessellation_Params){ - .face_normals = true, - }); - BM_mesh_normals_update_with_partial_ex(em->bm, - bmpinfo, - &(const struct BMeshNormalsUpdate_Params){ - .face_normals = false, - }); + BMeshCalcTessellation_Params looptri_params{}; + looptri_params.face_normals = true; + BKE_editmesh_looptri_calc_with_partial_ex(em, bmpinfo, &looptri_params); + BMeshNormalsUpdate_Params normals_params{}; + normals_params.face_normals = false; + BM_mesh_normals_update_with_partial_ex(em->bm, bmpinfo, &normals_params); } void BKE_editmesh_free_data(BMEditMesh *em) @@ -201,7 +191,7 @@ static void cage_mapped_verts_callback(void *userData, const float co[3], const float UNUSED(no[3])) { - struct CageUserData *data = userData; + CageUserData *data = static_cast<CageUserData *>(userData); if ((index >= 0 && index < data->totvert) && (!BLI_BITMAP_TEST(data->visit_bitmap, index))) { BLI_BITMAP_ENABLE(data->visit_bitmap, index); @@ -209,20 +199,18 @@ static void cage_mapped_verts_callback(void *userData, } } -float (*BKE_editmesh_vert_coords_alloc(struct Depsgraph *depsgraph, - BMEditMesh *em, - struct Scene *scene, - Object *ob, - int *r_vert_len))[3] +float (*BKE_editmesh_vert_coords_alloc( + Depsgraph *depsgraph, BMEditMesh *em, Scene *scene, Object *ob, int *r_vert_len))[3] { Mesh *cage = editbmesh_get_eval_cage(depsgraph, scene, ob, em, &CD_MASK_BAREMESH); - float(*cos_cage)[3] = MEM_callocN(sizeof(*cos_cage) * em->bm->totvert, "bmbvh cos_cage"); + float(*cos_cage)[3] = static_cast<float(*)[3]>( + MEM_callocN(sizeof(*cos_cage) * em->bm->totvert, __func__)); /* When initializing cage verts, we only want the first cage coordinate for each vertex, * so that e.g. mirror or array use original vertex coordinates and not mirrored or duplicate. */ BLI_bitmap *visit_bitmap = BLI_BITMAP_NEW(em->bm->totvert, __func__); - struct CageUserData data; + CageUserData data; data.totvert = em->bm->totvert; data.cos_cage = cos_cage; data.visit_bitmap = visit_bitmap; @@ -238,27 +226,27 @@ float (*BKE_editmesh_vert_coords_alloc(struct Depsgraph *depsgraph, return cos_cage; } -const float (*BKE_editmesh_vert_coords_when_deformed(struct Depsgraph *depsgraph, +const float (*BKE_editmesh_vert_coords_when_deformed(Depsgraph *depsgraph, BMEditMesh *em, - struct Scene *scene, + Scene *scene, Object *ob, int *r_vert_len, bool *r_is_alloc))[3] { - const float(*coords)[3] = NULL; + const float(*coords)[3] = nullptr; *r_is_alloc = false; - Mesh *me = ob->data; + Mesh *me = static_cast<Mesh *>(ob->data); Object *object_eval = DEG_get_evaluated_object(depsgraph, ob); Mesh *editmesh_eval_final = BKE_object_get_editmesh_eval_final(object_eval); - if ((me->runtime.edit_data != NULL) && (me->runtime.edit_data->vertexCos != NULL)) { + if ((me->runtime.edit_data != nullptr) && (me->runtime.edit_data->vertexCos != nullptr)) { /* Deformed, and we have deformed coords already. */ coords = me->runtime.edit_data->vertexCos; } - else if ((editmesh_eval_final != NULL) && + else if ((editmesh_eval_final != nullptr) && (editmesh_eval_final->runtime.wrapper_type == ME_WRAPPER_TYPE_BMESH)) { - /* If this is an edit-mesh type, leave NULL as we can use the vertex coords. */ + /* If this is an edit-mesh type, leave nullptr as we can use the vertex coords. */ } else { /* Constructive modifiers have been used, we need to allocate coordinates. */ @@ -302,16 +290,16 @@ void BKE_editmesh_ensure_autosmooth(BMEditMesh *em, Mesh *me) } } -BoundBox *BKE_editmesh_cage_boundbox_get(struct Object *object, BMEditMesh *UNUSED(em)) +BoundBox *BKE_editmesh_cage_boundbox_get(Object *object, BMEditMesh *UNUSED(em)) { - if (object->runtime.editmesh_bb_cage == NULL) { + if (object->runtime.editmesh_bb_cage == nullptr) { float min[3], max[3]; INIT_MINMAX(min, max); if (object->runtime.editmesh_eval_cage) { BKE_mesh_wrapper_minmax(object->runtime.editmesh_eval_cage, min, max); } - object->runtime.editmesh_bb_cage = MEM_callocN(sizeof(BoundBox), "BMEditMesh.bb_cage"); + object->runtime.editmesh_bb_cage = MEM_cnew<BoundBox>("BMEditMesh.bb_cage"); BKE_boundbox_init_from_minmax(object->runtime.editmesh_bb_cage, min, max); } diff --git a/source/blender/blenkernel/intern/mesh_iterators.c b/source/blender/blenkernel/intern/mesh_iterators.cc index d3a7f6cc72f..281c84a3df5 100644 --- a/source/blender/blenkernel/intern/mesh_iterators.c +++ b/source/blender/blenkernel/intern/mesh_iterators.cc @@ -36,13 +36,13 @@ void BKE_mesh_foreach_mapped_vert( void *userData, MeshForeachFlag flag) { - if (mesh->edit_mesh != NULL && mesh->runtime.edit_data != NULL) { + if (mesh->edit_mesh != nullptr && mesh->runtime.edit_data != nullptr) { BMEditMesh *em = mesh->edit_mesh; BMesh *bm = em->bm; BMIter iter; BMVert *eve; int i; - if (mesh->runtime.edit_data->vertexCos != NULL) { + if (mesh->runtime.edit_data->vertexCos != nullptr) { const float(*vertexCos)[3] = mesh->runtime.edit_data->vertexCos; const float(*vertexNos)[3]; if (flag & MESH_FOREACH_USE_NORMAL) { @@ -50,30 +50,30 @@ void BKE_mesh_foreach_mapped_vert( vertexNos = mesh->runtime.edit_data->vertexNos; } else { - vertexNos = NULL; + vertexNos = nullptr; } BM_ITER_MESH_INDEX (eve, &iter, bm, BM_VERTS_OF_MESH, i) { - const float *no = (flag & MESH_FOREACH_USE_NORMAL) ? vertexNos[i] : NULL; + const float *no = (flag & MESH_FOREACH_USE_NORMAL) ? vertexNos[i] : nullptr; func(userData, i, vertexCos[i], no); } } else { BM_ITER_MESH_INDEX (eve, &iter, bm, BM_VERTS_OF_MESH, i) { - const float *no = (flag & MESH_FOREACH_USE_NORMAL) ? eve->no : NULL; + const float *no = (flag & MESH_FOREACH_USE_NORMAL) ? eve->no : nullptr; func(userData, i, eve->co, no); } } } else { const MVert *mv = BKE_mesh_verts(mesh); - const int *index = CustomData_get_layer(&mesh->vdata, CD_ORIGINDEX); + const int *index = static_cast<const int *>(CustomData_get_layer(&mesh->vdata, CD_ORIGINDEX)); const float(*vert_normals)[3] = (flag & MESH_FOREACH_USE_NORMAL) ? BKE_mesh_vertex_normals_ensure(mesh) : - NULL; + nullptr; if (index) { for (int i = 0; i < mesh->totvert; i++, mv++) { - const float *no = (flag & MESH_FOREACH_USE_NORMAL) ? vert_normals[i] : NULL; + const float *no = (flag & MESH_FOREACH_USE_NORMAL) ? vert_normals[i] : nullptr; const int orig = *index++; if (orig == ORIGINDEX_NONE) { continue; @@ -83,7 +83,7 @@ void BKE_mesh_foreach_mapped_vert( } else { for (int i = 0; i < mesh->totvert; i++, mv++) { - const float *no = (flag & MESH_FOREACH_USE_NORMAL) ? vert_normals[i] : NULL; + const float *no = (flag & MESH_FOREACH_USE_NORMAL) ? vert_normals[i] : nullptr; func(userData, i, mv->co, no); } } @@ -96,13 +96,13 @@ void BKE_mesh_foreach_mapped_edge( void (*func)(void *userData, int index, const float v0co[3], const float v1co[3]), void *userData) { - if (mesh->edit_mesh != NULL && mesh->runtime.edit_data) { + if (mesh->edit_mesh != nullptr && mesh->runtime.edit_data) { BMEditMesh *em = mesh->edit_mesh; BMesh *bm = em->bm; BMIter iter; BMEdge *eed; int i; - if (mesh->runtime.edit_data->vertexCos != NULL) { + if (mesh->runtime.edit_data->vertexCos != nullptr) { const float(*vertexCos)[3] = mesh->runtime.edit_data->vertexCos; BM_mesh_elem_index_ensure(bm, BM_VERT); @@ -122,7 +122,7 @@ void BKE_mesh_foreach_mapped_edge( else { const MVert *mv = BKE_mesh_verts(mesh); const MEdge *med = BKE_mesh_edges(mesh); - const int *index = CustomData_get_layer(&mesh->edata, CD_ORIGINDEX); + const int *index = static_cast<const int *>(CustomData_get_layer(&mesh->edata, CD_ORIGINDEX)); if (index) { for (int i = 0; i < mesh->totedge; i++, med++) { @@ -154,7 +154,7 @@ void BKE_mesh_foreach_mapped_loop(Mesh *mesh, /* We can't use dm->getLoopDataLayout(dm) here, * we want to always access dm->loopData, EditDerivedBMesh would * return loop data from bmesh itself. */ - if (mesh->edit_mesh != NULL && mesh->runtime.edit_data) { + if (mesh->edit_mesh != nullptr && mesh->runtime.edit_data) { BMEditMesh *em = mesh->edit_mesh; BMesh *bm = em->bm; BMIter iter; @@ -164,8 +164,9 @@ void BKE_mesh_foreach_mapped_loop(Mesh *mesh, /* XXX: investigate using EditMesh data. */ const float(*lnors)[3] = (flag & MESH_FOREACH_USE_NORMAL) ? - CustomData_get_layer(&mesh->ldata, CD_NORMAL) : - NULL; + static_cast<const float(*)[3]>( + CustomData_get_layer(&mesh->ldata, CD_NORMAL)) : + nullptr; int f_idx; @@ -178,21 +179,24 @@ void BKE_mesh_foreach_mapped_loop(Mesh *mesh, do { const BMVert *eve = l_iter->v; const int v_idx = BM_elem_index_get(eve); - const float *no = lnors ? *lnors++ : NULL; + const float *no = lnors ? *lnors++ : nullptr; func(userData, v_idx, f_idx, vertexCos ? vertexCos[v_idx] : eve->co, no); } while ((l_iter = l_iter->next) != l_first); } } else { const float(*lnors)[3] = (flag & MESH_FOREACH_USE_NORMAL) ? - CustomData_get_layer(&mesh->ldata, CD_NORMAL) : - NULL; + static_cast<const float(*)[3]>( + CustomData_get_layer(&mesh->ldata, CD_NORMAL)) : + nullptr; const MVert *mv = BKE_mesh_verts(mesh); const MLoop *ml = BKE_mesh_loops(mesh); const MPoly *mp = BKE_mesh_polys(mesh); - const int *v_index = CustomData_get_layer(&mesh->vdata, CD_ORIGINDEX); - const int *f_index = CustomData_get_layer(&mesh->pdata, CD_ORIGINDEX); + const int *v_index = static_cast<const int *>( + CustomData_get_layer(&mesh->vdata, CD_ORIGINDEX)); + const int *f_index = static_cast<const int *>( + CustomData_get_layer(&mesh->pdata, CD_ORIGINDEX)); int p_idx, i; if (v_index || f_index) { @@ -200,7 +204,7 @@ void BKE_mesh_foreach_mapped_loop(Mesh *mesh, for (i = 0; i < mp->totloop; i++, ml++) { const int v_idx = v_index ? v_index[ml->v] : ml->v; const int f_idx = f_index ? f_index[p_idx] : p_idx; - const float *no = lnors ? *lnors++ : NULL; + const float *no = lnors ? *lnors++ : nullptr; if (ELEM(ORIGINDEX_NONE, v_idx, f_idx)) { continue; } @@ -213,7 +217,7 @@ void BKE_mesh_foreach_mapped_loop(Mesh *mesh, for (i = 0; i < mp->totloop; i++, ml++) { const int v_idx = ml->v; const int f_idx = p_idx; - const float *no = lnors ? *lnors++ : NULL; + const float *no = lnors ? *lnors++ : nullptr; func(userData, v_idx, f_idx, mv[ml->v].co, no); } } @@ -227,7 +231,7 @@ void BKE_mesh_foreach_mapped_face_center( void *userData, MeshForeachFlag flag) { - if (mesh->edit_mesh != NULL && mesh->runtime.edit_data != NULL) { + if (mesh->edit_mesh != nullptr && mesh->runtime.edit_data != nullptr) { BMEditMesh *em = mesh->edit_mesh; BMesh *bm = em->bm; const float(*polyCos)[3]; @@ -241,10 +245,10 @@ void BKE_mesh_foreach_mapped_face_center( if (flag & MESH_FOREACH_USE_NORMAL) { BKE_editmesh_cache_ensure_poly_normals(em, mesh->runtime.edit_data); - polyNos = mesh->runtime.edit_data->polyNos; /* maybe NULL */ + polyNos = mesh->runtime.edit_data->polyNos; /* maybe nullptr */ } else { - polyNos = NULL; + polyNos = nullptr; } if (polyNos) { @@ -255,7 +259,7 @@ void BKE_mesh_foreach_mapped_face_center( } else { BM_ITER_MESH_INDEX (efa, &iter, bm, BM_FACES_OF_MESH, i) { - const float *no = (flag & MESH_FOREACH_USE_NORMAL) ? efa->no : NULL; + const float *no = (flag & MESH_FOREACH_USE_NORMAL) ? efa->no : nullptr; func(userData, i, polyCos[i], no); } } @@ -266,8 +270,8 @@ void BKE_mesh_foreach_mapped_face_center( const MLoop *loops = BKE_mesh_loops(mesh); const MLoop *ml; float _no_buf[3]; - float *no = (flag & MESH_FOREACH_USE_NORMAL) ? _no_buf : NULL; - const int *index = CustomData_get_layer(&mesh->pdata, CD_ORIGINDEX); + float *no = (flag & MESH_FOREACH_USE_NORMAL) ? _no_buf : nullptr; + const int *index = static_cast<const int *>(CustomData_get_layer(&mesh->pdata, CD_ORIGINDEX)); if (index) { for (int i = 0; i < mesh->totpoly; i++, mp++) { @@ -311,10 +315,10 @@ void BKE_mesh_foreach_mapped_subdiv_face_center( const MVert *mv; const float(*vert_normals)[3] = (flag & MESH_FOREACH_USE_NORMAL) ? BKE_mesh_vertex_normals_ensure(mesh) : - NULL; - const int *index = CustomData_get_layer(&mesh->pdata, CD_ORIGINDEX); + nullptr; + const int *index = static_cast<const int *>(CustomData_get_layer(&mesh->pdata, CD_ORIGINDEX)); const BLI_bitmap *facedot_tags = mesh->runtime.subsurf_face_dot_tags; - BLI_assert(facedot_tags != NULL); + BLI_assert(facedot_tags != nullptr); if (index) { for (int i = 0; i < mesh->totpoly; i++, mp++) { @@ -329,7 +333,7 @@ void BKE_mesh_foreach_mapped_subdiv_face_center( func(userData, orig, mv->co, - (flag & MESH_FOREACH_USE_NORMAL) ? vert_normals[ml->v] : NULL); + (flag & MESH_FOREACH_USE_NORMAL) ? vert_normals[ml->v] : nullptr); } } } @@ -340,7 +344,10 @@ void BKE_mesh_foreach_mapped_subdiv_face_center( for (int j = 0; j < mp->totloop; j++, ml++) { mv = &verts[ml->v]; if (BLI_BITMAP_TEST(facedot_tags, ml->v)) { - func(userData, i, mv->co, (flag & MESH_FOREACH_USE_NORMAL) ? vert_normals[ml->v] : NULL); + func(userData, + i, + mv->co, + (flag & MESH_FOREACH_USE_NORMAL) ? vert_normals[ml->v] : nullptr); } } } @@ -349,10 +356,10 @@ void BKE_mesh_foreach_mapped_subdiv_face_center( /* Helpers based on above foreach loopers> */ -typedef struct MappedVCosData { +struct MappedVCosData { float (*vertexcos)[3]; BLI_bitmap *vertex_visit; -} MappedVCosData; +}; static void get_vertexcos__mapFunc(void *user_data, int index, |