diff options
| author | Karl Kurbjun <kkurbjun@gmail.com> | 2009-08-03 01:07:58 +0000 |
|---|---|---|
| committer | Karl Kurbjun <kkurbjun@gmail.com> | 2009-08-03 01:07:58 +0000 |
| commit | 50d3928901069d908238930b880b878f3d760dd4 (patch) | |
| tree | 81babdb7ab853d60502910e04c16ae29f14a9e73 /apps/plugins/lib | |
| parent | bbc9aebae3ec6e900abdf257a0b377a0f5b45911 (diff) | |
| download | rockbox-50d3928901069d908238930b880b878f3d760dd4.zip rockbox-50d3928901069d908238930b880b878f3d760dd4.tar.gz rockbox-50d3928901069d908238930b880b878f3d760dd4.tar.bz2 rockbox-50d3928901069d908238930b880b878f3d760dd4.tar.xz | |
Blackjack: Use standard menu and add playback menu, use pluginlib high scores.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22126 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib')
| -rw-r--r-- | apps/plugins/lib/highscore.c | 17 | ||||
| -rw-r--r-- | apps/plugins/lib/highscore.h | 4 |
2 files changed, 15 insertions, 6 deletions
diff --git a/apps/plugins/lib/highscore.c b/apps/plugins/lib/highscore.c index 909c3a8..280c0c7 100644 --- a/apps/plugins/lib/highscore.c +++ b/apps/plugins/lib/highscore.c @@ -120,7 +120,7 @@ bool highscore_would_update(int score, struct highscore *scores, } #ifdef HAVE_LCD_BITMAP -void highscore_show(int position, struct highscore *scores, int num_scores) +void highscore_show(int position, struct highscore *scores, int num_scores, bool show_level) { int i, w, h; char str[30]; @@ -141,7 +141,11 @@ void highscore_show(int position, struct highscore *scores, int num_scores) } rb->lcd_putsxy(LCD_WIDTH/2-w/2, MARGIN, "High Scores"); rb->lcd_putsxy(LCD_WIDTH/4-w/4,2*h, "Score"); - rb->lcd_putsxy(LCD_WIDTH*3/4-w/4,2*h, "Level"); + + /* Decide whether to display the level column or not */ + if(show_level) { + rb->lcd_putsxy(LCD_WIDTH*3/4-w/4,2*h, "Level"); + } for (i = 0; i<num_scores; i++) { @@ -154,8 +158,13 @@ void highscore_show(int position, struct highscore *scores, int num_scores) rb->lcd_putsxy (MARGIN,3*h + h*i, str); rb->snprintf (str, sizeof (str), "%d", scores[i].score); rb->lcd_putsxy (LCD_WIDTH/4-w/4,3*h + h*i, str); - rb->snprintf (str, sizeof (str), "%d", scores[i].level); - rb->lcd_putsxy (LCD_WIDTH*3/4-w/4,3*h + h*i, str); + + /* Decide whether to display the level column or not */ + if(show_level) { + rb->snprintf (str, sizeof (str), "%d", scores[i].level); + rb->lcd_putsxy (LCD_WIDTH*3/4-w/4,3*h + h*i, str); + } + if(i == position) { #ifdef HAVE_LCD_COLOR rb->lcd_set_foreground(LCD_WHITE); diff --git a/apps/plugins/lib/highscore.h b/apps/plugins/lib/highscore.h index 173e389..18c14a7 100644 --- a/apps/plugins/lib/highscore.h +++ b/apps/plugins/lib/highscore.h @@ -27,7 +27,7 @@ struct highscore { char name[32]; int score; - int level; + int level; }; /* Saves the scores to a file @@ -91,6 +91,6 @@ bool highscore_would_update(int score, struct highscore *scores, * - scores : the array of existing scores * - num_scores: number of elements in 'scores' */ -void highscore_show(int position, struct highscore *scores, int num_scores); +void highscore_show(int position, struct highscore *scores, int num_scores, bool show_level); #endif #endif |