summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarianne Arnold <pixelma@rockbox.org>2007-10-16 20:44:17 +0000
committerMarianne Arnold <pixelma@rockbox.org>2007-10-16 20:44:17 +0000
commit4bd1aacbc43da9056d56cc428735435231cc8c56 (patch)
treee25cf958cf7ef62aa69238ab999e89bf111b202a
parentd9b1f4065513096321cfbbd88f77c964969047db (diff)
downloadrockbox-4bd1aacbc43da9056d56cc428735435231cc8c56.tar.gz
rockbox-4bd1aacbc43da9056d56cc428735435231cc8c56.zip
Mandelbrot: make increasing/decreasing iterations on X5/M5 actually usable (the buttoncombo was not possible before) and add necessary _PRE definitions to the defines and the button loop to prevent repeating the event accidentally (on some targets there was no control about how many steps one actually zoomed out on one button 'press'). Update the menu accordingly and fill out the blanks...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15153 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/mandelbrot.c106
-rw-r--r--manual/plugins/mandelbrot.tex94
2 files changed, 115 insertions, 85 deletions
diff --git a/apps/plugins/mandelbrot.c b/apps/plugins/mandelbrot.c
index 3ead7e0509..a1a86c8d87 100644
--- a/apps/plugins/mandelbrot.c
+++ b/apps/plugins/mandelbrot.c
@@ -95,30 +95,34 @@ PLUGIN_HEADER
95#define MANDELBROT_RESET (BUTTON_SELECT | BUTTON_PLAY) 95#define MANDELBROT_RESET (BUTTON_SELECT | BUTTON_PLAY)
96 96
97#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD 97#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
98#define MANDELBROT_QUIT BUTTON_POWER 98#define MANDELBROT_QUIT BUTTON_POWER
99#define MANDELBROT_UP BUTTON_UP 99#define MANDELBROT_UP BUTTON_UP
100#define MANDELBROT_DOWN BUTTON_DOWN 100#define MANDELBROT_DOWN BUTTON_DOWN
101#define MANDELBROT_LEFT BUTTON_LEFT 101#define MANDELBROT_LEFT BUTTON_LEFT
102#define MANDELBROT_RIGHT BUTTON_RIGHT 102#define MANDELBROT_RIGHT BUTTON_RIGHT
103#define MANDELBROT_ZOOM_IN_PRE BUTTON_SELECT 103#define MANDELBROT_ZOOM_IN_PRE BUTTON_SELECT
104#define MANDELBROT_ZOOM_IN (BUTTON_SELECT | BUTTON_REL) 104#define MANDELBROT_ZOOM_IN (BUTTON_SELECT | BUTTON_REL)
105#define MANDELBROT_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT) 105#define MANDELBROT_ZOOM_OUT_PRE BUTTON_SELECT
106#define MANDELBROT_MAXITER_INC (BUTTON_PLAY | BUTTON_RIGHT) 106#define MANDELBROT_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT)
107#define MANDELBROT_MAXITER_DEC (BUTTON_PLAY | BUTTON_LEFT) 107#define MANDELBROT_MAXITER_INC_PRE BUTTON_PLAY
108#define MANDELBROT_RESET BUTTON_REC 108#define MANDELBROT_MAXITER_INC (BUTTON_PLAY | BUTTON_REL)
109#define MANDELBROT_MAXITER_DEC_PRE BUTTON_PLAY
110#define MANDELBROT_MAXITER_DEC (BUTTON_PLAY | BUTTON_REPEAT)
111#define MANDELBROT_RESET BUTTON_REC
109 112
110#elif CONFIG_KEYPAD == GIGABEAT_PAD 113#elif CONFIG_KEYPAD == GIGABEAT_PAD
111#define MANDELBROT_QUIT BUTTON_POWER 114#define MANDELBROT_QUIT BUTTON_POWER
112#define MANDELBROT_UP BUTTON_UP 115#define MANDELBROT_UP BUTTON_UP
113#define MANDELBROT_DOWN BUTTON_DOWN 116#define MANDELBROT_DOWN BUTTON_DOWN
114#define MANDELBROT_LEFT BUTTON_LEFT 117#define MANDELBROT_LEFT BUTTON_LEFT
115#define MANDELBROT_RIGHT BUTTON_RIGHT 118#define MANDELBROT_RIGHT BUTTON_RIGHT
116#define MANDELBROT_ZOOM_IN_PRE BUTTON_SELECT 119#define MANDELBROT_ZOOM_IN_PRE BUTTON_SELECT
117#define MANDELBROT_ZOOM_IN (BUTTON_SELECT | BUTTON_REL) 120#define MANDELBROT_ZOOM_IN (BUTTON_SELECT | BUTTON_REL)
118#define MANDELBROT_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT) 121#define MANDELBROT_ZOOM_OUT_PRE BUTTON_SELECT
119#define MANDELBROT_MAXITER_INC BUTTON_VOL_UP 122#define MANDELBROT_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT)
120#define MANDELBROT_MAXITER_DEC BUTTON_VOL_DOWN 123#define MANDELBROT_MAXITER_INC BUTTON_VOL_UP
121#define MANDELBROT_RESET BUTTON_A 124#define MANDELBROT_MAXITER_DEC BUTTON_VOL_DOWN
125#define MANDELBROT_RESET BUTTON_A
122 126
123#elif CONFIG_KEYPAD == SANSA_E200_PAD 127#elif CONFIG_KEYPAD == SANSA_E200_PAD
124#define MANDELBROT_QUIT BUTTON_POWER 128#define MANDELBROT_QUIT BUTTON_POWER
@@ -145,30 +149,32 @@ PLUGIN_HEADER
145#define MANDELBROT_RESET BUTTON_REC 149#define MANDELBROT_RESET BUTTON_REC
146 150
147#elif CONFIG_KEYPAD == IRIVER_H10_PAD 151#elif CONFIG_KEYPAD == IRIVER_H10_PAD
148#define MANDELBROT_QUIT BUTTON_POWER 152#define MANDELBROT_QUIT BUTTON_POWER
149#define MANDELBROT_UP BUTTON_SCROLL_UP 153#define MANDELBROT_UP BUTTON_SCROLL_UP
150#define MANDELBROT_DOWN BUTTON_SCROLL_DOWN 154#define MANDELBROT_DOWN BUTTON_SCROLL_DOWN
151#define MANDELBROT_LEFT BUTTON_LEFT 155#define MANDELBROT_LEFT BUTTON_LEFT
152#define MANDELBROT_RIGHT BUTTON_RIGHT 156#define MANDELBROT_RIGHT BUTTON_RIGHT
153#define MANDELBROT_ZOOM_IN_PRE BUTTON_PLAY 157#define MANDELBROT_ZOOM_IN_PRE BUTTON_PLAY
154#define MANDELBROT_ZOOM_IN (BUTTON_PLAY | BUTTON_REL) 158#define MANDELBROT_ZOOM_IN (BUTTON_PLAY | BUTTON_REL)
155#define MANDELBROT_ZOOM_OUT (BUTTON_PLAY | BUTTON_REPEAT) 159#define MANDELBROT_ZOOM_OUT_PRE BUTTON_PLAY
156#define MANDELBROT_MAXITER_INC BUTTON_FF 160#define MANDELBROT_ZOOM_OUT (BUTTON_PLAY | BUTTON_REPEAT)
157#define MANDELBROT_MAXITER_DEC BUTTON_REW 161#define MANDELBROT_MAXITER_INC BUTTON_FF
158#define MANDELBROT_RESET (BUTTON_PLAY | BUTTON_REW) 162#define MANDELBROT_MAXITER_DEC BUTTON_REW
163#define MANDELBROT_RESET (BUTTON_PLAY | BUTTON_REW)
159 164
160#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD 165#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
161#define MANDELBROT_QUIT BUTTON_EQ 166#define MANDELBROT_QUIT BUTTON_EQ
162#define MANDELBROT_UP BUTTON_UP 167#define MANDELBROT_UP BUTTON_UP
163#define MANDELBROT_DOWN BUTTON_DOWN 168#define MANDELBROT_DOWN BUTTON_DOWN
164#define MANDELBROT_LEFT BUTTON_LEFT 169#define MANDELBROT_LEFT BUTTON_LEFT
165#define MANDELBROT_RIGHT BUTTON_RIGHT 170#define MANDELBROT_RIGHT BUTTON_RIGHT
166#define MANDELBROT_ZOOM_IN_PRE BUTTON_SELECT 171#define MANDELBROT_ZOOM_IN_PRE BUTTON_SELECT
167#define MANDELBROT_ZOOM_IN (BUTTON_SELECT | BUTTON_REL) 172#define MANDELBROT_ZOOM_IN (BUTTON_SELECT | BUTTON_REL)
168#define MANDELBROT_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT) 173#define MANDELBROT_ZOOM_OUT_PRE BUTTON_SELECT
169#define MANDELBROT_MAXITER_INC (BUTTON_PLAY | BUTTON_RIGHT) 174#define MANDELBROT_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT)
170#define MANDELBROT_MAXITER_DEC (BUTTON_PLAY | BUTTON_LEFT) 175#define MANDELBROT_MAXITER_INC (BUTTON_PLAY | BUTTON_RIGHT)
171#define MANDELBROT_RESET BUTTON_MODE 176#define MANDELBROT_MAXITER_DEC (BUTTON_PLAY | BUTTON_LEFT)
177#define MANDELBROT_RESET BUTTON_MODE
172 178
173#endif 179#endif
174 180
@@ -628,6 +634,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
628 return PLUGIN_OK; 634 return PLUGIN_OK;
629 635
630 case MANDELBROT_ZOOM_OUT: 636 case MANDELBROT_ZOOM_OUT:
637#ifdef MANDELBROT_ZOOM_OUT_PRE
638 if (lastbutton != MANDELBROT_ZOOM_OUT_PRE)
639 break;
640#endif
631 x_min -= x_delta; 641 x_min -= x_delta;
632 x_max += x_delta; 642 x_max += x_delta;
633 y_min -= y_delta; 643 y_min -= y_delta;
@@ -690,6 +700,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
690 break; 700 break;
691 701
692 case MANDELBROT_MAXITER_DEC: 702 case MANDELBROT_MAXITER_DEC:
703#ifdef MANDELBROT_MAXITER_DEC_PRE
704 if (lastbutton != MANDELBROT_MAXITER_DEC_PRE)
705 break;
706#endif
693 if (max_iter >= 15) { 707 if (max_iter >= 15) {
694 max_iter -= max_iter / 3; 708 max_iter -= max_iter / 3;
695 redraw = REDRAW_FULL; 709 redraw = REDRAW_FULL;
@@ -697,6 +711,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
697 break; 711 break;
698 712
699 case MANDELBROT_MAXITER_INC: 713 case MANDELBROT_MAXITER_INC:
714#ifdef MANDELBROT_MAXITER_INC_PRE
715 if (lastbutton != MANDELBROT_MAXITER_INC_PRE)
716 break;
717#endif
700 max_iter += max_iter / 2; 718 max_iter += max_iter / 2;
701 redraw = REDRAW_FULL; 719 redraw = REDRAW_FULL;
702 break; 720 break;
diff --git a/manual/plugins/mandelbrot.tex b/manual/plugins/mandelbrot.tex
index 7abe4f6c95..1f4e6d0a7a 100644
--- a/manual/plugins/mandelbrot.tex
+++ b/manual/plugins/mandelbrot.tex
@@ -3,45 +3,57 @@
3This demonstration draws fractal images from the Mandelbrot set 3This demonstration draws fractal images from the Mandelbrot set
4\opt{archos,h1xx}{using the greyscale engine}. 4\opt{archos,h1xx}{using the greyscale engine}.
5\begin{table} 5\begin{table}
6\begin{btnmap}{}{} 6 \begin{btnmap}{}{}
7Direction keys & Move about the image\\ 7 Direction keys
8\opt{RECORDER_PAD,IRIVER_H10_PAD}{\ButtonPlay} 8 & Move about the image\\
9\opt{ONDIO_PAD}{\ButtonMenu\ / \ButtonMenu+\ButtonUp} 9 %
10\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD}{\ButtonSelect} 10 \opt{RECORDER_PAD,IRIVER_H10_PAD}{\ButtonPlay}
11\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd} 11 \opt{ONDIO_PAD}{\ButtonMenu\ / \ButtonMenu+\ButtonUp}
12\opt{SANSA_E200_PAD}{\ButtonScrollDown} 12 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD}{\ButtonSelect}
13& Zoom in\\ 13 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd}
14\opt{RECORDER_PAD}{\ButtonOn} 14 \opt{SANSA_E200_PAD}{\ButtonScrollDown}
15\opt{ONDIO_PAD}{\ButtonMenu+\ButtonDown} 15 \opt{SANSA_C200_PAD}{\ButtonVolUp}
16\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 16 & Zoom in\\
17\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollBack} 17 %
18\opt{IAUDIO_X5_PAD}{Long \ButtonSelect} 18 \opt{RECORDER_PAD}{\ButtonOn}
19\opt{IRIVER_H10_PAD}{Long \ButtonPlay} 19 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonDown}
20\opt{SANSA_E200_PAD}{\ButtonScrollUp} 20 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
21& Zoom out\\ 21 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollBack}
22\opt{RECORDER_PAD}{\ButtonFOne} 22 \opt{IAUDIO_X5_PAD,GIGABEAT_PAD}{Long \ButtonSelect}
23\opt{ONDIO_PAD}{\ButtonMenu+\ButtonLeft} 23 \opt{IRIVER_H10_PAD}{Long \ButtonPlay}
24\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonLeft} 24 \opt{SANSA_E200_PAD}{\ButtonScrollUp}
25\opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD}{\ButtonSelect+\ButtonLeft} 25 \opt{SANSA_C200_PAD}{\ButtonVolDown}
26\opt{IAUDIO_X5_PAD}{\ButtonPlay+\ButtonLeft} 26 & Zoom out\\
27\opt{IRIVER_H10_PAD}{\ButtonRew} 27 %
28& Decrease iteration depth (less detail)\\ 28 \opt{RECORDER_PAD}{\ButtonFOne}
29\opt{RECORDER_PAD}{\ButtonFTwo} 29 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonLeft}
30\opt{ONDIO_PAD}{\ButtonMenu+\ButtonRight} 30 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonLeft}
31\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonRight} 31 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonSelect+\ButtonLeft}
32\opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD}{\ButtonSelect+\ButtonRight} 32 \opt{IAUDIO_X5_PAD}{Long \ButtonPlay}
33\opt{IAUDIO_X5_PAD}{\ButtonPlay+\ButtonRight} 33 \opt{IRIVER_H10_PAD}{\ButtonRew}
34\opt{IRIVER_H10_PAD}{\ButtonFF} 34 \opt{GIGABEAT_PAD}{\ButtonVolDown}
35& Increase iteration depth (more detail)\\ 35 & Decrease iteration depth (less detail)\\
36\opt{RECORDER_PAD}{\ButtonFThree} 36 %
37\opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff} 37 \opt{RECORDER_PAD}{\ButtonFTwo}
38\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD}{\ButtonRec} 38 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonRight}
39\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay} 39 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonRight}
40\opt{IRIVER_H10_PAD}{\ButtonPlay + \ButtonRew} 40 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonSelect+\ButtonRight}
41& Reset and return to the default image\\ 41 \opt{IAUDIO_X5_PAD}{\ButtonPlay}
42\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 42 \opt{IRIVER_H10_PAD}{\ButtonFF}
43\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 43 \opt{GIGABEAT_PAD}{\ButtonVolUp}
44\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD}{\ButtonPower} 44 & Increase iteration depth (more detail)\\
45& Quit\\ 45 %
46\end{btnmap} 46 \opt{RECORDER_PAD}{\ButtonFThree}
47 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff}
48 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}
49 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}
50 \opt{IRIVER_H10_PAD}{\ButtonPlay + \ButtonRew}
51 \opt{GIGABEAT_PAD}{\ButtonA}
52 & Reset and return to the default image\\
53 %
54 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
55 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
56 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,GIGABEAT_PAD}{\ButtonPower}
57 & Quit\\
58 \end{btnmap}
47\end{table} 59\end{table}