Cleanup: int/short to bool in BKE_cdderivedmesh.h functions (and TRUE/FALSE to true/false in code using them).
This commit is contained in:
@@ -52,10 +52,10 @@ struct DerivedMesh *CDDM_new(int numVerts, int numEdges, int numFaces,
|
||||
* data to not overwrite the original */
|
||||
struct DerivedMesh *CDDM_from_mesh(struct Mesh *mesh);
|
||||
|
||||
struct DerivedMesh *CDDM_from_bmesh(struct BMesh *bm, int use_mdisps);
|
||||
struct DerivedMesh *CDDM_from_bmesh(struct BMesh *bm, const bool use_mdisps);
|
||||
|
||||
/* creates a CDDerivedMesh from the given BMEditMesh */
|
||||
DerivedMesh *CDDM_from_editbmesh(struct BMEditMesh *em, int use_mdisps, int use_tessface);
|
||||
DerivedMesh *CDDM_from_editbmesh(struct BMEditMesh *em, const bool use_mdisps, const bool use_tessface);
|
||||
|
||||
/* merge verts */
|
||||
DerivedMesh *CDDM_merge_verts(DerivedMesh *dm, const int *vtargetmap, const int tot_vtargetmap);
|
||||
@@ -95,7 +95,7 @@ void CDDM_apply_vert_normals(struct DerivedMesh *cddm, short (*vertNormals)[3]);
|
||||
|
||||
/* recalculates vertex and face normals for a CDDerivedMesh
|
||||
*/
|
||||
void CDDM_calc_normals_mapping_ex(struct DerivedMesh *dm, const short only_face_normals);
|
||||
void CDDM_calc_normals_mapping_ex(struct DerivedMesh *dm, const bool only_face_normals);
|
||||
void CDDM_calc_normals_mapping(struct DerivedMesh *dm);
|
||||
void CDDM_calc_normals(struct DerivedMesh *dm);
|
||||
void CDDM_calc_normals_tessface(struct DerivedMesh *dm);
|
||||
@@ -112,7 +112,7 @@ void CDDM_calc_edges(struct DerivedMesh *dm);
|
||||
|
||||
/* reconstitute face triangulation */
|
||||
void CDDM_recalc_tessellation(struct DerivedMesh *dm);
|
||||
void CDDM_recalc_tessellation_ex(struct DerivedMesh *dm, const int do_face_nor_cpy);
|
||||
void CDDM_recalc_tessellation_ex(struct DerivedMesh *dm, const bool do_face_nor_cpy);
|
||||
|
||||
/* lowers the number of vertices/edges/faces in a CDDerivedMesh
|
||||
* the layer data stays the same size
|
||||
|
@@ -949,7 +949,7 @@ static DerivedMesh *create_orco_dm(Object *ob, Mesh *me, BMEditMesh *em, int lay
|
||||
float (*orco)[3];
|
||||
int free;
|
||||
|
||||
if (em) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
|
||||
if (em) dm = CDDM_from_editbmesh(em, false, false);
|
||||
else dm = CDDM_from_mesh(me);
|
||||
|
||||
orco = get_orco_coords_dm(ob, em, layer, &free);
|
||||
@@ -2062,7 +2062,7 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
|
||||
|
||||
}
|
||||
else {
|
||||
dm = CDDM_from_editbmesh(em, FALSE, FALSE);
|
||||
dm = CDDM_from_editbmesh(em, false, false);
|
||||
ASSERT_IS_VALID_DM(dm);
|
||||
|
||||
if (deformedVerts) {
|
||||
|
@@ -1665,7 +1665,7 @@ static void cdDM_foreachMappedFaceCenter(
|
||||
|
||||
}
|
||||
|
||||
void CDDM_recalc_tessellation_ex(DerivedMesh *dm, const int do_face_nor_cpy)
|
||||
void CDDM_recalc_tessellation_ex(DerivedMesh *dm, const bool do_face_nor_cpy)
|
||||
{
|
||||
CDDerivedMesh *cddm = (CDDerivedMesh *)dm;
|
||||
|
||||
@@ -1683,7 +1683,7 @@ void CDDM_recalc_tessellation_ex(DerivedMesh *dm, const int do_face_nor_cpy)
|
||||
|
||||
void CDDM_recalc_tessellation(DerivedMesh *dm)
|
||||
{
|
||||
CDDM_recalc_tessellation_ex(dm, TRUE);
|
||||
CDDM_recalc_tessellation_ex(dm, true);
|
||||
}
|
||||
|
||||
static void cdDM_free_internal(CDDerivedMesh *cddm)
|
||||
@@ -1945,9 +1945,9 @@ static void loops_to_customdata_corners(BMesh *bm, CustomData *facedata,
|
||||
}
|
||||
|
||||
/* used for both editbmesh and bmesh */
|
||||
static DerivedMesh *cddm_from_bmesh_ex(struct BMesh *bm, int use_mdisps,
|
||||
static DerivedMesh *cddm_from_bmesh_ex(struct BMesh *bm, const bool use_mdisps,
|
||||
/* EditBMesh vars for use_tessface */
|
||||
int use_tessface,
|
||||
const bool use_tessface,
|
||||
const int em_tottri, const BMLoop *(*em_looptris)[3]
|
||||
)
|
||||
{
|
||||
@@ -2110,14 +2110,14 @@ static DerivedMesh *cddm_from_bmesh_ex(struct BMesh *bm, int use_mdisps,
|
||||
return dm;
|
||||
}
|
||||
|
||||
struct DerivedMesh *CDDM_from_bmesh(struct BMesh *bm, int use_mdisps)
|
||||
struct DerivedMesh *CDDM_from_bmesh(struct BMesh *bm, const bool use_mdisps)
|
||||
{
|
||||
return cddm_from_bmesh_ex(bm, use_mdisps, FALSE,
|
||||
return cddm_from_bmesh_ex(bm, use_mdisps, false,
|
||||
/* these vars are for editmesh only */
|
||||
0, NULL);
|
||||
}
|
||||
|
||||
DerivedMesh *CDDM_from_editbmesh(BMEditMesh *em, int use_mdisps, int use_tessface)
|
||||
DerivedMesh *CDDM_from_editbmesh(BMEditMesh *em, const bool use_mdisps, const bool use_tessface)
|
||||
{
|
||||
return cddm_from_bmesh_ex(em->bm, use_mdisps,
|
||||
/* editmesh */
|
||||
@@ -2254,7 +2254,7 @@ void CDDM_apply_vert_normals(DerivedMesh *dm, short (*vertNormals)[3])
|
||||
cddm->dm.dirty &= ~DM_DIRTY_NORMALS;
|
||||
}
|
||||
|
||||
void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const short only_face_normals)
|
||||
void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const bool only_face_normals)
|
||||
{
|
||||
CDDerivedMesh *cddm = (CDDerivedMesh *)dm;
|
||||
float (*face_nors)[3] = NULL;
|
||||
@@ -2280,7 +2280,7 @@ void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const short only_face_normals
|
||||
* Important not to update face normals from polys since it
|
||||
* interferes with assigning the new normal layer in the following code.
|
||||
*/
|
||||
CDDM_recalc_tessellation_ex(dm, FALSE);
|
||||
CDDM_recalc_tessellation_ex(dm, false);
|
||||
}
|
||||
else {
|
||||
/* A tessellation already exists, it should always have a CD_ORIGINDEX */
|
||||
@@ -2306,7 +2306,7 @@ void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const short only_face_normals
|
||||
void CDDM_calc_normals_mapping(DerivedMesh *dm)
|
||||
{
|
||||
/* use this to skip calculating normals on original vert's, this may need to be changed */
|
||||
const short only_face_normals = CustomData_is_referenced_layer(&dm->vertData, CD_MVERT);
|
||||
const bool only_face_normals = CustomData_is_referenced_layer(&dm->vertData, CD_MVERT);
|
||||
|
||||
CDDM_calc_normals_mapping_ex(dm, only_face_normals);
|
||||
}
|
||||
|
@@ -366,7 +366,7 @@ static void contarget_get_mesh_mat(Object *ob, const char *substring, float mat[
|
||||
/* get DerivedMesh */
|
||||
if (em) {
|
||||
/* target is in editmode, so get a special derived mesh */
|
||||
dm = CDDM_from_editbmesh(em, FALSE, FALSE);
|
||||
dm = CDDM_from_editbmesh(em, false, false);
|
||||
freeDM = 1;
|
||||
}
|
||||
else {
|
||||
|
@@ -399,7 +399,7 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, Object *ob, B
|
||||
smd.levels = smd_real->levels;
|
||||
smd.subdivType = smd_real->subdivType;
|
||||
|
||||
initialDerived = CDDM_from_editbmesh(em, FALSE, FALSE);
|
||||
initialDerived = CDDM_from_editbmesh(em, false, false);
|
||||
derivedMesh = subsurf_make_derived_from_derived(initialDerived, &smd,
|
||||
NULL, SUBSURF_IN_EDIT_MODE);
|
||||
|
||||
|
@@ -141,7 +141,7 @@ static void deformVertsEM(
|
||||
ArmatureModifierData *amd = (ArmatureModifierData *) md;
|
||||
DerivedMesh *dm = derivedData;
|
||||
|
||||
if (!derivedData) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
|
||||
if (!derivedData) dm = CDDM_from_editbmesh(em, false, false);
|
||||
|
||||
modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
|
||||
|
||||
@@ -165,7 +165,7 @@ static void deformMatricesEM(
|
||||
ArmatureModifierData *amd = (ArmatureModifierData *) md;
|
||||
DerivedMesh *dm = derivedData;
|
||||
|
||||
if (!derivedData) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
|
||||
if (!derivedData) dm = CDDM_from_editbmesh(em, false, false);
|
||||
|
||||
armature_deform_verts(amd->object, ob, dm, vertexCos, defMats, numVerts,
|
||||
amd->deformflag, NULL, amd->defgrp_name);
|
||||
|
@@ -549,7 +549,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
|
||||
/* Bump the stack level back down to match the adjustment up above */
|
||||
BMO_pop(bm);
|
||||
|
||||
result = CDDM_from_bmesh(bm, FALSE);
|
||||
result = CDDM_from_bmesh(bm, false);
|
||||
|
||||
if ((dm->dirty & DM_DIRTY_NORMALS) ||
|
||||
((amd->offset_type & MOD_ARR_OFF_OBJ) && (amd->offset_ob)))
|
||||
|
@@ -165,7 +165,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob,
|
||||
vertex_only, bmd->lim_flags & MOD_BEVEL_WEIGHT, do_clamp,
|
||||
dvert, vgroup);
|
||||
|
||||
result = CDDM_from_bmesh(bm, TRUE);
|
||||
result = CDDM_from_bmesh(bm, true);
|
||||
|
||||
BLI_assert(bm->vtoolflagpool == NULL &&
|
||||
bm->etoolflagpool == NULL &&
|
||||
|
@@ -130,7 +130,7 @@ static void deformVertsEM(
|
||||
{
|
||||
DerivedMesh *dm = derivedData;
|
||||
|
||||
if (!derivedData) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
|
||||
if (!derivedData) dm = CDDM_from_editbmesh(em, false, false);
|
||||
|
||||
deformVerts(md, ob, dm, vertexCos, numVerts, 0);
|
||||
|
||||
|
@@ -191,7 +191,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
||||
|
||||
/* update for display only */
|
||||
dmd->face_count = bm->totface;
|
||||
result = CDDM_from_bmesh(bm, FALSE);
|
||||
result = CDDM_from_bmesh(bm, false);
|
||||
BLI_assert(bm->vtoolflagpool == NULL &&
|
||||
bm->etoolflagpool == NULL &&
|
||||
bm->ftoolflagpool == NULL); /* make sure we never alloc'd these */
|
||||
|
@@ -95,7 +95,7 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd)
|
||||
|
||||
/* BM_mesh_validate(bm); */ /* for troubleshooting */
|
||||
|
||||
result = CDDM_from_bmesh(bm, TRUE);
|
||||
result = CDDM_from_bmesh(bm, true);
|
||||
BM_mesh_free(bm);
|
||||
|
||||
result->dirty |= DM_DIRTY_NORMALS;
|
||||
|
@@ -128,7 +128,7 @@ static void deformVertsEM(
|
||||
{
|
||||
DerivedMesh *dm = derivedData;
|
||||
|
||||
if (!derivedData) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
|
||||
if (!derivedData) dm = CDDM_from_editbmesh(em, false, false);
|
||||
|
||||
deformVerts(md, ob, dm, vertexCos, numVerts, 0);
|
||||
|
||||
|
@@ -1787,7 +1787,7 @@ static DerivedMesh *base_skin(DerivedMesh *origdm,
|
||||
if (!bm)
|
||||
return NULL;
|
||||
|
||||
result = CDDM_from_bmesh(bm, FALSE);
|
||||
result = CDDM_from_bmesh(bm, false);
|
||||
BM_mesh_free(bm);
|
||||
|
||||
CDDM_calc_edges(result);
|
||||
|
@@ -47,7 +47,7 @@ static DerivedMesh *triangulate_dm(DerivedMesh *dm, const int quad_method, const
|
||||
|
||||
BM_mesh_triangulate(bm, quad_method, ngon_method, false, NULL, NULL);
|
||||
|
||||
result = CDDM_from_bmesh(bm, FALSE);
|
||||
result = CDDM_from_bmesh(bm, false);
|
||||
BM_mesh_free(bm);
|
||||
|
||||
total_edges = result->getNumEdges(result);
|
||||
|
@@ -183,7 +183,7 @@ DerivedMesh *get_dm(Object *ob, struct BMEditMesh *em, DerivedMesh *dm,
|
||||
/* pass */
|
||||
}
|
||||
else if (ob->type == OB_MESH) {
|
||||
if (em) dm = CDDM_from_editbmesh(em, FALSE, FALSE);
|
||||
if (em) dm = CDDM_from_editbmesh(em, false, false);
|
||||
else dm = CDDM_from_mesh((struct Mesh *)(ob->data));
|
||||
|
||||
if (vertexCos) {
|
||||
|
@@ -334,7 +334,7 @@ static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *em,
|
||||
|
||||
if (use_dm) {
|
||||
if (!derivedData)
|
||||
dm = CDDM_from_editbmesh(em, FALSE, FALSE);
|
||||
dm = CDDM_from_editbmesh(em, false, false);
|
||||
}
|
||||
|
||||
deformVerts(md, ob, dm, vertexCos, numVerts, 0);
|
||||
|
@@ -471,7 +471,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
|
||||
else if (obr->type == OB_MESH) {
|
||||
Mesh *me = (Mesh *)obr->data;
|
||||
if (me->edit_btmesh)
|
||||
target_dm = CDDM_from_editbmesh(me->edit_btmesh, FALSE, FALSE);
|
||||
target_dm = CDDM_from_editbmesh(me->edit_btmesh, false, false);
|
||||
else
|
||||
target_dm = CDDM_from_mesh(me);
|
||||
}
|
||||
|
Reference in New Issue
Block a user