diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-02-25 02:44:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-02-25 02:44:34 +0300 |
commit | 20b4477cff689e0218398d5d6556ca25021ed1fa (patch) | |
tree | d95ef71f76757be64c8265098d2067ef7e85b83a /source/blender/blenkernel/intern | |
parent | a21c6b5f59f3a8d02099e1c01ae08abf14a7c2d1 (diff) |
Cleanup: use defines for handles
Copied from original function.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/colortools.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 4a9d384250b..32fb6af01b9 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -414,6 +414,10 @@ void curvemap_sethandle(CurveMap *cuma, int type) */ static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *next, int UNUSED(mode)) { + /* defines to avoid confusion */ +#define p2_h1 ((p2) - 3) +#define p2_h2 ((p2) + 3) + float *p1, *p2, *p3, pt[3]; float len, len_a, len_b; float dvec_a[2], dvec_b[2]; @@ -463,21 +467,24 @@ static void calchandle_curvemap(BezTriple *bezt, BezTriple *prev, BezTriple *nex if (bezt->h1 == HD_AUTO) { len_a /= len; - madd_v2_v2v2fl(p2 - 3, p2, tvec, -len_a); + madd_v2_v2v2fl(p2_h1, p2, tvec, -len_a); } if (bezt->h2 == HD_AUTO) { len_b /= len; - madd_v2_v2v2fl(p2 + 3, p2, tvec, len_b); + madd_v2_v2v2fl(p2_h2, p2, tvec, len_b); } } } if (bezt->h1 == HD_VECT) { /* vector */ - madd_v2_v2v2fl(p2 - 3, p2, dvec_a, -1.0f / 3.0f); + madd_v2_v2v2fl(p2_h1, p2, dvec_a, -1.0f / 3.0f); } if (bezt->h2 == HD_VECT) { - madd_v2_v2v2fl(p2 + 3, p2, dvec_b, 1.0f / 3.0f); + madd_v2_v2v2fl(p2_h2, p2, dvec_b, 1.0f / 3.0f); } + +#undef p2_h1 +#undef p2_h2 } /* in X, out Y. |