diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-01-09 10:41:51 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-01-09 10:41:51 +0300 |
commit | e32bbef017df64a99acedd4f3f4ba32713c50a3b (patch) | |
tree | 881bf3c46da067ae6715a77a1763f2eb04d7600c /source/blender/blenloader | |
parent | 76a762aa51a4cb774dfd7940fb77916037efad8c (diff) |
Fix for [#25544] Blender crashes when changing the particles emission amount
* I've getting bad feelings about the point cache index_array for a while (cause for this bug too), so from now on memory cache uses a simple binary search directly on the index data to handle queries to specific data points.
* This is a bit slower than just checking from a dedicated array, but it's much less error prone, uses less memory and makes the code more readable too, so it's not a tough choice.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 9 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 2 |
2 files changed, 0 insertions, 11 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f3bd91d12ed..9772074207d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2936,15 +2936,6 @@ static void direct_link_pointcache(FileData *fd, PointCache *cache) pm = cache->mem_cache.first; for(; pm; pm=pm->next) { - if(pm->index_array) - pm->index_array = newdataadr(fd, pm->index_array); - - /* writedata saved array of ints */ - if(pm->index_array && (fd->flags & FD_FLAGS_SWITCH_ENDIAN)) { - for(i=0; i<pm->totpoint; i++) - SWITCH_INT(pm->index_array[i]); - } - for(i=0; i<BPHYS_TOT_DATA; i++) { pm->data[i] = newdataadr(fd, pm->data[i]); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index dd6d56572e8..050fd5bcaf1 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -784,8 +784,6 @@ static void write_pointcaches(WriteData *wd, ListBase *ptcaches) for(; pm; pm=pm->next) { writestruct(wd, DATA, "PTCacheMem", 1, pm); - if(pm->index_array) - writedata(wd, DATA, MEM_allocN_len(pm->index_array), pm->index_array); for(i=0; i<BPHYS_TOT_DATA; i++) { if(pm->data[i] && pm->data_types & (1<<i)) |