summaryrefslogtreecommitdiff
path: root/apps/plugins/rockblox.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-02-22 07:17:15 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-02-22 07:17:15 +0000
commit56d29e89778f30e87a20bb1e67fd6854fe19684c (patch)
tree588064022421b1094aebdc6f627a1a0f5ed4d4df /apps/plugins/rockblox.c
parent04067fd7a0570692b0a25f578aaeeb5ab1cbff46 (diff)
downloadrockbox-56d29e89778f30e87a20bb1e67fd6854fe19684c.zip
rockbox-56d29e89778f30e87a20bb1e67fd6854fe19684c.tar.gz
rockbox-56d29e89778f30e87a20bb1e67fd6854fe19684c.tar.bz2
rockbox-56d29e89778f30e87a20bb1e67fd6854fe19684c.tar.xz
some changes to use of display_text.
* add parameter, wait_key to display_text(). - set this true to wait button press after all words is displayed. * use ARRAYLEN macro instead of #define WORDS * add macro to indicate end of style array. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24846 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockblox.c')
-rw-r--r--apps/plugins/rockblox.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index a3d644e..6bff1ea 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -1218,20 +1218,20 @@ static void move_down (void)
static bool rockblox_help(void)
{
- int button;
-
-#define WORDS (sizeof help_text / sizeof (char*))
- char *help_text[] = {
- "Rockblox", "", "Aim", "", "Make", "the", "falling", "blocks", "of", "different",
- "shapes", "form", "full", "rows.", "Whenever", "a", "row", "is", "completed,", "it",
- "will", "be", "cleared", "away", "and", "you", "gain", "points."
+ static char *help_text[] = {
+ "Rockblox", "", "Aim", "",
+ "Make", "the", "falling", "blocks", "of",
+ "different", "shapes", "form", "full", "rows.",
+ "Whenever", "a", "row", "is", "completed,",
+ "it", "will", "be", "cleared", "away",
+ "and", "you", "gain", "points."
};
-
static struct style_text formation[]={
{ 0, TEXT_CENTER|TEXT_UNDERLINE },
{ 2, C_RED },
- { -1, 0 }
+ LAST_STYLE_ITEM
};
+
#ifdef HAVE_LCD_BITMAP
rb->lcd_setfont(FONT_UI);
#endif
@@ -1239,17 +1239,12 @@ static bool rockblox_help(void)
rb->lcd_set_background(LCD_BLACK);
rb->lcd_set_foreground(LCD_WHITE);
#endif
- if (display_text(WORDS, help_text, formation, NULL))
+ if (display_text(ARRAYLEN(help_text), help_text, formation, NULL, true))
return true;
- do {
- button = rb->button_get(true);
- if ( rb->default_event_handler( button ) == SYS_USB_CONNECTED )
- return true;
- } while( ( button == BUTTON_NONE )
- || ( button & (BUTTON_REL|BUTTON_REPEAT) ) );
#ifdef HAVE_LCD_BITMAP
rb->lcd_setfont(FONT_SYSFIXED);
#endif
+
return false;
}