forked from len0rd/rockbox
brickmania: Use short L: %d life indicator if needed
This is the case if either the player has lots of lifes or a high score Change-Id: Ic4c7011e9fa582d2ae552b28474ba260f2b4cab0 Reviewed-on: http://gerrit.rockbox.org/88 Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
This commit is contained in:
parent
513c5ad3d0
commit
51912c840c
1 changed files with 10 additions and 7 deletions
|
@ -1597,13 +1597,6 @@ static int brickmania_game_loop(void)
|
||||||
rb->lcd_putsxy(LCD_WIDTH/2-2, INT3(STRINGPOS_FLIP), s);
|
rb->lcd_putsxy(LCD_WIDTH/2-2, INT3(STRINGPOS_FLIP), s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write life num */
|
|
||||||
#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64)
|
|
||||||
#define LIFE_STR "L:%d"
|
|
||||||
#else
|
|
||||||
#define LIFE_STR "Life: %d"
|
|
||||||
#endif
|
|
||||||
rb->lcd_putsxyf(0, 0, LIFE_STR, life);
|
|
||||||
|
|
||||||
#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64)
|
#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64)
|
||||||
rb->snprintf(s, sizeof(s), "L%d", level+1);
|
rb->snprintf(s, sizeof(s), "L%d", level+1);
|
||||||
|
@ -1619,6 +1612,16 @@ static int brickmania_game_loop(void)
|
||||||
rb->lcd_getstringsize(s, &sw, NULL);
|
rb->lcd_getstringsize(s, &sw, NULL);
|
||||||
rb->lcd_putsxy(LCD_WIDTH/2-sw/2, 0, s);
|
rb->lcd_putsxy(LCD_WIDTH/2-sw/2, 0, s);
|
||||||
|
|
||||||
|
/* write life num */
|
||||||
|
rb->snprintf(s, sizeof(s), "Life: %d", life);
|
||||||
|
|
||||||
|
/* hijack i - it's reset to 0 in 17 lines */
|
||||||
|
i = sw;
|
||||||
|
rb->lcd_getstringsize(s, &sw, NULL);
|
||||||
|
if (sw >= (LCD_WIDTH/2-i/2))
|
||||||
|
rb->snprintf(s, sizeof(s), "L: %d", life);
|
||||||
|
rb->lcd_putsxy(0, 0, s);
|
||||||
|
|
||||||
/* continue game */
|
/* continue game */
|
||||||
if (game_state == ST_PAUSE)
|
if (game_state == ST_PAUSE)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue