[Bf-blender-cvs] [933de8201e8] master: Cleanup: Add float format
Antonio Vazquez
noreply at git.blender.org
Thu Apr 29 15:48:27 CEST 2021
Commit: 933de8201e8c0ef844478e8bf000dd8d32c7bcdf
Author: Antonio Vazquez
Date: Thu Apr 29 15:41:27 2021 +0200
Branches: master
https://developer.blender.org/rB933de8201e8c0ef844478e8bf000dd8d32c7bcdf
Cleanup: Add float format
===================================================================
M source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
===================================================================
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
index 56882caa2a3..a9d4d5091ec 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c
@@ -28,8 +28,8 @@
#include "BLT_translation.h"
-#include "BLI_math.h"
#include "BLI_hash.h"
+#include "BLI_math.h"
#include "BLI_rand.h"
#include "DNA_defaults.h"
@@ -117,21 +117,21 @@ static void deformStroke(GpencilModifierData *md,
}
for (int j = 0; j < 3; j++) {
const uint primes[3] = {2, 3, 7};
- double offset[3] = {0.0, 0.0, 0.0};
+ double offset[3] = {0.0f, 0.0f, 0.0f};
double r[3];
/* To ensure a nice distribution, we use halton sequence and offset using the seed. */
BLI_halton_3d(primes, offset, rnd_index, r);
- if ((mmd->flag & GP_OFFSET_UNIFORM_RANDOM_SCALE) && j == 2) {
+ if ((mmd->flag & GP_OFFSET_UNIFORM_RANDOM_SCALE) && j == 2) {
float rand_value;
- rand_value = fmodf(r[0] * 2.0 - 1.0 + rand_offset, 1.0f);
- rand_value = fmodf(sin(rand_value * 12.9898 + j * 78.233) * 43758.5453, 1.0f);
+ rand_value = fmodf(r[0] * 2.0f - 1.0f + rand_offset, 1.0f);
+ rand_value = fmodf(sin(rand_value * 12.9898f + j * 78.233f) * 43758.5453f, 1.0f);
copy_v3_fl(rand[j], rand_value);
}
else {
for (int i = 0; i < 3; i++) {
- rand[j][i] = fmodf(r[i] * 2.0 - 1.0 + rand_offset, 1.0f);
- rand[j][i] = fmodf(sin(rand[j][i] * 12.9898 + j * 78.233) * 43758.5453, 1.0f);
+ rand[j][i] = fmodf(r[i] * 2.0f - 1.0f + rand_offset, 1.0f);
+ rand[j][i] = fmodf(sin(rand[j][i] * 12.9898f + j * 78.233f) * 43758.5453f, 1.0f);
}
}
}
More information about the Bf-blender-cvs
mailing list