Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-09-19 06:32:36 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-09-19 06:33:44 +0300
commit86590b90aa78c7087a588275030a4f1490e37297 (patch)
tree560e5cdaf0ac15f2666d2163373e0292f4edb5d5 /source/blender/modifiers/intern/MOD_correctivesmooth.c
parentd8a7e5ee324ef4648a317ef232aae5b5a8ed991f (diff)
Cleanup: use uint,ushort,uchar for modifiers
Diffstat (limited to 'source/blender/modifiers/intern/MOD_correctivesmooth.c')
-rw-r--r--source/blender/modifiers/intern/MOD_correctivesmooth.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.c b/source/blender/modifiers/intern/MOD_correctivesmooth.c
index a234f468e45..fbf955abc98 100644
--- a/source/blender/modifiers/intern/MOD_correctivesmooth.c
+++ b/source/blender/modifiers/intern/MOD_correctivesmooth.c
@@ -117,11 +117,11 @@ static void requiredDataMask(Object *UNUSED(ob),
/* check individual weights for changes and cache values */
static void mesh_get_weights(MDeformVert *dvert,
const int defgrp_index,
- const unsigned int numVerts,
+ const uint numVerts,
const bool use_invert_vgroup,
float *smooth_weights)
{
- unsigned int i;
+ uint i;
for (i = 0; i < numVerts; i++, dvert++) {
const float w = defvert_find_weight(dvert, defgrp_index);
@@ -140,11 +140,11 @@ static void mesh_get_boundaries(Mesh *mesh, float *smooth_weights)
const MPoly *mpoly = mesh->mpoly;
const MLoop *mloop = mesh->mloop;
const MEdge *medge = mesh->medge;
- unsigned int mpoly_num, medge_num, i;
- unsigned short *boundaries;
+ uint mpoly_num, medge_num, i;
+ ushort *boundaries;
- mpoly_num = (unsigned int)mesh->totpoly;
- medge_num = (unsigned int)mesh->totedge;
+ mpoly_num = (uint)mesh->totpoly;
+ medge_num = (uint)mesh->totedge;
boundaries = MEM_calloc_arrayN(medge_num, sizeof(*boundaries), __func__);
@@ -176,14 +176,14 @@ static void mesh_get_boundaries(Mesh *mesh, float *smooth_weights)
static void smooth_iter__simple(CorrectiveSmoothModifierData *csmd,
Mesh *mesh,
float (*vertexCos)[3],
- unsigned int numVerts,
+ uint numVerts,
const float *smooth_weights,
- unsigned int iterations)
+ uint iterations)
{
const float lambda = csmd->lambda;
- unsigned int i;
+ uint i;
- const unsigned int numEdges = (unsigned int)mesh->totedge;
+ const uint numEdges = (uint)mesh->totedge;
const MEdge *edges = mesh->medge;
float *vertex_edge_count_div;
@@ -252,18 +252,18 @@ static void smooth_iter__simple(CorrectiveSmoothModifierData *csmd,
static void smooth_iter__length_weight(CorrectiveSmoothModifierData *csmd,
Mesh *mesh,
float (*vertexCos)[3],
- unsigned int numVerts,
+ uint numVerts,
const float *smooth_weights,
- unsigned int iterations)
+ uint iterations)
{
const float eps = FLT_EPSILON * 10.0f;
- const unsigned int numEdges = (unsigned int)mesh->totedge;
+ const uint numEdges = (uint)mesh->totedge;
/* note: the way this smoothing method works, its approx half as strong as the simple-smooth,
* and 2.0 rarely spikes, double the value for consistent behavior. */
const float lambda = csmd->lambda * 2.0f;
const MEdge *edges = mesh->medge;
float *vertex_edge_count;
- unsigned int i;
+ uint i;
struct SmoothingData_Weighted {
float delta[3];
@@ -346,9 +346,9 @@ static void smooth_iter__length_weight(CorrectiveSmoothModifierData *csmd,
static void smooth_iter(CorrectiveSmoothModifierData *csmd,
Mesh *mesh,
float (*vertexCos)[3],
- unsigned int numVerts,
+ uint numVerts,
const float *smooth_weights,
- unsigned int iterations)
+ uint iterations)
{
switch (csmd->smooth_type) {
case MOD_CORRECTIVESMOOTH_SMOOTH_LENGTH_WEIGHT:
@@ -367,7 +367,7 @@ static void smooth_verts(CorrectiveSmoothModifierData *csmd,
MDeformVert *dvert,
const int defgrp_index,
float (*vertexCos)[3],
- unsigned int numVerts)
+ uint numVerts)
{
float *smooth_weights = NULL;
@@ -391,7 +391,7 @@ static void smooth_verts(CorrectiveSmoothModifierData *csmd,
}
}
- smooth_iter(csmd, mesh, vertexCos, numVerts, smooth_weights, (unsigned int)csmd->repeat);
+ smooth_iter(csmd, mesh, vertexCos, numVerts, smooth_weights, (uint)csmd->repeat);
if (smooth_weights) {
MEM_freeN(smooth_weights);
@@ -454,13 +454,13 @@ static void calc_tangent_loop_accum(const float v_dir_prev[3],
static void calc_tangent_spaces(Mesh *mesh, float (*vertexCos)[3], float (*r_tangent_spaces)[3][3])
{
- const unsigned int mpoly_num = (unsigned int)mesh->totpoly;
+ const uint mpoly_num = (uint)mesh->totpoly;
#ifndef USE_TANGENT_CALC_INLINE
- const unsigned int mvert_num = (unsigned int)dm->getNumVerts(dm);
+ const uint mvert_num = (uint)dm->getNumVerts(dm);
#endif
const MPoly *mpoly = mesh->mpoly;
const MLoop *mloop = mesh->mloop;
- unsigned int i;
+ uint i;
for (i = 0; i < mpoly_num; i++) {
const MPoly *mp = &mpoly[i];
@@ -511,11 +511,11 @@ static void calc_deltas(CorrectiveSmoothModifierData *csmd,
MDeformVert *dvert,
const int defgrp_index,
const float (*rest_coords)[3],
- unsigned int numVerts)
+ uint numVerts)
{
float(*smooth_vertex_coords)[3] = MEM_dupallocN(rest_coords);
float(*tangent_spaces)[3][3];
- unsigned int i;
+ uint i;
tangent_spaces = MEM_calloc_arrayN(numVerts, sizeof(float[3][3]), __func__);
@@ -556,7 +556,7 @@ static void correctivesmooth_modifier_do(ModifierData *md,
Object *ob,
Mesh *mesh,
float (*vertexCos)[3],
- unsigned int numVerts,
+ uint numVerts,
struct BMEditMesh *em)
{
CorrectiveSmoothModifierData *csmd = (CorrectiveSmoothModifierData *)md;
@@ -575,7 +575,7 @@ static void correctivesmooth_modifier_do(ModifierData *md,
/* if rest bind_coords not are defined, set them (only run during bind) */
if ((csmd->rest_source == MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND) &&
/* signal to recalculate, whoever sets MUST also free bind coords */
- (csmd->bind_coords_num == (unsigned int)-1)) {
+ (csmd->bind_coords_num == (uint)-1)) {
if (DEG_is_active(depsgraph)) {
BLI_assert(csmd->bind_coords == NULL);
csmd->bind_coords = MEM_dupallocN(vertexCos);
@@ -617,8 +617,7 @@ static void correctivesmooth_modifier_do(ModifierData *md,
goto error;
}
else {
- unsigned int me_numVerts = (unsigned int)((em) ? em->bm->totvert :
- ((Mesh *)ob->data)->totvert);
+ uint me_numVerts = (uint)((em) ? em->bm->totvert : ((Mesh *)ob->data)->totvert);
if (me_numVerts != numVerts) {
modifier_setError(md, "Original vertex count mismatch: %u to %u", me_numVerts, numVerts);
@@ -642,7 +641,7 @@ static void correctivesmooth_modifier_do(ModifierData *md,
rest_coords = em ? BKE_editmesh_vert_coords_alloc_orco(em, &me_numVerts) :
BKE_mesh_vert_coords_alloc(ob->data, &me_numVerts);
- BLI_assert((unsigned int)me_numVerts == numVerts);
+ BLI_assert((uint)me_numVerts == numVerts);
is_rest_coords_alloc = true;
}
@@ -673,7 +672,7 @@ static void correctivesmooth_modifier_do(ModifierData *md,
smooth_verts(csmd, mesh, dvert, defgrp_index, vertexCos, numVerts);
{
- unsigned int i;
+ uint i;
float(*tangent_spaces)[3][3];
@@ -717,7 +716,7 @@ static void deformVerts(ModifierData *md,
Mesh *mesh_src = MOD_deform_mesh_eval_get(ctx->object, NULL, mesh, NULL, numVerts, false, false);
correctivesmooth_modifier_do(
- md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (unsigned int)numVerts, NULL);
+ md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (uint)numVerts, NULL);
if (mesh_src != mesh) {
BKE_id_free(NULL, mesh_src);
@@ -735,7 +734,7 @@ static void deformVertsEM(ModifierData *md,
ctx->object, editData, mesh, NULL, numVerts, false, false);
correctivesmooth_modifier_do(
- md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (unsigned int)numVerts, editData);
+ md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (uint)numVerts, editData);
if (mesh_src != mesh) {
BKE_id_free(NULL, mesh_src);