[Bf-blender-cvs] [e9b83d74d24] functions: cleanup

Jacques Lucke noreply at git.blender.org
Sat Jun 29 16:26:09 CEST 2019


Commit: e9b83d74d24c26c9b298de38cb8ac136d7dde4bd
Author: Jacques Lucke
Date:   Sat Jun 29 16:19:12 2019 +0200
Branches: functions
https://developer.blender.org/rBe9b83d74d24c26c9b298de38cb8ac136d7dde4bd

cleanup

===================================================================

M	source/blender/simulations/bparticles/simulate.cpp

===================================================================

diff --git a/source/blender/simulations/bparticles/simulate.cpp b/source/blender/simulations/bparticles/simulate.cpp
index 53beef4d214..c7998e33405 100644
--- a/source/blender/simulations/bparticles/simulate.cpp
+++ b/source/blender/simulations/bparticles/simulate.cpp
@@ -645,16 +645,19 @@ BLI_NOINLINE static void emit_and_simulate_particles(ParticlesState &state,
                                                      StepDescription &step_description,
                                                      TimeSpan time_span)
 {
-  BlockAllocators block_allocators(state);
-  simulate_all_existing_blocks(state, step_description, block_allocators, time_span);
-  create_particles_from_emitters(step_description, block_allocators, time_span);
+  SmallVector<ParticlesBlock *> newly_created_blocks;
+  {
+    BlockAllocators block_allocators(state);
+    simulate_all_existing_blocks(state, step_description, block_allocators, time_span);
+    create_particles_from_emitters(step_description, block_allocators, time_span);
+    newly_created_blocks = block_allocators.all_allocated_blocks();
+  }
 
-  SmallVector<ParticlesBlock *> blocks_to_simulate_next = block_allocators.all_allocated_blocks();
-  while (blocks_to_simulate_next.size() > 0) {
-    BlockAllocators allocators(state);
+  while (newly_created_blocks.size() > 0) {
+    BlockAllocators block_allocators(state);
     simulate_blocks_from_birth_to_current_time(
-        allocators, blocks_to_simulate_next, step_description, time_span.end());
-    blocks_to_simulate_next = allocators.all_allocated_blocks();
+        block_allocators, newly_created_blocks, step_description, time_span.end());
+    newly_created_blocks = block_allocators.all_allocated_blocks();
   }
 }



More information about the Bf-blender-cvs mailing list