diff options
author | Erik Reckase <e.reckase@gmail.com> | 2011-07-23 11:03:46 +0000 |
---|---|---|
committer | Scott Draves <spot@draves.org> | 2015-02-15 12:20:15 -0500 |
commit | 16b94f925733a5e6107eb314429d2f834e59eeff (patch) | |
tree | d7e1fd3cbcbafc774a004ec9d35c6a056acf716a | |
parent | 0346f58852435864a80c2287c08fcdfa8fd220e9 (diff) | |
download | pucket-16b94f925733a5e6107eb314429d2f834e59eeff.tar.gz pucket-16b94f925733a5e6107eb314429d2f834e59eeff.tar.bz2 pucket-16b94f925733a5e6107eb314429d2f834e59eeff.zip |
was incorrectly adding symmetry xforms when a final xform was present, as well as a bug in handling final xforms in genetic crosses. thanks david bitseff
git-svn-id: https://flam3.googlecode.com/svn/trunk@161 77852712-ef1d-11de-8684-7d64432d61a3
-rw-r--r-- | src/flam3.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/flam3.c b/src/flam3.c index e9fe6fd..6a02335 100644 --- a/src/flam3.c +++ b/src/flam3.c @@ -2567,6 +2567,9 @@ void flam3_add_symmetry(flam3_genome *cp, int sym) { if (sym < 0) { i = cp->num_xforms; + if (cp->final_xform_enable) + i -= 1; + flam3_add_xforms(cp,1,0,0); cp->xform[i].density = 1.0; @@ -2592,6 +2595,9 @@ void flam3_add_symmetry(flam3_genome *cp, int sym) { for (k = 1; k < sym; k++) { i = cp->num_xforms; + if (cp->final_xform_enable) + i -= 1; + flam3_add_xforms(cp, 1, 0,0); cp->xform[i].density = 1.0; @@ -2662,8 +2668,13 @@ void flam3_cross(flam3_genome *cp0, flam3_genome *cp1, flam3_genome *out, int cr /* Default behavior keeps the final from parent0. */ if (cp1->final_xform_index == j) continue; + + i = out->num_xforms; + if (out->final_xform_enable) + i -= 1; + flam3_add_xforms(out, 1, 0, 0); - flam3_copy_xform(&out->xform[out->num_xforms-1],&cp1->xform[j]); + flam3_copy_xform(&out->xform[i],&cp1->xform[j]); } /* Put the final xform last (if there is one) */ |