Cleanup: More typed allocation type enum usage
Majority of the code is EOL, but still handy for debug purposes.
This commit is contained in:
parent
b54cc68365
commit
301a27187c
|
@ -398,19 +398,19 @@ void DM_set_only_copy(DerivedMesh *dm, CustomDataMask mask);
|
|||
* freed, see BKE_customdata.h for the different options
|
||||
*/
|
||||
void DM_add_vert_layer(
|
||||
struct DerivedMesh *dm, int type, int alloctype,
|
||||
struct DerivedMesh *dm, int type, CDAllocType alloctype,
|
||||
void *layer);
|
||||
void DM_add_edge_layer(
|
||||
struct DerivedMesh *dm, int type, int alloctype,
|
||||
struct DerivedMesh *dm, int type, CDAllocType alloctype,
|
||||
void *layer);
|
||||
void DM_add_tessface_layer(
|
||||
struct DerivedMesh *dm, int type, int alloctype,
|
||||
struct DerivedMesh *dm, int type, CDAllocType alloctype,
|
||||
void *layer);
|
||||
void DM_add_loop_layer(
|
||||
DerivedMesh *dm, int type, int alloctype,
|
||||
DerivedMesh *dm, int type, CDAllocType alloctype,
|
||||
void *layer);
|
||||
void DM_add_poly_layer(
|
||||
struct DerivedMesh *dm, int type, int alloctype,
|
||||
struct DerivedMesh *dm, int type, CDAllocType alloctype,
|
||||
void *layer);
|
||||
|
||||
/* custom data access functions
|
||||
|
|
|
@ -55,7 +55,7 @@ struct DerivedMesh *CDDM_new(int numVerts, int numEdges, int numFaces,
|
|||
struct DerivedMesh *CDDM_from_mesh(struct Mesh *mesh);
|
||||
|
||||
/* creates a CDDerivedMesh from the given Mesh with custom allocation type. */
|
||||
struct DerivedMesh *CDDM_from_mesh_ex(struct Mesh *mesh, int alloctype, CustomDataMask mask);
|
||||
struct DerivedMesh *CDDM_from_mesh_ex(struct Mesh *mesh, CDAllocType alloctype, CustomDataMask mask);
|
||||
|
||||
|
||||
struct DerivedMesh *CDDM_from_bmesh(struct BMesh *bm, const bool use_mdisps);
|
||||
|
|
|
@ -716,7 +716,7 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob, CustomDataMask mask, bool
|
|||
Mesh tmp = *me;
|
||||
int totvert, totedge /*, totface */ /* UNUSED */, totloop, totpoly;
|
||||
int did_shapekeys = 0;
|
||||
int alloctype = CD_DUPLICATE;
|
||||
CDAllocType alloctype = CD_DUPLICATE;
|
||||
|
||||
if (take_ownership && dm->type == DM_TYPE_CDDM && dm->needsFree) {
|
||||
bool has_any_referenced_layers =
|
||||
|
@ -911,27 +911,27 @@ static void mesh_set_only_copy(Mesh *mesh, CustomDataMask mask)
|
|||
#endif
|
||||
}
|
||||
|
||||
void DM_add_vert_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
|
||||
void DM_add_vert_layer(DerivedMesh *dm, int type, CDAllocType alloctype, void *layer)
|
||||
{
|
||||
CustomData_add_layer(&dm->vertData, type, alloctype, layer, dm->numVertData);
|
||||
}
|
||||
|
||||
void DM_add_edge_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
|
||||
void DM_add_edge_layer(DerivedMesh *dm, int type, CDAllocType alloctype, void *layer)
|
||||
{
|
||||
CustomData_add_layer(&dm->edgeData, type, alloctype, layer, dm->numEdgeData);
|
||||
}
|
||||
|
||||
void DM_add_tessface_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
|
||||
void DM_add_tessface_layer(DerivedMesh *dm, int type, CDAllocType alloctype, void *layer)
|
||||
{
|
||||
CustomData_add_layer(&dm->faceData, type, alloctype, layer, dm->numTessFaceData);
|
||||
}
|
||||
|
||||
void DM_add_loop_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
|
||||
void DM_add_loop_layer(DerivedMesh *dm, int type, CDAllocType alloctype, void *layer)
|
||||
{
|
||||
CustomData_add_layer(&dm->loopData, type, alloctype, layer, dm->numLoopData);
|
||||
}
|
||||
|
||||
void DM_add_poly_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
|
||||
void DM_add_poly_layer(DerivedMesh *dm, int type, CDAllocType alloctype, void *layer)
|
||||
{
|
||||
CustomData_add_layer(&dm->polyData, type, alloctype, layer, dm->numPolyData);
|
||||
}
|
||||
|
|
|
@ -597,7 +597,7 @@ DerivedMesh *CDDM_from_mesh(Mesh *mesh)
|
|||
return CDDM_from_mesh_ex(mesh, CD_REFERENCE, CD_MASK_MESH);
|
||||
}
|
||||
|
||||
DerivedMesh *CDDM_from_mesh_ex(Mesh *mesh, int alloctype, CustomDataMask mask)
|
||||
DerivedMesh *CDDM_from_mesh_ex(Mesh *mesh, CDAllocType alloctype, CustomDataMask mask)
|
||||
{
|
||||
CDDerivedMesh *cddm = cdDM_create(__func__);
|
||||
DerivedMesh *dm = &cddm->dm;
|
||||
|
|
Loading…
Reference in New Issue