forked from len0rd/rockbox
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
This commit is contained in:
parent
052d21a667
commit
7115cf1d50
1 changed files with 5 additions and 7 deletions
|
|
@ -34,6 +34,7 @@ static int delta;
|
||||||
static int max_iter;
|
static int max_iter;
|
||||||
static unsigned char *gbuf;
|
static unsigned char *gbuf;
|
||||||
static unsigned int gbuf_size = 0;
|
static unsigned int gbuf_size = 0;
|
||||||
|
static unsigned char graybuffer[LCD_HEIGHT];
|
||||||
|
|
||||||
|
|
||||||
void init_mandelbrot_set(void){
|
void init_mandelbrot_set(void){
|
||||||
|
|
@ -56,18 +57,15 @@ void calc_mandelbrot_set(void){
|
||||||
|
|
||||||
start_tick = *rb->current_tick;
|
start_tick = *rb->current_tick;
|
||||||
|
|
||||||
// rb->lcd_clear_display();
|
|
||||||
// rb->lcd_update();
|
|
||||||
|
|
||||||
gray_clear_display();
|
gray_clear_display();
|
||||||
|
|
||||||
x_fact = (x_max - x_min) / LCD_WIDTH;
|
x_fact = (x_max - x_min) / LCD_WIDTH;
|
||||||
y_fact = (y_max - y_min) / LCD_HEIGHT;
|
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--){
|
for(y_pixel = LCD_HEIGHT-1; y_pixel>=0; y_pixel--){
|
||||||
b = (y_pixel * y_fact) + y_min;
|
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;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
n_iter = 0;
|
n_iter = 0;
|
||||||
|
|
@ -91,9 +89,9 @@ void calc_mandelbrot_set(void){
|
||||||
} else {
|
} else {
|
||||||
brightness = 255 - (31 * (n_iter & 7));
|
brightness = 255 - (31 * (n_iter & 7));
|
||||||
}
|
}
|
||||||
|
graybuffer[y_pixel]=brightness;
|
||||||
gray_drawpixel( x_pixel, y_pixel, brightness);
|
|
||||||
}
|
}
|
||||||
|
gray_drawgraymap(graybuffer, x_pixel, 0, 1, LCD_HEIGHT, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue