forked from len0rd/rockbox
zen/zenxfi: correctly implement partial redraw
Although there is no difference in the cost of a full or partial update, it is preferable that the semantic of lcd_update_rect() be correct. Change-Id: I8a168388b98e0dbd7237729b7fd8a62fa1885be1
This commit is contained in:
parent
7bbdcc1c3b
commit
a54c4ab7d4
1 changed files with 9 additions and 7 deletions
|
@ -339,13 +339,15 @@ void lcd_update_rect(int x, int y, int w, int h)
|
||||||
if(!lcd_on)
|
if(!lcd_on)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
uint8_t *p = FRAME;
|
for(int yy = y; yy < y + h; yy++)
|
||||||
for(int y = 0; y < LCD_HEIGHT; y++)
|
|
||||||
for(int x = 0; x < LCD_WIDTH; x++)
|
|
||||||
{
|
{
|
||||||
uint16_t pix = *FBADDR(x,y);
|
uint16_t *pix = FBADDR(x, yy);
|
||||||
*p++ = RGB_UNPACK_RED(pix);
|
uint8_t *p = 3 * (yy * LCD_WIDTH + x) + (uint8_t *)FRAME;
|
||||||
*p++ = RGB_UNPACK_GREEN(pix);
|
for(int xx = 0; xx < w; xx++, pix++)
|
||||||
*p++ = RGB_UNPACK_BLUE(pix);
|
{
|
||||||
|
*p++ = RGB_UNPACK_RED(*pix);
|
||||||
|
*p++ = RGB_UNPACK_GREEN(*pix);
|
||||||
|
*p++ = RGB_UNPACK_BLUE(*pix);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue