diff options
Diffstat (limited to 'source/blender/editors/screen/screen_edit.c')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 1bd1fef4673..3e56e601788 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -25,6 +25,8 @@ */ #include <string.h> +#include <math.h> + #include "MEM_guardedalloc.h" @@ -1651,7 +1653,7 @@ void ED_refresh_viewport_fps(bContext *C) /* redraws: uses defines from stime->redraws * enable: 1 - forward on, -1 - backwards on, 0 - off */ -void ED_screen_animation_timer(bContext *C, int redraws, int refresh, int sync, int enable) +void ED_screen_animation_timer(bContext *C, int redraws, int refresh, int sync, int enable, double speed) { bScreen *screen= CTX_wm_screen(C); wmWindowManager *wm= CTX_wm_manager(C); @@ -1664,12 +1666,12 @@ void ED_screen_animation_timer(bContext *C, int redraws, int refresh, int sync, if(enable) { ScreenAnimData *sad= MEM_callocN(sizeof(ScreenAnimData), "ScreenAnimData"); - - screen->animtimer= WM_event_add_timer(wm, win, TIMER0, (1.0/FPS)); + screen->animtimer= WM_event_add_timer(wm, win, TIMER0, (1.0/(FPS*speed))); sad->ar= CTX_wm_region(C); sad->sfra = scene->r.cfra; sad->redraws= redraws; sad->refresh= refresh; + sad->speed_mul= speed; sad->flag |= (enable < 0)? ANIMPLAY_FLAG_REVERSE: 0; sad->flag |= (sync == 0)? ANIMPLAY_FLAG_NO_SYNC: (sync == 1)? ANIMPLAY_FLAG_SYNC: 0; screen->animtimer->customdata= sad; |