1
0
Fork 0
forked from len0rd/rockbox

Pluginlib: make scroll functions clear screen if scrolled by >= screen size (from FS#10330)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23211 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Torne Wuff 2009-10-16 20:15:12 +00:00
parent a3f0a45c0f
commit 27ece8c366
2 changed files with 60 additions and 0 deletions

View file

@ -37,7 +37,10 @@ void grey_scroll_left(int count)
int length, blank; int length, blank;
if ((unsigned)count >= (unsigned)_grey_info.width) if ((unsigned)count >= (unsigned)_grey_info.width)
{
grey_clear_display();
return; return;
}
data = _grey_info.buffer; data = _grey_info.buffer;
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height); data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
@ -62,7 +65,10 @@ void grey_scroll_right(int count)
int length, blank; int length, blank;
if ((unsigned)count >= (unsigned)_grey_info.width) if ((unsigned)count >= (unsigned)_grey_info.width)
{
grey_clear_display();
return; return;
}
data = _grey_info.buffer; data = _grey_info.buffer;
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height); data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
@ -86,7 +92,10 @@ void grey_scroll_up(int count)
int blank; int blank;
if ((unsigned)count >= (unsigned)_grey_info.height) if ((unsigned)count >= (unsigned)_grey_info.height)
{
grey_clear_display();
return; return;
}
shift = _GREY_MULUQ(_grey_info.width, count); shift = _GREY_MULUQ(_grey_info.width, count);
length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count); length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count);
@ -105,7 +114,10 @@ void grey_scroll_down(int count)
int blank; int blank;
if ((unsigned)count >= (unsigned)_grey_info.height) if ((unsigned)count >= (unsigned)_grey_info.height)
{
grey_clear_display();
return; return;
}
shift = _GREY_MULUQ(_grey_info.width, count); shift = _GREY_MULUQ(_grey_info.width, count);
length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count); length = _GREY_MULUQ(_grey_info.width, _grey_info.height - count);
@ -126,7 +138,10 @@ void grey_ub_scroll_left(int count)
int blank, length; int blank, length;
if ((unsigned)count >= (unsigned)_grey_info.width) if ((unsigned)count >= (unsigned)_grey_info.width)
{
grey_ub_clear_display();
return; return;
}
data = _grey_info.values; data = _grey_info.values;
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height); data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
@ -156,7 +171,10 @@ void grey_ub_scroll_right(int count)
int blank, length; int blank, length;
if ((unsigned)count >= (unsigned)_grey_info.width) if ((unsigned)count >= (unsigned)_grey_info.width)
{
grey_ub_clear_display();
return; return;
}
data = _grey_info.values; data = _grey_info.values;
data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height); data_end = data + _GREY_MULUQ(_grey_info.width, _grey_info.height);
@ -185,7 +203,10 @@ void grey_ub_scroll_up(int count)
int blank; int blank;
if ((unsigned)count >= (unsigned)_grey_info.height) if ((unsigned)count >= (unsigned)_grey_info.height)
{
grey_ub_clear_display();
return; return;
}
dst = _grey_info.values; dst = _grey_info.values;
end = dst + _GREY_MULUQ(_grey_info.height, _grey_info.width); end = dst + _GREY_MULUQ(_grey_info.height, _grey_info.width);
@ -257,7 +278,10 @@ void grey_ub_scroll_down(int count)
int blank; int blank;
if ((unsigned)count >= (unsigned)_grey_info.height) if ((unsigned)count >= (unsigned)_grey_info.height)
{
grey_ub_clear_display();
return; return;
}
start = _grey_info.values; start = _grey_info.values;
dst = start + _GREY_MULUQ(_grey_info.height, _grey_info.width); dst = start + _GREY_MULUQ(_grey_info.height, _grey_info.width);

View file

