diff options
-rw-r--r-- | apps/plugins/mandelbrot.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/plugins/mandelbrot.c b/apps/plugins/mandelbrot.c index 106d4b69f7..450a4ebfee 100644 --- a/apps/plugins/mandelbrot.c +++ b/apps/plugins/mandelbrot.c | |||
@@ -34,6 +34,7 @@ static int delta; | |||
34 | static int max_iter; | 34 | static int max_iter; |
35 | static unsigned char *gbuf; | 35 | static unsigned char *gbuf; |
36 | static unsigned int gbuf_size = 0; | 36 | static unsigned int gbuf_size = 0; |
37 | static unsigned char graybuffer[LCD_HEIGHT]; | ||
37 | 38 | ||
38 | 39 | ||
39 | void init_mandelbrot_set(void){ | 40 | void init_mandelbrot_set(void){ |
@@ -56,18 +57,15 @@ void calc_mandelbrot_set(void){ | |||
56 | 57 | ||
57 | start_tick = *rb->current_tick; | 58 | start_tick = *rb->current_tick; |
58 | 59 | ||
59 | // rb->lcd_clear_display(); | ||
60 | // rb->lcd_update(); | ||
61 | |||
62 | gray_clear_display(); | 60 | gray_clear_display(); |
63 | 61 | ||
64 | x_fact = (x_max - x_min) / LCD_WIDTH; | 62 | x_fact = (x_max - x_min) / LCD_WIDTH; |
65 | y_fact = (y_max - y_min) / LCD_HEIGHT; | 63 | y_fact = (y_max - y_min) / LCD_HEIGHT; |
66 | 64 | ||
65 | for (x_pixel = 0; x_pixel<LCD_WIDTH; x_pixel++){ | ||
66 | a = (x_pixel * x_fact) + x_min; | ||
67 | for(y_pixel = LCD_HEIGHT-1; y_pixel>=0; y_pixel--){ | 67 | for(y_pixel = LCD_HEIGHT-1; y_pixel>=0; y_pixel--){ |
68 | b = (y_pixel * y_fact) + y_min; | 68 | b = (y_pixel * y_fact) + y_min; |
69 | for (x_pixel = LCD_WIDTH-1; x_pixel>=0; x_pixel--){ | ||
70 | a = (x_pixel * x_fact) + x_min; | ||
71 | x = 0; | 69 | x = 0; |
72 | y = 0; | 70 | y = 0; |
73 | n_iter = 0; | 71 | n_iter = 0; |
@@ -91,9 +89,9 @@ void calc_mandelbrot_set(void){ | |||
91 | } else { | 89 | } else { |
92 | brightness = 255 - (31 * (n_iter & 7)); | 90 | brightness = 255 - (31 * (n_iter & 7)); |
93 | } | 91 | } |
94 | 92 | graybuffer[y_pixel]=brightness; | |
95 | gray_drawpixel( x_pixel, y_pixel, brightness); | ||
96 | } | 93 | } |
94 | gray_drawgraymap(graybuffer, x_pixel, 0, 1, LCD_HEIGHT, 1); | ||
97 | } | 95 | } |
98 | } | 96 | } |
99 | 97 | ||