From e26d97658dafabe479eb249475c8508cb2eee910 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 14 Jul 2005 11:55:55 +0000 Subject: 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 --- apps/plugins/bounce.c | 10 +++++++--- 1 file 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++; } -- cgit