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:
authorJacques Lucke <jacques@blender.org>2020-09-09 16:43:09 +0300
committerJacques Lucke <jacques@blender.org>2020-09-09 16:43:27 +0300
commitddf4f2896878e3fd4a0f79d712a5e7b900b0cf7e (patch)
tree34d7b7b95eac92c2ab9bc596b1dd113fd2334381 /source/blender/blenkernel/intern/cloth.c
parent842f52d418aaccae45c8e400eb0a8bddef0dbb51 (diff)
Cleanup: reduce variable scope
Diffstat (limited to 'source/blender/blenkernel/intern/cloth.c')
-rw-r--r--source/blender/blenkernel/intern/cloth.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 62e2294345d..770a9379e2d 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -172,24 +172,18 @@ void cloth_init(ClothModifierData *clmd)
static BVHTree *bvhtree_build_from_cloth(ClothModifierData *clmd, float epsilon)
{
- unsigned int i;
- BVHTree *bvhtree;
- Cloth *cloth;
- ClothVertex *verts;
- const MVertTri *vt;
-
if (!clmd) {
return NULL;
}
- cloth = clmd->clothObject;
+ Cloth *cloth = clmd->clothObject;
if (!cloth) {
return NULL;
}
- verts = cloth->verts;
- vt = cloth->tri;
+ ClothVertex *verts = cloth->verts;
+ const MVertTri *vt = cloth->tri;
/* in the moment, return zero if no faces there */
if (!cloth->primitive_num) {
@@ -197,11 +191,11 @@ static BVHTree *bvhtree_build_from_cloth(ClothModifierData *clmd, float epsilon)
}
/* create quadtree with k=26 */
- bvhtree = BLI_bvhtree_new(cloth->primitive_num, epsilon, 4, 26);
+ BVHTree *bvhtree = BLI_bvhtree_new(cloth->primitive_num, epsilon, 4, 26);
/* fill tree */
if (clmd->hairdata == NULL) {
- for (i = 0; i < cloth->primitive_num; i++, vt++) {
+ for (int i = 0; i < cloth->primitive_num; i++, vt++) {
float co[3][3];
copy_v3_v3(co[0], verts[vt->tri[0]].xold);
@@ -214,7 +208,7 @@ static BVHTree *bvhtree_build_from_cloth(ClothModifierData *clmd, float epsilon)
else {
MEdge *edges = cloth->edges;
- for (i = 0; i < cloth->primitive_num; i++) {
+ for (int i = 0; i < cloth->primitive_num; i++) {
float co[2][3];
copy_v3_v3(co[0], verts[edges[i].v1].xold);
@@ -997,8 +991,7 @@ BLI_INLINE void spring_verts_ordered_set(ClothSpring *spring, int v0, int v1)
static void cloth_free_edgelist(LinkNodePair *edgelist, unsigned int mvert_num)
{
if (edgelist) {
- unsigned int i;
- for (i = 0; i < mvert_num; i++) {
+ for (uint i = 0; i < mvert_num; i++) {
BLI_linklist_free(edgelist[i].list, NULL);
}