diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-06-13 08:16:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-06-13 08:16:18 +0300 |
commit | 75aac463e795d7b8b5b19d55b5620618b176c211 (patch) | |
tree | f487bf7d497a7e5fb7a7c348f012ea9c01931d96 /source/blender/blenkernel/intern/anim_path.c | |
parent | 1754828e33bea1d288cfbdc9aeaafeb0109ef50b (diff) |
Cleanup: comments, use bool return value
Diffstat (limited to 'source/blender/blenkernel/intern/anim_path.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim_path.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/source/blender/blenkernel/intern/anim_path.c b/source/blender/blenkernel/intern/anim_path.c index e94f0d6ff85..92b5bd345cf 100644 --- a/source/blender/blenkernel/intern/anim_path.c +++ b/source/blender/blenkernel/intern/anim_path.c @@ -42,9 +42,11 @@ static CLG_LogRef LOG = {"bke.anim"}; /* ******************************************************************** */ /* Curve Paths - for curve deforms and/or curve following */ -/* free curve path data - * NOTE: frees the path itself! - * NOTE: this is increasingly inaccurate with non-uniform BevPoint subdivisions [#24633] +/** + * Free curve path data + * + * \note Frees the path itself! + * \note This is increasingly inaccurate with non-uniform #BevPoint subdivisions T24633. */ void free_path(Path *path) { @@ -54,8 +56,9 @@ void free_path(Path *path) MEM_freeN(path); } -/* calculate a curve-deform path for a curve - * - only called from displist.c -> do_makeDispListCurveTypes +/** + * Calculate a curve-deform path for a curve + * - Only called from displist.c -> #do_makeDispListCurveTypes */ void calc_curvepath(Object *ob, ListBase *nurbs) { @@ -192,20 +195,21 @@ static int interval_test(const int min, const int max, int p1, const int cycl) return p1; } -/* calculate the deformation implied by the curve path at a given parametric position, +/** + * Calculate the deformation implied by the curve path at a given parametric position, * and returns whether this operation succeeded. * - * note: ctime is normalized range <0-1> + * \param ctime: Time is normalized range <0-1>. * - * returns OK: 1/0 + * \return success. */ -int where_on_path(Object *ob, - float ctime, - float vec[4], - float dir[3], - float quat[4], - float *radius, - float *weight) +bool where_on_path(Object *ob, + float ctime, + float vec[4], + float dir[3], + float quat[4], + float *radius, + float *weight) { Curve *cu; Nurb *nu; @@ -218,13 +222,13 @@ int where_on_path(Object *ob, ListBase *nurbs; if (ob == NULL || ob->type != OB_CURVE) { - return 0; + return false; } cu = ob->data; if (ob->runtime.curve_cache == NULL || ob->runtime.curve_cache->path == NULL || ob->runtime.curve_cache->path->data == NULL) { CLOG_WARN(&LOG, "no path!"); - return 0; + return false; } path = ob->runtime.curve_cache->path; pp = path->data; @@ -232,10 +236,10 @@ int where_on_path(Object *ob, /* test for cyclic */ bl = ob->runtime.curve_cache->bev.first; if (!bl) { - return 0; + return false; } if (!bl->nr) { - return 0; + return false; } if (bl->poly > -1) { cycl = 1; @@ -343,5 +347,5 @@ int where_on_path(Object *ob, data[3] * p3->weight; } - return 1; + return true; } |