summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2015-05-28 17:08:46 +0200
committerLars-Dominik Braun <lars@6xq.net>2015-05-28 17:08:46 +0200
commiteacf2017413f590e69e841480ae47a9ebdc769cd (patch)
tree0adfa0d37b2353959c7d2adef635ab38f005494d
parent55386cb28e2512804f1c09097be8348f64ca8c00 (diff)
downloadpucket-eacf2017413f590e69e841480ae47a9ebdc769cd.tar.gz
pucket-eacf2017413f590e69e841480ae47a9ebdc769cd.tar.bz2
pucket-eacf2017413f590e69e841480ae47a9ebdc769cd.zip
random: Remove variation bias
-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. */