projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
94cec1a
)
limited filling high score list with empty score entries to "top ten" list
author
Holger Schemel
<info@artsoft.org>
Thu, 17 Mar 2022 20:27:54 +0000
(21:27 +0100)
committer
Holger Schemel
<info@artsoft.org>
Thu, 17 Mar 2022 20:27:54 +0000
(21:27 +0100)
src/screens.c
patch
|
blob
|
history
diff --git
a/src/screens.c
b/src/screens.c
index 3245e4474e97a78c89ab312416431b95784a566c..7d4a22822bacaf43588209688d2c3cc186166433 100644
(file)
--- a/
src/screens.c
+++ b/
src/screens.c
@@
-5713,7
+5713,9
@@
void HandleChooseLevelNr(int mx, int my, int dx, int dy, int button)
static void DrawHallOfFame_setScoreEntries(void)
{
static void DrawHallOfFame_setScoreEntries(void)
{
- int num_visible_score_entries = NUM_MENU_ENTRIES_ON_SCREEN - 1;
+ int max_empty_entries = 10; // at least show "top ten" list, if empty
+ int max_visible_entries = NUM_MENU_ENTRIES_ON_SCREEN - 1; // w/o back link
+ int min_score_entries = MIN(max_empty_entries, max_visible_entries);
int score_pos = (scores.last_added >= 0 ? scores.last_added : 0);
int i;
int score_pos = (scores.last_added >= 0 ? scores.last_added : 0);
int i;
@@
-5729,7
+5731,7
@@
static void DrawHallOfFame_setScoreEntries(void)
// do not add empty score entries if off-screen
if (scores.entry[i].score == 0 &&
scores.entry[i].time == 0 &&
// do not add empty score entries if off-screen
if (scores.entry[i].score == 0 &&
scores.entry[i].time == 0 &&
- i >=
num_visible
_score_entries)
+ i >=
min
_score_entries)
break;
TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_SCORE_ENTRY);
break;
TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_SCORE_ENTRY);