@ -37,7 +37,10 @@ void xlcd_scroll_left(int count)
int length, oldmode; int length, oldmode;
if ((unsigned)count >= LCD_WIDTH) if ((unsigned)count >= LCD_WIDTH)
{
rb->lcd_clear_display();
return; return;
}
length = (LCD_WIDTH-count)*LCD_FBHEIGHT; length = (LCD_WIDTH-count)*LCD_FBHEIGHT;
@ -56,7 +59,10 @@ void xlcd_scroll_right(int count)
int length, oldmode; int length, oldmode;
if ((unsigned)count >= LCD_WIDTH) if ((unsigned)count >= LCD_WIDTH)
{
rb->lcd_clear_display();
return; return;
}
length = (LCD_WIDTH-count)*LCD_FBHEIGHT; length = (LCD_WIDTH-count)*LCD_FBHEIGHT;
@ -77,7 +83,10 @@ void xlcd_scroll_up(int count)
fb_data *data; fb_data *data;
if ((unsigned)count >= LCD_HEIGHT) if ((unsigned)count >= LCD_HEIGHT)
{
rb->lcd_clear_display();
return; return;
}
length = LCD_HEIGHT - count; length = LCD_HEIGHT - count;
@ -103,7 +112,10 @@ void xlcd_scroll_down(int count)
fb_data *data; fb_data *data;
if ((unsigned)count >= LCD_HEIGHT) if ((unsigned)count >= LCD_HEIGHT)
{
rb->lcd_clear_display();
return; return;
}
length = LCD_HEIGHT - count; length = LCD_HEIGHT - count;
@ -131,7 +143,10 @@ void xlcd_scroll_left(int count)
int blockcount, blocklen; int blockcount, blocklen;
if ((unsigned) count >= LCD_WIDTH) if ((unsigned) count >= LCD_WIDTH)
{
rb->lcd_clear_display();
return; return;
}
#if LCD_DEPTH == 2 #if LCD_DEPTH == 2
blockcount = count >> 2; blockcount = count >> 2;
@ -186,7 +201,10 @@ void xlcd_scroll_right(int count)
int blockcount, blocklen; int blockcount, blocklen;
if ((unsigned) count >= LCD_WIDTH) if ((unsigned) count >= LCD_WIDTH)
{
rb->lcd_clear_display();
return; return;
}
#if LCD_DEPTH == 2 #if LCD_DEPTH == 2
blockcount = count >> 2; blockcount = count >> 2;
@ -243,7 +261,10 @@ void xlcd_scroll_left(int count)
int length, oldmode; int length, oldmode;
if ((unsigned)count >= LCD_WIDTH) if ((unsigned)count >= LCD_WIDTH)
{
rb->lcd_clear_display();
return; return;
}
data = rb->lcd_framebuffer; data = rb->lcd_framebuffer;
data_end = data + LCD_WIDTH*LCD_FBHEIGHT; data_end = data + LCD_WIDTH*LCD_FBHEIGHT;
@ -269,7 +290,10 @@ void xlcd_scroll_right(int count)
int length, oldmode; int length, oldmode;
if ((unsigned)count >= LCD_WIDTH) if ((unsigned)count >= LCD_WIDTH)
{
rb->lcd_clear_display();
return; return;
}
data = rb->lcd_framebuffer; data = rb->lcd_framebuffer;
data_end = data + LCD_WIDTH*LCD_FBHEIGHT; data_end = data + LCD_WIDTH*LCD_FBHEIGHT;
@ -298,7 +322,10 @@ void xlcd_scroll_up(int count)
int length, oldmode; int length, oldmode;
if ((unsigned)count >= LCD_HEIGHT) if ((unsigned)count >= LCD_HEIGHT)
{
rb->lcd_clear_display();
return; return;
}
length = LCD_HEIGHT - count; length = LCD_HEIGHT - count;
@ -318,7 +345,10 @@ void xlcd_scroll_down(int count)
int length, oldmode; int length, oldmode;
if ((unsigned)count >= LCD_HEIGHT) if ((unsigned)count >= LCD_HEIGHT)
{
rb->lcd_clear_display();
return; return;
}
length = LCD_HEIGHT - count; length = LCD_HEIGHT - count;
@ -342,7 +372,10 @@ void xlcd_scroll_up(int count)
int blockcount, blocklen; int blockcount, blocklen;
if ((unsigned) count >= LCD_HEIGHT) if ((unsigned) count >= LCD_HEIGHT)
{
rb->lcd_clear_display();
return; return;
}
#if (LCD_DEPTH == 1) \ #if (LCD_DEPTH == 1) \
|| (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED)
@ -536,7 +569,10 @@ void xlcd_scroll_down(int count)
int blockcount, blocklen; int blockcount, blocklen;
if ((unsigned) count >= LCD_HEIGHT) if ((unsigned) count >= LCD_HEIGHT)
{
rb->lcd_clear_display();
return; return;
}
#if (LCD_DEPTH == 1) \ #if (LCD_DEPTH == 1) \
|| (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) || (LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED)