diff options
author | Hans Goudey <h.goudey@me.com> | 2021-01-20 01:09:34 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-01-20 01:09:34 +0300 |
commit | da6dea5701311f41c7d70429b111b901b6bcf966 (patch) | |
tree | 23582a7dfae4fc3dfc147db3e627b6624efbae3f /source/blender/nodes | |
parent | 694032c9d1a3931cd7e9b53020a14de34938efca (diff) |
Cleanup: Use const arguments, explicit type
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc index 0e7bb25e659..3ee7df7fe72 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc @@ -50,8 +50,7 @@ static void geo_node_attribute_randomize_update(bNodeTree *UNUSED(ntree), bNode bNodeSocket *sock_min_float = sock_max_vector->next; bNodeSocket *sock_max_float = sock_min_float->next; - const int data_type = node->custom1; - + const CustomDataType data_type = static_cast<CustomDataType>(node->custom1); nodeSetSocketAvailability(sock_min_vector, data_type == CD_PROP_FLOAT3); nodeSetSocketAvailability(sock_max_vector, data_type == CD_PROP_FLOAT3); nodeSetSocketAvailability(sock_min_float, data_type == CD_PROP_FLOAT); @@ -86,8 +85,11 @@ static void randomize_attribute_bool(BooleanWriteAttribute attribute, attribute.apply_span(); } -static void randomize_attribute_float( - FloatWriteAttribute attribute, float min, float max, Span<uint32_t> hashes, const int seed) +static void randomize_attribute_float(FloatWriteAttribute attribute, + const float min, + const float max, + Span<uint32_t> hashes, + const int seed) { MutableSpan<float> attribute_span = attribute.get_span(); for (const int i : IndexRange(attribute.size())) { @@ -97,8 +99,11 @@ static void randomize_attribute_float( attribute.apply_span(); } -static void randomize_attribute_float3( - Float3WriteAttribute attribute, float3 min, float3 max, Span<uint32_t> hashes, const int seed) +static void randomize_attribute_float3(Float3WriteAttribute attribute, + const float3 min, + const float3 max, + Span<uint32_t> hashes, + const int seed) { MutableSpan<float3> attribute_span = attribute.get_span(); for (const int i : IndexRange(attribute.size())) { @@ -129,8 +134,7 @@ Array<uint32_t> get_geometry_element_ids_as_uints(const GeometryComponent &compo } else { /* If there is no "id" attribute for per-point variation, just create it here. */ - RandomNumberGenerator rng; - rng.seed(0); + RandomNumberGenerator rng(0); for (const int i : hashes.index_range()) { hashes[i] = rng.get_uint32(); } |