summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWieland Hoffmann <themineo@gmail.com>2012-02-08 14:43:23 +0100
committerJonathan Gordon <rockbox@jdgordon.info>2012-02-08 22:30:19 +0100
commitae7b59634c82646b5ff3c92a9380f0ddad948d24 (patch)
tree2e0c1a73c3b5924df7b2909c340156f76fb3d74e
parentd23d164b85c5516126d77ab7038d55cebcdb6687 (diff)
downloadrockbox-ae7b59634c82646b5ff3c92a9380f0ddad948d24.tar.gz
rockbox-ae7b59634c82646b5ff3c92a9380f0ddad948d24.zip
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>
-rw-r--r--apps/plugins/brickmania.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index d9c39d263f..7fa320a5fe 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -1598,15 +1598,6 @@ static int brickmania_game_loop(void)
1598 } 1598 }
1599 1599
1600 1600
1601#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64)
1602 rb->snprintf(s, sizeof(s), "L%d", level+1);
1603#else
1604 rb->snprintf(s, sizeof(s), "Level %d", level+1);
1605#endif
1606
1607 rb->lcd_getstringsize(s, &sw, NULL);
1608 rb->lcd_putsxy(LCD_WIDTH-sw, 0, s);
1609
1610 if (vscore<score) vscore++; 1601 if (vscore<score) vscore++;
1611 rb->snprintf(s, sizeof(s), "%d", vscore); 1602 rb->snprintf(s, sizeof(s), "%d", vscore);
1612 rb->lcd_getstringsize(s, &sw, NULL); 1603 rb->lcd_getstringsize(s, &sw, NULL);
@@ -1615,13 +1606,26 @@ static int brickmania_game_loop(void)
1615 /* write life num */ 1606 /* write life num */
1616 rb->snprintf(s, sizeof(s), "Life: %d", life); 1607 rb->snprintf(s, sizeof(s), "Life: %d", life);
1617 1608
1618 /* hijack i - it's reset to 0 in 17 lines */ 1609 /* hijack i */
1619 i = sw; 1610 i = sw;
1620 rb->lcd_getstringsize(s, &sw, NULL); 1611 rb->lcd_getstringsize(s, &sw, NULL);
1621 if (sw >= (LCD_WIDTH/2-i/2)) 1612 if (sw >= (LCD_WIDTH/2-i/2))
1622 rb->snprintf(s, sizeof(s), "L: %d", life); 1613 rb->snprintf(s, sizeof(s), "L: %d", life);
1623 rb->lcd_putsxy(0, 0, s); 1614 rb->lcd_putsxy(0, 0, s);
1624 1615
1616 /* write level */
1617 rb->snprintf(s, sizeof(s), "Level %d", level+1);
1618 rb->lcd_getstringsize(s, &sw, NULL);
1619
1620 if (LCD_WIDTH-sw <= (LCD_WIDTH/2+i/2)+1)
1621 {
1622 rb->snprintf(s, sizeof(s), "Lvl %d", level+1);
1623 rb->lcd_getstringsize(s, &sw, NULL);
1624 }
1625
1626 rb->lcd_putsxy(LCD_WIDTH-sw, 0, s);
1627 i = 0;
1628
1625 /* continue game */ 1629 /* continue game */
1626 if (game_state == ST_PAUSE) 1630 if (game_state == ST_PAUSE)
1627 { 1631 {