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:
authorJacques Lucke <jacques@blender.org>2020-06-09 12:58:47 +0300
committerJacques Lucke <jacques@blender.org>2020-06-09 12:58:47 +0300
commitf7c0f1b8b83ac475755b633abf59cf9f447b2d49 (patch)
tree97302f741ce4e40f6e4de9f0cfd54c7320ee7fd5 /source/blender/blenkernel/intern/simulation.cc
parent7d2b4ae9c6ecce394130cd08694914bf93497a11 (diff)
BLI: rename ArrayRef to Span
This also renames `MutableArrayRef` to `MutableSpan`. The name "Span" works better, because `std::span` will provide similar functionality in C++20. Furthermore, a shorter, more concise name for a common data structure is nice.
Diffstat (limited to 'source/blender/blenkernel/intern/simulation.cc')
-rw-r--r--source/blender/blenkernel/intern/simulation.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc
index 8f08665ab8a..20a23ab8b38 100644
--- a/source/blender/blenkernel/intern/simulation.cc
+++ b/source/blender/blenkernel/intern/simulation.cc
@@ -27,11 +27,11 @@
#include "DNA_scene_types.h"
#include "DNA_simulation_types.h"
-#include "BLI_array_ref.hh"
#include "BLI_compiler_compat.h"
#include "BLI_float3.hh"
#include "BLI_listbase.h"
#include "BLI_math.h"
+#include "BLI_span.hh"
#include "BLI_string.h"
#include "BLI_utildefines.h"
@@ -54,9 +54,9 @@
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
-using blender::ArrayRef;
using blender::float3;
-using blender::MutableArrayRef;
+using blender::MutableSpan;
+using blender::Span;
static void simulation_init_data(ID *id)
{
@@ -168,9 +168,9 @@ void *BKE_simulation_add(Main *bmain, const char *name)
return simulation;
}
-static MutableArrayRef<float3> get_particle_positions(ParticleSimulationState *state)
+static MutableSpan<float3> get_particle_positions(ParticleSimulationState *state)
{
- return MutableArrayRef<float3>(
+ return MutableSpan<float3>(
(float3 *)CustomData_get_layer_named(&state->attributes, CD_LOCATION, "Position"),
state->tot_particles);
}
@@ -239,7 +239,7 @@ void BKE_simulation_data_update(Depsgraph *depsgraph, Scene *scene, Simulation *
CustomData_realloc(&state_orig->attributes, state_orig->tot_particles);
ensure_attributes_exist(state_orig);
- MutableArrayRef<float3> positions = get_particle_positions(state_orig);
+ MutableSpan<float3> positions = get_particle_positions(state_orig);
for (uint i : positions.index_range()) {
positions[i] = {i / 10.0f, 0, 0};
}
@@ -250,7 +250,7 @@ void BKE_simulation_data_update(Depsgraph *depsgraph, Scene *scene, Simulation *
else if (current_frame == state_orig->current_frame + 1) {
state_orig->current_frame = current_frame;
ensure_attributes_exist(state_orig);
- MutableArrayRef<float3> positions = get_particle_positions(state_orig);
+ MutableSpan<float3> positions = get_particle_positions(state_orig);
for (float3 &position : positions) {
position.z += 0.1f;
}