From 40a39dd7fd689103e39861daeb81f904f454a7ed Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 19 Mar 2011 22:33:31 +0000 Subject: [PATCH] menu: generalize credits code to show any message git-svn-id: file:///home/notaz/opt/svn/PicoDrive@921 be3aeb3a-fb24-0410-a615-afba39da0efa --- platform/common/menu.c | 9 ++++----- platform/common/menu_pico.c | 2 +- platform/common/plat.h | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/platform/common/menu.c b/platform/common/menu.c index 31522f7e..b05c755c 100644 --- a/platform/common/menu.c +++ b/platform/common/menu.c @@ -640,13 +640,12 @@ static void me_loop(menu_entry *menu, int *menu_sel, void (*draw_more)(void)) /* ***************************************** */ -static void draw_menu_credits(void (*draw_more)(void)) +static void draw_menu_message(const char *msg, void (*draw_more)(void)) { - const char *creds, *p; int x, y, h, w, wt; + const char *p; - p = creds = plat_get_credits(); - + p = msg; for (h = 1, w = 0; *p != 0; h++) { for (wt = 0; *p != 0 && *p != '\n'; p++) wt++; @@ -665,7 +664,7 @@ static void draw_menu_credits(void (*draw_more)(void)) menu_draw_begin(1); - for (p = creds; *p != 0 && y <= g_menuscreen_h - me_mfont_h; y += me_mfont_h) { + for (p = msg; *p != 0 && y <= g_menuscreen_h - me_mfont_h; y += me_mfont_h) { text_out16(x, y, p); for (; *p != 0 && *p != '\n'; p++) diff --git a/platform/common/menu_pico.c b/platform/common/menu_pico.c index b9f1d7f1..da820ea5 100644 --- a/platform/common/menu_pico.c +++ b/platform/common/menu_pico.c @@ -875,7 +875,7 @@ static int main_menu_handler(int id, int keys) } break; case MA_MAIN_CREDITS: - draw_menu_credits(); + draw_menu_message(, NULL); in_menu_wait(PBTN_MOK|PBTN_MBACK, 70); break; case MA_MAIN_EXIT: diff --git a/platform/common/plat.h b/platform/common/plat.h index 03570406..0a9fc0b2 100644 --- a/platform/common/plat.h +++ b/platform/common/plat.h @@ -50,7 +50,6 @@ unsigned int plat_get_ticks_ms(void); unsigned int plat_get_ticks_us(void); void plat_wait_till_us(unsigned int us); -const char *plat_get_credits(void); void plat_debug_cat(char *str); #ifdef __cplusplus -- 2.39.5