diff options
Diffstat (limited to 'apps/plugins/lib/highscore.c')
-rw-r--r-- | apps/plugins/lib/highscore.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/apps/plugins/lib/highscore.c b/apps/plugins/lib/highscore.c index ff7a166222..3aae955bfc 100644 --- a/apps/plugins/lib/highscore.c +++ b/apps/plugins/lib/highscore.c | |||
@@ -119,7 +119,6 @@ bool highscore_would_update(int score, struct highscore *scores, | |||
119 | return (num_scores > 0) && (score > scores[num_scores-1].score); | 119 | return (num_scores > 0) && (score > scores[num_scores-1].score); |
120 | } | 120 | } |
121 | 121 | ||
122 | #ifdef HAVE_LCD_BITMAP | ||
123 | #define MARGIN 5 | 122 | #define MARGIN 5 |
124 | void highscore_show(int position, struct highscore *scores, int num_scores, | 123 | void highscore_show(int position, struct highscore *scores, int num_scores, |
125 | bool show_level) | 124 | bool show_level) |
@@ -179,37 +178,3 @@ void highscore_show(int position, struct highscore *scores, int num_scores, | |||
179 | rb->lcd_set_foreground(fgcolor); | 178 | rb->lcd_set_foreground(fgcolor); |
180 | #endif | 179 | #endif |
181 | } | 180 | } |
182 | #else | ||
183 | struct scoreinfo { | ||
184 | struct highscore *scores; | ||
185 | int position; | ||
186 | bool show_level; | ||
187 | }; | ||
188 | static const char* get_score(int selected, void * data, | ||
189 | char * buffer, size_t buffer_len) | ||
190 | { | ||
191 | struct scoreinfo *scoreinfo = (struct scoreinfo *) data; | ||
192 | int len; | ||
193 | len = rb->snprintf(buffer, buffer_len, "%c%d) %4d", | ||
194 | (scoreinfo->position == selected?'*':' '), | ||
195 | selected+1, scoreinfo->scores[selected].score); | ||
196 | |||
197 | if (scoreinfo->show_level) | ||
198 | rb->snprintf(buffer + len, buffer_len - len, " %d", | ||
199 | scoreinfo->scores[selected].level); | ||
200 | return buffer; | ||
201 | } | ||
202 | |||
203 | void highscore_show(int position, struct highscore *scores, int num_scores, | ||
204 | bool show_level) | ||
205 | { | ||
206 | struct simplelist_info info; | ||
207 | struct scoreinfo scoreinfo = {scores, position, show_level}; | ||
208 | rb->simplelist_info_init(&info, "High Scores", num_scores, &scoreinfo); | ||
209 | if (position >= 0) | ||
210 | info.selection = position; | ||
211 | info.hide_selection = true; | ||
212 | info.get_name = get_score; | ||
213 | rb->simplelist_show_list(&info); | ||
214 | } | ||
215 | #endif /* HAVE_LCD_BITMAP */ | ||