mirror of
https://github.com/scottdraves/flam3.git
synced 2025-01-21 05:20:05 -05:00
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
This commit is contained in:
parent
0346f58852
commit
16b94f9257
13
src/flam3.c
13
src/flam3.c
@ -2567,6 +2567,9 @@ void flam3_add_symmetry(flam3_genome *cp, int sym) {
|
|||||||
if (sym < 0) {
|
if (sym < 0) {
|
||||||
|
|
||||||
i = cp->num_xforms;
|
i = cp->num_xforms;
|
||||||
|
if (cp->final_xform_enable)
|
||||||
|
i -= 1;
|
||||||
|
|
||||||
flam3_add_xforms(cp,1,0,0);
|
flam3_add_xforms(cp,1,0,0);
|
||||||
|
|
||||||
cp->xform[i].density = 1.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++) {
|
for (k = 1; k < sym; k++) {
|
||||||
|
|
||||||
i = cp->num_xforms;
|
i = cp->num_xforms;
|
||||||
|
if (cp->final_xform_enable)
|
||||||
|
i -= 1;
|
||||||
|
|
||||||
flam3_add_xforms(cp, 1, 0,0);
|
flam3_add_xforms(cp, 1, 0,0);
|
||||||
|
|
||||||
cp->xform[i].density = 1.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. */
|
/* Default behavior keeps the final from parent0. */
|
||||||
if (cp1->final_xform_index == j)
|
if (cp1->final_xform_index == j)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
i = out->num_xforms;
|
||||||
|
if (out->final_xform_enable)
|
||||||
|
i -= 1;
|
||||||
|
|
||||||
flam3_add_xforms(out, 1, 0, 0);
|
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) */
|
/* Put the final xform last (if there is one) */
|
||||||
|
Loading…
Reference in New Issue
Block a user