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:
-rw-r--r--source/blender/blenkernel/intern/pointcache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 5445c990a9b..411e77de858 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1491,7 +1491,7 @@ static int ptcache_old_elemsize(PTCacheID *pid)
static void ptcache_find_frames_around(PTCacheID *pid, unsigned int frame, int *fra1, int *fra2)
{
if(pid->cache->flag & PTCACHE_DISK_CACHE) {
- int cfra1=frame-1, cfra2=frame+1;
+ int cfra1=frame, cfra2=frame+1;
while(cfra1 >= pid->cache->startframe && !BKE_ptcache_id_exist(pid, cfra1))
cfra1--;
@@ -1518,7 +1518,7 @@ static void ptcache_find_frames_around(PTCacheID *pid, unsigned int frame, int *
PTCacheMem *pm = pid->cache->mem_cache.first;
PTCacheMem *pm2 = pid->cache->mem_cache.last;
- while(pm->next && pm->next->frame < frame)
+ while(pm->next && pm->next->frame <= frame)
pm= pm->next;
if(pm2->frame < frame) {
@@ -1841,7 +1841,7 @@ static int ptcache_interpolate(PTCacheID *pid, float cfra, int cfra1, int cfra2)
/* possible to get old or interpolated result */
int BKE_ptcache_read(PTCacheID *pid, float cfra)
{
- int cfrai = (int)cfra, cfra1=0, cfra2=0;
+ int cfrai = (int)floor(cfra), cfra1=0, cfra2=0;
int ret = 0;
/* nothing to read to */