diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2004-05-26 23:49:42 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2004-05-26 23:49:42 +0000 |
| commit | 7115cf1d503f63965988b60545701e566aa783d5 (patch) | |
| tree | b0c263da8b9aa096fb3b72fdc34788b7e686f1da /apps/plugins | |
| parent | 052d21a667ea75fe90b937478eb128c50b9f3154 (diff) | |
| download | rockbox-7115cf1d503f63965988b60545701e566aa783d5.zip rockbox-7115cf1d503f63965988b60545701e566aa783d5.tar.gz rockbox-7115cf1d503f63965988b60545701e566aa783d5.tar.bz2 rockbox-7115cf1d503f63965988b60545701e566aa783d5.tar.xz | |
Improved drawing speed by drawing whole columns at once (Matthias)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4707 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -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 106d4b6..450a4eb 100644 --- a/apps/plugins/mandelbrot.c +++ b/apps/plugins/mandelbrot.c @@ -34,6 +34,7 @@ static int delta; static int max_iter; static unsigned char *gbuf; static unsigned int gbuf_size = 0; +static unsigned char graybuffer[LCD_HEIGHT]; void init_mandelbrot_set(void){ @@ -56,18 +57,15 @@ void calc_mandelbrot_set(void){ start_tick = *rb->current_tick; -// rb->lcd_clear_display(); -// rb->lcd_update(); - gray_clear_display(); x_fact = (x_max - x_min) / LCD_WIDTH; y_fact = (y_max - y_min) / LCD_HEIGHT; + for (x_pixel = 0; x_pixel<LCD_WIDTH; x_pixel++){ + a = (x_pixel * x_fact) + x_min; for(y_pixel = LCD_HEIGHT-1; y_pixel>=0; y_pixel--){ b = (y_pixel * y_fact) + y_min; - for (x_pixel = LCD_WIDTH-1; x_pixel>=0; x_pixel--){ - a = (x_pixel * x_fact) + x_min; x = 0; y = 0; n_iter = 0; @@ -91,9 +89,9 @@ void calc_mandelbrot_set(void){ } else { brightness = 255 - (31 * (n_iter & 7)); } - - gray_drawpixel( x_pixel, y_pixel, brightness); + graybuffer[y_pixel]=brightness; } + gray_drawgraymap(graybuffer, x_pixel, 0, 1, LCD_HEIGHT, 1); } } |