X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fcommon%2Fmenu.c;fp=frontend%2Fcommon%2Fmenu.c;h=cf31610705a9d9468a06f65a4b70187da60dc1f3;hp=7890df4bf5dfbd527bce8c30d4fb026a626d5b43;hb=51f77282d6cb4bc06248395cc1e712ee298910af;hpb=9a92bffbed92c9b6bd7d0ddde7c0982a8590959e diff --git a/frontend/common/menu.c b/frontend/common/menu.c index 7890df4b..cf316107 100644 --- a/frontend/common/menu.c +++ b/frontend/common/menu.c @@ -573,14 +573,14 @@ static int me_process(menu_entry *entry, int is_next, int is_lr) static void debug_menu_loop(void); -static void me_loop(menu_entry *menu, int *menu_sel, void (*draw_more)(void)) +static int me_loop_d(menu_entry *menu, int *menu_sel, void (*draw_prep)(void), void (*draw_more)(void)) { - int ret, inp, sel = *menu_sel, menu_sel_max; + int ret = 0, inp, sel = *menu_sel, menu_sel_max; menu_sel_max = me_count(menu) - 1; if (menu_sel_max < 0) { lprintf("no enabled menu entries\n"); - return; + return 0; } while ((!menu[sel].enabled || !menu[sel].selectable) && sel < menu_sel_max) @@ -592,6 +592,9 @@ static void me_loop(menu_entry *menu, int *menu_sel, void (*draw_more)(void)) for (;;) { + if (draw_prep != NULL) + draw_prep(); + me_draw(menu, sel, draw_more); inp = in_menu_wait(PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT| PBTN_MOK|PBTN_MBACK|PBTN_MENU|PBTN_L|PBTN_R, 70); @@ -636,6 +639,13 @@ static void me_loop(menu_entry *menu, int *menu_sel, void (*draw_more)(void)) } } *menu_sel = sel; + + return ret; +} + +static int me_loop(menu_entry *menu, int *menu_sel) +{ + return me_loop_d(menu, menu_sel, NULL, NULL); } /* ***************************************** */