forked from len0rd/rockbox
LCD scrolling - reduce one 'if' nesting level
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23125 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
aee6901953
commit
461903d80e
1 changed files with 37 additions and 37 deletions
|
@ -214,6 +214,8 @@ void LCDFN(puts_offset)(int x, int y, const unsigned char *str, int offset)
|
||||||
void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
|
void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
|
||||||
int style, int offset)
|
int style, int offset)
|
||||||
{
|
{
|
||||||
|
struct scrollinfo* s;
|
||||||
|
char *end;
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
if ((unsigned)y >= (unsigned)current_vp->height)
|
if ((unsigned)y >= (unsigned)current_vp->height)
|
||||||
|
@ -229,15 +231,14 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
|
||||||
|
|
||||||
LCDFN(getstringsize)(string, &w, &h);
|
LCDFN(getstringsize)(string, &w, &h);
|
||||||
|
|
||||||
if (current_vp->width - x * 8 < w) {
|
if (current_vp->width - x * 8 >= w)
|
||||||
|
return;
|
||||||
|
|
||||||
/* prepare scroll line */
|
/* prepare scroll line */
|
||||||
struct scrollinfo* s;
|
|
||||||
s = &LCDFN(scroll_info).scroll[LCDFN(scroll_info).lines];
|
s = &LCDFN(scroll_info).scroll[LCDFN(scroll_info).lines];
|
||||||
s->start_tick = current_tick + LCDFN(scroll_info).delay;
|
s->start_tick = current_tick + LCDFN(scroll_info).delay;
|
||||||
s->style = style;
|
s->style = style;
|
||||||
|
|
||||||
char *end;
|
|
||||||
|
|
||||||
memset(s->line, 0, sizeof s->line);
|
memset(s->line, 0, sizeof s->line);
|
||||||
strcpy(s->line, string);
|
strcpy(s->line, string);
|
||||||
|
|
||||||
|
@ -271,7 +272,6 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
|
||||||
|
|
||||||
LCDFN(scroll_info).lines++;
|
LCDFN(scroll_info).lines++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void LCDFN(puts_scroll)(int x, int y, const unsigned char *string)
|
void LCDFN(puts_scroll)(int x, int y, const unsigned char *string)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue