diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-07-17 10:31:31 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-07-24 21:20:13 +0000 |
commit | 658026e6267277b27d297c481728f74d160a8481 (patch) | |
tree | 915a9d2bb48469bdd5b9127dc19a61f230721a6c /apps/plugins/lib/highscore.c | |
parent | 8cb555460ff79e636a7907fb2589e16db98c8600 (diff) | |
download | rockbox-658026e6267277b27d297c481728f74d160a8481.tar.gz rockbox-658026e6267277b27d297c481728f74d160a8481.zip |
[4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.
Note: I left behind lcd_bitmap in features.txt, because removing it
would require considerable work in the manual and the translations.
Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
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 */ | ||