[Bf-blender-cvs] [2491dc812f4] functions: rename stride to size

Jacques Lucke noreply at git.blender.org
Tue Sep 3 16:23:07 CEST 2019


Commit: 2491dc812f47971a3120be36056d2e5b7ce0b140
Author: Jacques Lucke
Date:   Tue Sep 3 11:58:45 2019 +0200
Branches: functions
https://developer.blender.org/rB2491dc812f47971a3120be36056d2e5b7ce0b140

rename stride to size

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

M	source/blender/simulations/bparticles/attributes.hpp
M	source/blender/simulations/bparticles/particle_function_input_providers.cpp
M	source/blender/simulations/bparticles/particles_container.cpp

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

diff --git a/source/blender/simulations/bparticles/attributes.hpp b/source/blender/simulations/bparticles/attributes.hpp
index 3f42919d606..a171bb99e5b 100644
--- a/source/blender/simulations/bparticles/attributes.hpp
+++ b/source/blender/simulations/bparticles/attributes.hpp
@@ -308,7 +308,7 @@ class AttributesRef {
   /**
    * Get the size of an element in one attribute.
    */
-  uint attribute_stride(uint index)
+  uint attribute_size(uint index)
   {
     return size_of_attribute_type(this->info().type_of(index));
   }
diff --git a/source/blender/simulations/bparticles/particle_function_input_providers.cpp b/source/blender/simulations/bparticles/particle_function_input_providers.cpp
index fb880168363..6e06b8e9de2 100644
--- a/source/blender/simulations/bparticles/particle_function_input_providers.cpp
+++ b/source/blender/simulations/bparticles/particle_function_input_providers.cpp
@@ -14,9 +14,9 @@ ParticleFunctionInputArray AttributeInputProvider::get(InputProviderInterface &i
 {
   AttributesRef attributes = interface.attributes();
   uint attribute_index = attributes.attribute_index(m_name);
-  uint stride = attributes.attribute_stride(attribute_index);
+  uint size = attributes.attribute_size(attribute_index);
   void *buffer = attributes.get_ptr(attribute_index);
-  return {buffer, stride, false};
+  return {buffer, size, false};
 }
 
 ParticleFunctionInputArray CollisionNormalInputProvider::get(InputProviderInterface &interface)
diff --git a/source/blender/simulations/bparticles/particles_container.cpp b/source/blender/simulations/bparticles/particles_container.cpp
index 9f0948eaaa1..583f7452417 100644
--- a/source/blender/simulations/bparticles/particles_container.cpp
+++ b/source/blender/simulations/bparticles/particles_container.cpp
@@ -231,7 +231,7 @@ void ParticlesBlock::move(uint old_index, uint new_index)
 
   for (uint attribute_index : attributes.info().attribute_indices()) {
     void *ptr = attributes.get_ptr(attribute_index);
-    uint size = attributes.attribute_stride(attribute_index);
+    uint size = attributes.attribute_size(attribute_index);
     void *src = POINTER_OFFSET(ptr, old_index * size);
     void *dst = POINTER_OFFSET(ptr, new_index * size);
     memcpy(dst, src, size);



More information about the Bf-blender-cvs mailing list