1
0
Fork 0
forked from len0rd/rockbox

brickmania: Use short Lvl %d level indicator if needed

Change-Id: Iecbf033f14aeab715f8d0a85131a97ff82943410
Reviewed-on: http://gerrit.rockbox.org/89
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
This commit is contained in:
Wieland Hoffmann 2012-02-08 14:43:23 +01:00 committed by Jonathan Gordon
parent d23d164b85
commit ae7b59634c

View file

@ -1598,15 +1598,6 @@ static int brickmania_game_loop(void)
}
#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64)
rb->snprintf(s, sizeof(s), "L%d", level+1);
#else
rb->snprintf(s, sizeof(s), "Level %d", level+1);
#endif
rb->lcd_getstringsize(s, &sw, NULL);
rb->lcd_putsxy(LCD_WIDTH-sw, 0, s);
if (vscore<score) vscore++;
rb->snprintf(s, sizeof(s), "%d", vscore);
rb->lcd_getstringsize(s, &sw, NULL);
@ -1615,13 +1606,26 @@ static int brickmania_game_loop(void)
/* write life num */
rb->snprintf(s, sizeof(s), "Life: %d", life);
/* hijack i - it's reset to 0 in 17 lines */
/* hijack i */
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);
/* write level */
rb->snprintf(s, sizeof(s), "Level %d", level+1);
rb->lcd_getstringsize(s, &sw, NULL);
if (LCD_WIDTH-sw <= (LCD_WIDTH/2+i/2)+1)
{
rb->snprintf(s, sizeof(s), "Lvl %d", level+1);
rb->lcd_getstringsize(s, &sw, NULL);
}
rb->lcd_putsxy(LCD_WIDTH-sw, 0, s);
i = 0;
/* continue game */
if (game_state == ST_PAUSE)
{