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:
authorHans Goudey <h.goudey@me.com>2020-11-22 20:11:15 +0300
committerHans Goudey <h.goudey@me.com>2020-11-22 20:11:15 +0300
commit4c01fbb564f5ada3f666af5ac36ca981667b3414 (patch)
treef365b6cf89a5a8552b64dc2f55684e627b26ea5a /source/blender/blenkernel/intern/displist.c
parentb11d409ac42a2c5f8b3ed450bb6728aa127e8c9f (diff)
Cleanup: Use const arguments in curve bevel
This makes it clear that only the final "r_data" is being changed. Also rename a variable to be less vague.
Diffstat (limited to 'source/blender/blenkernel/intern/displist.c')
-rw-r--r--source/blender/blenkernel/intern/displist.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c
index 05c407fc6c3..5220d5be2ca 100644
--- a/source/blender/blenkernel/intern/displist.c
+++ b/source/blender/blenkernel/intern/displist.c
@@ -1290,20 +1290,18 @@ void BKE_displist_make_surf(Depsgraph *depsgraph,
BKE_nurbList_free(&nubase);
}
-static void rotateBevelPiece(Curve *cu,
- BevPoint *bevp,
- BevPoint *nbevp,
- DispList *dlb,
- float bev_blend,
- float widfac,
- float fac,
+static void rotateBevelPiece(const Curve *cu,
+ const BevPoint *bevp,
+ const BevPoint *nbevp,
+ const DispList *dlb,
+ const float bev_blend,
+ const float widfac,
+ const float radius_factor,
float **r_data)
{
- float *fp, *data = *r_data;
- int b;
-
- fp = dlb->verts;
- for (b = 0; b < dlb->nr; b++, fp += 3, data += 3) {
+ float *data = *r_data;
+ const float *fp = dlb->verts;
+ for (int b = 0; b < dlb->nr; b++, fp += 3, data += 3) {
if (cu->flag & CU_3D) {
float vec[3], quat[4];
@@ -1322,9 +1320,9 @@ static void rotateBevelPiece(Curve *cu,
mul_qt_v3(quat, vec);
- data[0] += fac * vec[0];
- data[1] += fac * vec[1];
- data[2] += fac * vec[2];
+ data[0] += radius_factor * vec[0];
+ data[1] += radius_factor * vec[1];
+ data[2] += radius_factor * vec[2];
}
else {
float sina, cosa;
@@ -1344,9 +1342,9 @@ static void rotateBevelPiece(Curve *cu,
cosa = nbevp->cosa * bev_blend + bevp->cosa * (1.0f - bev_blend);
}
- data[0] += fac * (widfac + fp[1]) * sina;
- data[1] += fac * (widfac + fp[1]) * cosa;
- data[2] += fac * fp[2];
+ data[0] += radius_factor * (widfac + fp[1]) * sina;
+ data[1] += radius_factor * (widfac + fp[1]) * cosa;
+ data[2] += radius_factor * fp[2];
}
}
@@ -1568,7 +1566,7 @@ static void do_makeDispListCurveTypes(Depsgraph *depsgraph,
curve_to_displist(cu, &nubase, dispbase, for_render);
}
else {
- float widfac = cu->width - 1.0f;
+ const float widfac = cu->width - 1.0f;
BevList *bl = ob->runtime.curve_cache->bev.first;
Nurb *nu = nubase.first;