Commit: 2fa66f6f966b5dc7d79f9fbea55f39813d48909d Author: Jacques Lucke Date: Thu Jun 27 12:40:33 2019 +0200 Branches: functions https://developer.blender.org/rB2fa66f6f966b5dc7d79f9fbea55f39813d48909d
move function from header to cpp =================================================================== M source/blender/simulations/bparticles/core.cpp M source/blender/simulations/bparticles/core.hpp =================================================================== diff --git a/source/blender/simulations/bparticles/core.cpp b/source/blender/simulations/bparticles/core.cpp index 6bee750a1ae..67ad13ded1b 100644 --- a/source/blender/simulations/bparticles/core.cpp +++ b/source/blender/simulations/bparticles/core.cpp @@ -33,6 +33,33 @@ ParticlesState::~ParticlesState() } } +/* EmitterInterface + ******************************************/ + +EmitTarget &EmitterInterface::request(uint particle_type_id, uint size) +{ + ParticlesContainer &container = m_state.particle_container(particle_type_id); + + SmallVector<ParticlesBlock *> blocks; + SmallVector<Range<uint>> ranges; + + uint remaining_size = size; + while (remaining_size > 0) { + ParticlesBlock &block = *container.new_block(); + + uint size_to_use = std::min(block.size(), remaining_size); + block.active_amount() += size_to_use; + + blocks.append(&block); + ranges.append(Range<uint>(0, size_to_use)); + + remaining_size -= size_to_use; + } + + m_targets.append(EmitTarget(particle_type_id, container.attributes_info(), blocks, ranges)); + return m_targets.last(); +} + /* EmitTarget ******************************************/ diff --git a/source/blender/simulations/bparticles/core.hpp b/source/blender/simulations/bparticles/core.hpp index 9e2980a580f..c86192c023c 100644 --- a/source/blender/simulations/bparticles/core.hpp +++ b/source/blender/simulations/bparticles/core.hpp @@ -122,29 +122,7 @@ class EmitterInterface { return m_targets; } - EmitTarget &request(uint particle_type_id, uint size) - { - ParticlesContainer &container = m_state.particle_container(particle_type_id); - - SmallVector<ParticlesBlock *> blocks; - SmallVector<Range<uint>> ranges; - - uint remaining_size = size; - while (remaining_size > 0) { - ParticlesBlock &block = *container.new_block(); - - uint size_to_use = std::min(block.size(), remaining_size); - block.active_amount() += size_to_use; - - blocks.append(&block); - ranges.append(Range<uint>(0, size_to_use)); - - remaining_size -= size_to_use; - } - - m_targets.append(EmitTarget(particle_type_id, container.attributes_info(), blocks, ranges)); - return m_targets.last(); - } + EmitTarget &request(uint particle_type_id, uint size); }; struct ParticleSet { _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs