diff options
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 909c3a89ef..280c0c7724 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, | |||
120 | } | 120 | } |
121 | 121 | ||
122 | #ifdef HAVE_LCD_BITMAP | 122 | #ifdef HAVE_LCD_BITMAP |
123 | void highscore_show(int position, struct highscore *scores, int num_scores) | 123 | void highscore_show(int position, struct highscore *scores, int num_scores, bool show_level) |
124 | { | 124 | { |
125 | int i, w, h; | 125 | int i, w, h; |
126 | char str[30]; | 126 | char str[30]; |
@@ -141,7 +141,11 @@ void highscore_show(int position, struct highscore *scores, int num_scores) | |||
141 | } | 141 | } |
142 | rb->lcd_putsxy(LCD_WIDTH/2-w/2, MARGIN, "High Scores"); | 142 | rb->lcd_putsxy(LCD_WIDTH/2-w/2, MARGIN, "High Scores"); |
143 | rb->lcd_putsxy(LCD_WIDTH/4-w/4,2*h, "Score"); | 143 | rb->lcd_putsxy(LCD_WIDTH/4-w/4,2*h, "Score"); |
144 | rb->lcd_putsxy(LCD_WIDTH*3/4-w/4,2*h, "Level"); | 144 | |
145 | /* Decide whether to display the level column or not */ | ||
146 | if(show_level) { | ||
147 | rb->lcd_putsxy(LCD_WIDTH*3/4-w/4,2*h, "Level"); | ||
148 | } | ||
145 | 149 | ||
146 | for (i = 0; i<num_scores; i++) | 150 | for (i = 0; i<num_scores; i++) |
147 | { | 151 | { |
@@ -154,8 +158,13 @@ void highscore_show(int position, struct highscore *scores, int num_scores) | |||
154 | rb->lcd_putsxy (MARGIN,3*h + h*i, str); | 158 | rb->lcd_putsxy (MARGIN,3*h + h*i, str); |
155 | rb->snprintf (str, sizeof (str), "%d", scores[i].score); | 159 | rb->snprintf (str, sizeof (str), "%d", scores[i].score); |
156 | rb->lcd_putsxy (LCD_WIDTH/4-w/4,3*h + h*i, str); | 160 | rb->lcd_putsxy (LCD_WIDTH/4-w/4,3*h + h*i, str); |
157 | rb->snprintf (str, sizeof (str), "%d", scores[i].level); | 161 | |
158 | rb->lcd_putsxy (LCD_WIDTH*3/4-w/4,3*h + h*i, str); | 162 | /* Decide whether to display the level column or not */ |
163 | if(show_level) { | ||
164 | rb->snprintf (str, sizeof (str), "%d", scores[i].level); | ||
165 | rb->lcd_putsxy (LCD_WIDTH*3/4-w/4,3*h + h*i, str); | ||
166 | } | ||
167 | |||
159 | if(i == position) { | 168 | if(i == position) { |
160 | #ifdef HAVE_LCD_COLOR | 169 | #ifdef HAVE_LCD_COLOR |
161 | rb->lcd_set_foreground(LCD_WHITE); | 170 | rb->lcd_set_foreground(LCD_WHITE); |
diff --git a/apps/plugins/lib/highscore.h b/apps/plugins/lib/highscore.h index 173e389b9b..18c14a7662 100644 --- a/apps/plugins/lib/highscore.h +++ b/apps/plugins/lib/highscore.h | |||
@@ -27,7 +27,7 @@ struct highscore | |||
27 | { | 27 | { |
28 | char name[32]; | 28 | char name[32]; |
29 | int score; | 29 | int score; |
30 | int level; | 30 | int level; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | /* Saves the scores to a file | 33 | /* Saves the scores to a file |
@@ -91,6 +91,6 @@ bool highscore_would_update(int score, struct highscore *scores, | |||
91 | * - scores : the array of existing scores | 91 | * - scores : the array of existing scores |
92 | * - num_scores: number of elements in 'scores' | 92 | * - num_scores: number of elements in 'scores' |
93 | */ | 93 | */ |
94 | void highscore_show(int position, struct highscore *scores, int num_scores); | 94 | void highscore_show(int position, struct highscore *scores, int num_scores, bool show_level); |
95 | #endif | 95 | #endif |
96 | #endif | 96 | #endif |