From 7461fead506ebac8bf730148e1ace66db116d18a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 8 Mar 2014 17:57:31 +1300 Subject: Fix T39035: Cycles F-Modifier truncates end/beginning frame values for repetition When the keyframes at either end of the source curve don't lie on exact frame boundaries, this casued problems with the Cycles F-Modifier, as part of the cycle would get chopped off. This was caused by float -> integer truncation that was occurring, since one variable was of the wrong type. The problem here wasn't discovered until now (thanks to gcc's invalid-type warnings on printf's) as in standard usage, we can safely assume that all keyframes are strictly on frame boundaries. --- source/blender/blenkernel/intern/fmodifier.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/fmodifier.c') diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index bcbc5571077..56b087e7eb6 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -605,7 +605,8 @@ static float fcm_cycles_time(FModifierStackStorage *storage, FCurve *fcu, FModif FMod_Cycles *data = (FMod_Cycles *)fcm->data; float prevkey[2], lastkey[2], cycyofs = 0.0f; short side = 0, mode = 0; - int cycles = 0, ofs = 0; + int cycles = 0; + float ofs = 0; /* check if modifier is first in stack, otherwise disable ourself... */ /* FIXME... */ -- cgit v1.2.3