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

Jacques Lucke noreply at git.blender.org
Fri Sep 20 16:38:33 CEST 2019


Commit: e397b679466ad832c52bc64f865d6e2c140cca65
Author: Jacques Lucke
Date:   Fri Sep 20 16:37:41 2019 +0200
Branches: functions
https://developer.blender.org/rBe397b679466ad832c52bc64f865d6e2c140cca65

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 e2924eb07b2..2317adc4638 100644
--- a/source/blender/simulations/bparticles/simulate.cpp
+++ b/source/blender/simulations/bparticles/simulate.cpp
@@ -476,39 +476,33 @@ BLI_NOINLINE static void create_particles_from_emitters(ParticleAllocator &parti
   }
 }
 
-BLI_NOINLINE static void emit_and_simulate_particles(
-    ParticlesState &state,
-    TimeSpan time_span,
-    ArrayRef<Emitter *> emitters,
-    StringMap<ParticleSystemInfo> &systems_to_simulate)
+void simulate_particles(SimulationState &state,
+                        ArrayRef<Emitter *> emitters,
+                        StringMap<ParticleSystemInfo> &systems_to_simulate)
 {
+  SCOPED_TIMER(__func__);
+
+  ParticlesState &particles_state = state.particles();
+  TimeSpan simulation_time_span = state.time().current_update_time();
 
   Vector<AttributesBlock *> newly_created_blocks;
   {
-    ParticleAllocator particle_allocator(state);
-    simulate_all_existing_blocks(state, systems_to_simulate, particle_allocator, time_span);
-    create_particles_from_emitters(particle_allocator, emitters, time_span);
+    ParticleAllocator particle_allocator(particles_state);
+    simulate_all_existing_blocks(
+        particles_state, systems_to_simulate, particle_allocator, simulation_time_span);
+    create_particles_from_emitters(particle_allocator, emitters, simulation_time_span);
     newly_created_blocks = particle_allocator.allocated_blocks();
   }
 
   while (newly_created_blocks.size() > 0) {
-    ParticleAllocator particle_allocator(state);
-    simulate_blocks_from_birth_to_current_time(
-        particle_allocator, newly_created_blocks, systems_to_simulate, time_span.end(), state);
+    ParticleAllocator particle_allocator(particles_state);
+    simulate_blocks_from_birth_to_current_time(particle_allocator,
+                                               newly_created_blocks,
+                                               systems_to_simulate,
+                                               simulation_time_span.end(),
+                                               particles_state);
     newly_created_blocks = particle_allocator.allocated_blocks();
   }
-}
-
-void simulate_particles(SimulationState &state,
-                        ArrayRef<Emitter *> emitters,
-                        StringMap<ParticleSystemInfo> &systems_to_simulate)
-{
-  SCOPED_TIMER(__func__);
-
-  ParticlesState &particles_state = state.particles();
-
-  emit_and_simulate_particles(
-      particles_state, state.time().current_update_time(), emitters, systems_to_simulate);
 
   compress_all_containers(particles_state);
 }



More information about the Bf-blender-cvs mailing list