diff options
author | Joerg Mueller <nexyon@gmail.com> | 2012-03-19 02:21:29 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2012-03-19 02:21:29 +0400 |
commit | 727f586a0de6351f58f5fc970a2ee04fcbc50da6 (patch) | |
tree | c0a3f40b2943822b33c4ea8de35b63190a199e3d /source/blender/editors | |
parent | 53b7078343c1fa0e9361e038163a6a17f52da4e4 (diff) |
Fix for [#30495] Framerate goes crazy after changing Sync mode from "Frame Dropping" to "no Sync" while playing anim
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_screen_types.h | 1 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h index 51699d095ae..6f7d0c55b9a 100644 --- a/source/blender/editors/include/ED_screen_types.h +++ b/source/blender/editors/include/ED_screen_types.h @@ -41,6 +41,7 @@ typedef struct ScreenAnimData { short flag; /* flags for playback */ int sfra; /* frame that playback was started from */ int nextfra; /* next frame to go to (when ANIMPLAY_FLAG_USE_NEXT_FRAME is set) */ + double last_duration; /* used for frame dropping */ } ScreenAnimData; /* for animplayer */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index b1d718f08b5..697f40a507a 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2915,13 +2915,12 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e } else { if (sync) { - int step = floor(wt->duration * FPS); + int step = floor((wt->duration - sad->last_duration) * FPS); /* skip frames */ if (sad->flag & ANIMPLAY_FLAG_REVERSE) scene->r.cfra -= step; else scene->r.cfra += step; - wt->duration -= ((double)step)/FPS; } else { /* one frame +/- */ @@ -2932,6 +2931,8 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e } } + sad->last_duration = wt->duration; + /* reset 'jumped' flag before checking if we need to jump... */ sad->flag &= ~ANIMPLAY_FLAG_JUMPED; |