1
0
Fork 0
forked from len0rd/rockbox

Respect the 'scroll delay' setting more accurately between scrolling rounds

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29123 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Alexander Levin 2011-01-23 21:49:49 +00:00
parent 480c663e5b
commit fb2d6a7a3a
2 changed files with 20 additions and 9 deletions

View file

@ -435,6 +435,7 @@ void LCDFN(scroll_fn)(void)
int index;
int xpos, ypos;
struct viewport* old_vp = current_vp;
bool makedelay = false;
for ( index = 0; index < LCDFN(scroll_info).lines; index++ ) {
s = &LCDFN(scroll_info).scroll[index];
@ -459,22 +460,27 @@ void LCDFN(scroll_fn)(void)
/* at beginning of line */
s->offset = 0;
s->backward = false;
s->start_tick = current_tick + LCDFN(scroll_info).delay * 2;
makedelay = true;
}
if (s->offset >= s->width - (current_vp->width - xpos)) {
else if (s->offset >= s->width - (current_vp->width - xpos)) {
/* at end of line */
s->offset = s->width - (current_vp->width - xpos);
s->backward = true;
s->start_tick = current_tick + LCDFN(scroll_info).delay * 2;
makedelay = true;
}
}
else {
/* scroll forward the whole time */
if (s->offset >= s->width) {
s->offset = 0;
s->start_tick = current_tick + LCDFN(scroll_info).delay * 2;
makedelay = true;
}
}
if (makedelay)
s->start_tick = current_tick + LCDFN(scroll_info).delay +
LCDFN(scroll_info).ticks;
LCDFN(putsxyofs_style)(xpos, ypos, s->line, s->style, s->width,
pf->height, s->offset);
LCDFN(update_viewport_rect)(xpos, ypos, current_vp->width - xpos,

View file

@ -569,6 +569,7 @@ void lcd_scroll_fn(void)
int xpos, ypos;
bool update;
struct viewport* old_vp = current_vp;
bool makedelay = false;
update = false;
for ( index = 0; index < lcd_scroll_info.lines; index++ ) {
@ -594,23 +595,27 @@ void lcd_scroll_fn(void)
/* at beginning of line */
s->offset = 0;
s->backward = false;
s->start_tick = current_tick + lcd_scroll_info.delay * 2;
makedelay = true;
}
if (s->offset >= s->len - (current_vp->width - xpos)) {
else if (s->offset >= s->len - (current_vp->width - xpos)) {
/* at end of line */
s->offset = s->len - (current_vp->width - xpos);
s->backward = true;
s->start_tick = current_tick + lcd_scroll_info.delay * 2;
makedelay = true;
}
}
else /* scroll forward the whole time */
{
if (s->offset >= s->len) {
s->offset = 0;
s->start_tick = current_tick + lcd_scroll_info.delay * 2;
makedelay = true;
}
}
if (makedelay)
s->start_tick = current_tick + lcd_scroll_info.delay +
lcd_scroll_info.ticks;
lcd_putsxyofs(xpos, ypos, s->offset, s->line);
update = true;
}