forked from len0rd/rockbox
High score list needed to be redrawn on return from hold, put it in a seperate function to avoid duplicating code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15634 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
34d08b235e
commit
8e5a39c58b
1 changed files with 16 additions and 7 deletions
|
|
@ -589,12 +589,22 @@ static void show_details (void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void init_rockblox (void)
|
|
||||||
{
|
|
||||||
#ifdef HIGH_SCORE_Y
|
#ifdef HIGH_SCORE_Y
|
||||||
|
static void show_highscores (void)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
char str[25]; /* for strings */
|
char str[25]; /* for strings */
|
||||||
|
|
||||||
|
for (i = MAX_HIGH_SCORES-1; i>=0; i--)
|
||||||
|
{
|
||||||
|
rb->snprintf (str, sizeof (str), "%06d L%1d", Highest[i].score, Highest[i].level);
|
||||||
|
rb->lcd_putsxy (HIGH_LABEL_X, HIGH_SCORE_Y + (10 * ((MAX_HIGH_SCORES-1) - i)), str);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void init_rockblox (void)
|
||||||
|
{
|
||||||
highscore_update(score, level, Highest, MAX_HIGH_SCORES);
|
highscore_update(score, level, Highest, MAX_HIGH_SCORES);
|
||||||
|
|
||||||
level = 1;
|
level = 1;
|
||||||
|
|
@ -616,11 +626,7 @@ static void init_rockblox (void)
|
||||||
#endif
|
#endif
|
||||||
show_details ();
|
show_details ();
|
||||||
#ifdef HIGH_SCORE_Y
|
#ifdef HIGH_SCORE_Y
|
||||||
for (i = MAX_HIGH_SCORES-1; i>=0; i--)
|
show_highscores ();
|
||||||
{
|
|
||||||
rb->snprintf (str, sizeof (str), "%06d L%1d", Highest[i].score, Highest[i].level);
|
|
||||||
rb->lcd_putsxy (HIGH_LABEL_X, HIGH_SCORE_Y + (10 * ((MAX_HIGH_SCORES-1) - i)), str);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -933,6 +939,9 @@ static int rockblox_loop (void)
|
||||||
/* get rid of the splash text */
|
/* get rid of the splash text */
|
||||||
rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT);
|
rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT);
|
||||||
show_details ();
|
show_details ();
|
||||||
|
#ifdef HIGH_SCORE_Y
|
||||||
|
show_highscores ();
|
||||||
|
#endif
|
||||||
draw_next_block ();
|
draw_next_block ();
|
||||||
refresh_board ();
|
refresh_board ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue