diff options
| author | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-28 21:46:45 +0000 |
|---|---|---|
| committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-28 21:46:45 +0000 |
| commit | ab9fd1840b8025336081bd72fb9dbaea7b9909dd (patch) | |
| tree | 4c410bffcf1a9de2ce55a59bef45e3ecfa183a62 /apps/plugins/rockblox.c | |
| parent | 8418a2c94a97da1d6f42f21dc348aadd1e177d77 (diff) | |
| download | rockbox-ab9fd1840b8025336081bd72fb9dbaea7b9909dd.zip rockbox-ab9fd1840b8025336081bd72fb9dbaea7b9909dd.tar.gz rockbox-ab9fd1840b8025336081bd72fb9dbaea7b9909dd.tar.bz2 rockbox-ab9fd1840b8025336081bd72fb9dbaea7b9909dd.tar.xz | |
plugins: use lcd_putsf/lcd_putsxyf
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27926 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockblox.c')
| -rw-r--r-- | apps/plugins/rockblox.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index 90df401..44d637d 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -810,25 +810,18 @@ static void init_board (void) /* show the score, level and lines */ static void show_details (void) { - char str[25]; /* for strings */ - #ifdef HAVE_LCD_BITMAP #if LCD_DEPTH >= 2 rb->lcd_set_foreground (LCD_BLACK); rb->lcd_set_background (LCD_WHITE); #endif - rb->snprintf (str, sizeof (str), "%d", rockblox_status.score); - rb->lcd_putsxy (LABEL_X, SCORE_Y, str); - rb->snprintf (str, sizeof (str), "%d", rockblox_status.level); - rb->lcd_putsxy (LEVEL_X, LEVEL_Y, str); - rb->snprintf (str, sizeof (str), "%d", rockblox_status.lines); - rb->lcd_putsxy (LINES_X, LINES_Y, str); + rb->lcd_putsxyf (LABEL_X, SCORE_Y, "%d", rockblox_status.score); + rb->lcd_putsxyf (LEVEL_X, LEVEL_Y, "%d", rockblox_status.level); + rb->lcd_putsxyf (LINES_X, LINES_Y, "%d", rockblox_status.lines); #else /* HAVE_LCD_CHARCELLS */ - rb->snprintf (str, sizeof (str), "L%d/%d", rockblox_status.level, + rb->lcd_putsf (5, 0, "L%d/%d", rockblox_status.level, rockblox_status.lines); - rb->lcd_puts (5, 0, str); - rb->snprintf (str, sizeof (str), "S%d", rockblox_status.score); - rb->lcd_puts (5, 1, str); + rb->lcd_putsf (5, 1, "S%d", rockblox_status.score); #endif } @@ -836,14 +829,10 @@ static void show_details (void) static void show_highscores (void) { int i; - char str[25]; /* for strings */ for (i = 0; i<NUM_SCORES; i++) - { - rb->snprintf (str, sizeof (str), "%06d" _SPACE "L%1d", - highscores[i].score, highscores[i].level); - rb->lcd_putsxy (HIGH_LABEL_X, HIGH_SCORE_Y + (10 * i), str); - } + rb->lcd_putsxyf (HIGH_LABEL_X, HIGH_SCORE_Y + (10 * i), + "%06d" _SPACE "L%1d", highscores[i].score, highscores[i].level); } #endif |