diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-11-06 10:08:18 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-11-06 10:08:18 +0400 |
commit | 723484ec066d3e2d2b0943dc9dca156d63c07c39 (patch) | |
tree | b7a6c13a32422df9acec10231a82a084c3d0c55a /source/blender/blenkernel/intern/scene.c | |
parent | 440c1c2c1745b6d4acd13f405643100cb913fb3b (diff) |
Removed old "bsystem_time()" function, which by now is just a
duplicate of BKE_curframe() which just takes two extra args.
For the few calls in the physics engine where CFRA+1 instead of CFRA
was being used, I've added a new BKE_nextframe() call, which will
calculate for CFRA+1 instead of CFRA in much the same way that
bsystem_time() would end up doing things (which means including
subframe steps).
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index f1e094c3909..2f24b7e735d 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -910,14 +910,23 @@ int scene_check_setscene(Main *bmain, Scene *sce) } /* This function is needed to cope with fractional frames - including two Blender rendering features -* mblur (motion blur that renders 'subframes' and blurs them together), and fields rendering. */ - -/* see also bsystem_time in object.c */ + * mblur (motion blur that renders 'subframes' and blurs them together), and fields rendering. + */ float BKE_curframe(Scene *scene) { float ctime = scene->r.cfra; - ctime+= scene->r.subframe; - ctime*= scene->r.framelen; + ctime += scene->r.subframe; + ctime *= scene->r.framelen; + + return ctime; +} + +/* Similar to BKE_curframe(), but is used by physics sims to get "next time", which is defined as cfra+1 */ +float BKE_nextframe(Scene *scene) +{ + float ctime = (float)(scene->r.cfra + 1); + ctime += scene->r.subframe; + ctime *= scene->r.framelen; return ctime; } |