summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--genome.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/genome.c b/genome.c
index 3ee13e0..1d8a524 100644
--- a/genome.c
+++ b/genome.c
@@ -277,8 +277,9 @@ void xform_rand (flam3_xform * const xform, const bool add_post,
}
}
+ const unsigned int var = rand_mod (rc, max_var)+1;
memset (xform->var, 0, sizeof (*xform->var));
- for (unsigned int i = 0; i < max_var; i++) {
+ for (unsigned int i = 0; i < var; i++) {
const unsigned int v = rand_mod (rc, flam3_nvariations);
double w;
do {
@@ -286,11 +287,6 @@ void xform_rand (flam3_xform * const xform, const bool add_post,
} while (w == 0.0);
xform->var[v] += w;
random_xform_param (xform, v, rc);
-
- /* small number of variations is more likely */
- if (rand_bool (rc)) {
- break;
- }
}
/* Normalize weights to 1.0 total. */