diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-16 19:02:02 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-16 19:02:23 +0300 |
commit | dc1c820b2b007302e37dd97bb244737d7351ae89 (patch) | |
tree | b240a78cbd891fdb585f5d87116598b00c429f46 /source/blender/editors/gpencil/gpencil_utils.c | |
parent | 0a8e6b48c44afa996c76dfef4ffb516cd668cd76 (diff) |
Cleanup: remove BLI_frand from GreasePencil code.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_utils.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index f6d72d9e575..4ee3bdd587e 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -965,7 +965,7 @@ void gp_subdivide_stroke(bGPDstroke *gps, const int new_totpoints) * \param gps Stroke data * \param brush Brush data */ -void gp_randomize_stroke(bGPDstroke *gps, bGPDbrush *brush) +void gp_randomize_stroke(bGPDstroke *gps, bGPDbrush *brush, RNG *rng) { bGPDspoint *pt1, *pt2, *pt3; float v1[3]; @@ -998,10 +998,10 @@ void gp_randomize_stroke(bGPDstroke *gps, bGPDbrush *brush) for (int i = 1; i < gps->totpoints - 1; ++i) { bGPDspoint *pt = &gps->points[i]; /* get vector with shift (apply a division because random is too sensitive */ - const float fac = BLI_frand() * (brush->draw_random_sub / 10.0f); + const float fac = BLI_rng_get_float(rng) * (brush->draw_random_sub / 10.0f); float svec[3]; copy_v3_v3(svec, ortho); - if (BLI_frand() > 0.5f) { + if (BLI_rng_get_float(rng) > 0.5f) { mul_v3_fl(svec, -fac); } else { |