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>2011-05-19 16:39:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-19 16:39:57 +0400
commitfbe541d1a85dd4700e153e17bd6bcbcbc7d9cbb6 (patch)
tree71fefdbd8cb6395aecfb3e8dce9397370683359e /source/blender/blenkernel/intern/fcurve.c
parente088f592bd82f5c3863368f49eabd3e8afffe119 (diff)
modify fcurve evaluation for bool/enum/int values. was converting from a float to an int which means 0.9x evaluates to 0.0, negative numbers are also rounded up.
Round at 0.5 instead & treat negative numbers the same.
Diffstat (limited to 'source/blender/blenkernel/intern/fcurve.c')
-rw-r--r--source/blender/blenkernel/intern/fcurve.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index b1272ee2d53..d6a9d950015 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -2039,7 +2039,7 @@ float evaluate_fcurve (FCurve *fcu, float evaltime)
* here so that the curve can be sampled correctly
*/
if (fcu->flag & FCURVE_INT_VALUES)
- cvalue= (float)((int)cvalue);
+ cvalue= floorf(cvalue + 0.5f);
/* return evaluated value */
return cvalue;