diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2006-05-02 21:44:04 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2006-05-02 21:44:04 +0000 |
| commit | 93ff94949c465f6c41b8f0701240c90f2ae917a4 (patch) | |
| tree | 22a6da60277605a2ebdb4afc3efa7aa77d71f6f1 /apps/plugins | |
| parent | 982d995ae9c53ca1732add8a2e383fa527a57a3a (diff) | |
| download | rockbox-93ff94949c465f6c41b8f0701240c90f2ae917a4.zip rockbox-93ff94949c465f6c41b8f0701240c90f2ae917a4.tar.gz rockbox-93ff94949c465f6c41b8f0701240c90f2ae917a4.tar.bz2 rockbox-93ff94949c465f6c41b8f0701240c90f2ae917a4.tar.xz | |
Player: Credits plugin correctly working with UTF-8. Patch by Marcoen Hirschberg.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9862 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/credits.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/plugins/credits.c b/apps/plugins/credits.c index 12bfa60..b726771 100644 --- a/apps/plugins/credits.c +++ b/apps/plugins/credits.c @@ -58,7 +58,7 @@ void roll_credits(void) { int numnames = sizeof(credits)/sizeof(char*); int curr_name = 0; - int curr_len = rb->strlen(credits[0]); + int curr_len = rb->utf8length(credits[0]); int curr_index = 0; int curr_line = 0; int name, len, new_len, line, x; @@ -77,19 +77,20 @@ void roll_credits(void) int x2; if (x < 0) - rb->lcd_puts(0, line, credits[name] - x); + rb->lcd_puts(0, line, credits[name] + rb->utf8seek(credits[name], -x)); else rb->lcd_puts(x, line, credits[name]); if (++name >= numnames) break; + line ^= 1; x2 = x + len/2; if ((unsigned)x2 < 11) rb->lcd_putc(x2, line, '*'); - new_len = rb->strlen(credits[name]); + new_len = rb->utf8length(credits[name]); x += MAX(len/2 + 2, len - new_len/2 + 1); len = new_len; } @@ -101,7 +102,7 @@ void roll_credits(void) { if (++curr_name >= numnames) break; - new_len = rb->strlen(credits[curr_name]); + new_len = rb->utf8length(credits[curr_name]); curr_index -= MAX(curr_len/2 + 2, curr_len - new_len/2 + 1); curr_len = new_len; curr_line ^= 1; |