summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-07-14 11:55:55 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-07-14 11:55:55 +0000
commite26d97658dafabe479eb249475c8508cb2eee910 (patch)
tree22813366d56e858f8f4567c5e99d780ca6a56be1
parent1c47599312180d4718a9fa1f34956b895986ed3d (diff)
downloadrockbox-e26d97658dafabe479eb249475c8508cb2eee910.tar.gz
rockbox-e26d97658dafabe479eb249475c8508cb2eee910.zip
The scroll mode now takes advantage of the clipping support in the new
graphics lib and makes the left-side nice and smooth. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7139 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/bounce.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index 676d8fe169..34625a7853 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -100,6 +100,8 @@ static signed char speed[]={
1,2,3,3,3,2,1,0,-1,-2,-2,-2,-1,0,0,1,
};
+#define LETTER_WIDTH 12 /* pixels wide */
+
const unsigned char char_gen_12x16[][22] =
{
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
@@ -277,6 +279,8 @@ static void addclock(void)
}
#endif /* HAVE_RTC */
+#define DRAW_WIDTH (LCD_WIDTH + LETTER_WIDTH)
+
static int scrollit(void)
{
int b;
@@ -312,7 +316,7 @@ static int scrollit(void)
rb->lcd_mono_bitmap((char *)char_gen_12x16[letter-0x20],
xx, table[yy&(TABLE_SIZE-1)], 11, 16);
yy += YADD;
- xx+= LCD_WIDTH/LETTERS_ON_SCREEN;
+ xx+= DRAW_WIDTH/LETTERS_ON_SCREEN;
}
rb->lcd_set_drawmode(DRMODE_SOLID);
#ifdef HAVE_RTC
@@ -322,8 +326,8 @@ static int scrollit(void)
x-= XSPEED;
- if(x < 0) {
- x += LCD_WIDTH/LETTERS_ON_SCREEN;
+ if(x < -LETTER_WIDTH) {
+ x += DRAW_WIDTH/LETTERS_ON_SCREEN;
y += YADD;
textpos++;
}