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:
authorCampbell Barton <ideasman42@gmail.com>2010-01-20 14:32:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-20 14:32:11 +0300
commitd99d68684b990a833c6fe222e5e718ac245338b0 (patch)
tree328fff1c3bdda80f0df389a7240a30cd78839c17
parent6307c65534f6d5cf29d08220cea0dbcca9a0e118 (diff)
only reallocate memory for child particles if the size changes.
-rw-r--r--source/blender/blenkernel/intern/particle_system.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index acdab80bb37..19187ed35af 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -263,6 +263,12 @@ static int get_psys_tot_child(struct Scene *scene, ParticleSystem *psys)
static void alloc_child_particles(ParticleSystem *psys, int tot)
{
if(psys->child){
+ /* only re-allocate if we have to */
+ if(psys->part->childtype && psys->totchild == tot) {
+ memset(psys->child, 0, tot*sizeof(ChildParticle));
+ return;
+ }
+
MEM_freeN(psys->child);
psys->child=0;
psys->totchild=0;