From e32bbef017df64a99acedd4f3f4ba32713c50a3b Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sun, 9 Jan 2011 07:41:51 +0000 Subject: 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. --- source/blender/blenkernel/BKE_pointcache.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/BKE_pointcache.h') diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index f3548888168..c7f76c033c8 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -89,7 +89,7 @@ struct SoftBody; /* temp structure for read/write */ typedef struct PTCacheData { - int index; + uint32_t index; float loc[3]; float vel[3]; float rot[4]; @@ -270,6 +270,9 @@ void BKE_ptcache_update_info(PTCacheID *pid); /* Size of cache data type. */ int BKE_ptcache_data_size(int data_type); +/* Is point with indes in memory cache */ +int BKE_ptcache_mem_index_find(struct PTCacheMem *pm, int index); + /* Memory cache read/write helpers. */ void BKE_ptcache_mem_pointers_init(struct PTCacheMem *pm); void BKE_ptcache_mem_pointers_incr(struct PTCacheMem *pm); -- cgit v1.2.3