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:
authorCampbell Barton <campbell@blender.org>2022-09-25 11:33:28 +0300
committerCampbell Barton <campbell@blender.org>2022-09-25 13:17:08 +0300
commitf68cfd6bb078482c4a779a6e26a56e2734edb5b8 (patch)
tree2878e5b80dba5bdeba186d99661d604eb38879cd /source/blender/editors/sculpt_paint/paint_image_2d_curve_mask.cc
parentc7b247a118e302a3afc6473797e53b6af28b69e2 (diff)
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_2d_curve_mask.cc')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_2d_curve_mask.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d_curve_mask.cc b/source/blender/editors/sculpt_paint/paint_image_2d_curve_mask.cc
index d3c61508726..6c7029cccd1 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d_curve_mask.cc
+++ b/source/blender/editors/sculpt_paint/paint_image_2d_curve_mask.cc
@@ -52,20 +52,20 @@ static void update_curve_mask(CurveMaskCache *curve_mask_cache,
const float cursor_position[2])
{
BLI_assert(curve_mask_cache->curve_mask != nullptr);
- int offset = (int)floorf(diameter / 2.0f);
+ int offset = int(floorf(diameter / 2.0f));
int clamped_radius = max_ff(radius, 1.0);
ushort *m = curve_mask_cache->curve_mask;
const int aa_samples = aa_samples_per_texel_axis(brush, radius);
- const float aa_offset = 1.0f / (2.0f * (float)aa_samples);
- const float aa_step = 1.0f / (float)aa_samples;
+ const float aa_offset = 1.0f / (2.0f * float(aa_samples));
+ const float aa_step = 1.0f / float(aa_samples);
float bpos[2];
bpos[0] = cursor_position[0] - floorf(cursor_position[0]) + offset;
bpos[1] = cursor_position[1] - floorf(cursor_position[1]) + offset;
- float weight_factor = 65535.0f / (float)(aa_samples * aa_samples);
+ float weight_factor = 65535.0f / float(aa_samples * aa_samples);
for (int y = 0; y < diameter; y++) {
for (int x = 0; x < diameter; x++, m++) {
@@ -87,7 +87,7 @@ static void update_curve_mask(CurveMaskCache *curve_mask_cache,
}
pixel_xy[0] += aa_step;
}
- *m = (ushort)(total_weight * weight_factor);
+ *m = ushort(total_weight * weight_factor);
}
}
}