diff options
author | David Phillips <dbphillipsnz@gmail.com> | 2016-05-31 12:54:16 +1200 |
---|---|---|
committer | David Phillips <dbphillipsnz@gmail.com> | 2016-05-31 12:54:16 +1200 |
commit | f2371dcb179928b8b36587d822daeb919b7d2d84 (patch) | |
tree | 3b23b4913f3d9f4db3400bf2bd5822daff9c6157 /algorithms/burning-ship.c | |
parent | 7e946fd9d958c505c21a2206141256967616614c (diff) | |
parent | 7c3082e934b79f26afaa53c8b72cfbaaa76bdae4 (diff) | |
download | fractal-gen-f2371dcb179928b8b36587d822daeb919b7d2d84.tar.xz |
Merge branch 'pos'
Diffstat (limited to 'algorithms/burning-ship.c')
-rw-r--r-- | algorithms/burning-ship.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/algorithms/burning-ship.c b/algorithms/burning-ship.c index 56323ac..7e27e4b 100644 --- a/algorithms/burning-ship.c +++ b/algorithms/burning-ship.c @@ -31,18 +31,20 @@ void *generate_burning_ship_section(void *section) { data_section *d = (data_section*)section; + struct frame *f = &(d->parent_frame); unsigned int x,y,i; double a,b; double complex z,c; - double size_units = 3.5f; - double top = -2.2f; - double left = -2.2f; + + defaultsd(&d->parent_frame.scale, 3.5f); + defaultsd(&d->parent_frame.top, -2.2f); + defaultsd(&d->parent_frame.left, -2.2f); /* FIXME document this */ - b = clust_id*(size_units/size)+top; /* FIXME document this */ + b = clust_id*(f->scale/size)+f->top; /* FIXME document this */ for (y = clust_id; y < size; y += clust_total) { - a = d->core*(size_units/size)+left; + a = d->core*(f->scale/size)+f->left; for (x = d->core; x < size; x += cores) { z = 0; c = a+I*b; @@ -53,9 +55,9 @@ void z = cpow( fabs(creal(z)) + I*fabs(cimag(z)) , power) + c; } d->data[d->idx++] = (255*i)/iterat; - a += cores*(size_units/size); + a += cores*(f->scale/size); } - b += clust_total*(size_units/size); + b += clust_total*(f->scale/size); } return NULL; } |