Skip to content

Commit

Permalink
UI code added
Browse files Browse the repository at this point in the history
  • Loading branch information
dbyrne committed Mar 19, 2010
1 parent 1e73f00 commit 77798a7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions native-src/FractalMath/FractalMath.c
Expand Up @@ -295,6 +295,14 @@ JNIEXPORT jintArray JNICALL Java_byrne_fractal_NativeLib_getFractalRow
y = (2*x*y) + Q*prev_y;
prev_x = tmp_prev_x;
prev_y = tmp_prev_y;
break;
case 11:
tmp_prev_x = x;
tmp_prev_y = y;
xtmp = (xsq - ysq) + P + Q*prev_x;
y = (2*x*y) + Q*prev_y;
prev_x = tmp_prev_x;
prev_y = tmp_prev_y;
}
x = xtmp;

Expand Down
2 changes: 2 additions & 0 deletions res/menu/options_menu.xml
Expand Up @@ -79,6 +79,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:title="Burning Ship: (|Re(Z(n))| + |Im(Z(n))|)^2 + C"/>
<item android:id="@+id/manowar_button"
android:title="Manowar: Z(n)^2 + Z(n-1) + C"/>
<item android:id="@+id/barnsley_button"
android:title="Barnsley Mandelbrot"/>
<item android:id="@+id/z4z3z2_button"
android:title="Z(n)^4 - Z(n)^3 - Z(n)^2 + C"/>
<item android:id="@+id/z6z2_button"
Expand Down
3 changes: 2 additions & 1 deletion src/byrne/fractal/ComplexEquation.java
Expand Up @@ -29,7 +29,8 @@ public enum ComplexEquation {
Z6Z2(7,6),
BURNING_SHIP(8,2),
MANOWAR(9,2),
PHOENIX(10,2);
PHOENIX(10,2),
BARNSLEY(11,2);

private int power, native_integer;

Expand Down
4 changes: 4 additions & 0 deletions src/byrne/fractal/Fractoid.java
Expand Up @@ -338,6 +338,10 @@ public boolean onOptionsItemSelected(MenuItem item) {
switchEquation(item,ComplexEquation.PHOENIX);
return true;

case R.id.barnsley_button:
switchEquation(item,ComplexEquation.BARNSLEY);
return true;

case R.id.escape_time_button:
switchAlgorithm(item,Algorithm.ESCAPE_TIME);
return true;
Expand Down

0 comments on commit 77798a7

Please sign in to comment.