diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 7131c89502..b8567856dc 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -664,7 +664,7 @@ static void mui_compute_entries_box(mui_handle_t* mui, int width) size_t usable_width = width - (mui->margin * 2); file_list_t *list = menu_entries_get_selection_buf_ptr(0); float sum = 0; - size_t entries_end = menu_entries_get_end(); + size_t entries_end = menu_entries_get_size(); float scale_factor = menu_display_get_dpi(); uintptr_t texture_switch2 = 0; @@ -1004,7 +1004,7 @@ static void mui_render_menu_list( list = menu_entries_get_selection_buf_ptr(0); - entries_end = menu_entries_get_end(); + entries_end = menu_entries_get_size(); for (i = 0; i < entries_end; i++) { diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 559dbd203c..c8ac0a6745 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -395,6 +395,7 @@ static void rgui_render(void *data, bool is_idle) char title_buf[255]; char title_msg[64]; char msg[255]; + size_t entries_end = 0; bool msg_force = false; settings_t *settings = config_get_ptr(); rgui_t *rgui = (rgui_t*)data; @@ -471,13 +472,13 @@ static void rgui_render(void *data, bool is_idle) } /* Do not scroll if all items are visible. */ - if (menu_entries_get_end() <= RGUI_TERM_HEIGHT(fb_width, fb_height)) + if (menu_entries_get_size() <= RGUI_TERM_HEIGHT(fb_width, fb_height)) { size_t start = 0; menu_entries_ctl(MENU_ENTRIES_CTL_SET_START, &start); } - bottom = (int)(menu_entries_get_end() - RGUI_TERM_HEIGHT(fb_width, fb_height)); + bottom = (int)(menu_entries_get_size() - RGUI_TERM_HEIGHT(fb_width, fb_height)); menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &old_start); if (old_start > (unsigned)bottom) @@ -485,8 +486,10 @@ static void rgui_render(void *data, bool is_idle) menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &old_start); - end = ((old_start + RGUI_TERM_HEIGHT(fb_width, fb_height)) <= (menu_entries_get_end())) ? - old_start + RGUI_TERM_HEIGHT(fb_width, fb_height) : menu_entries_get_end(); + entries_end = menu_entries_get_size(); + + end = ((old_start + RGUI_TERM_HEIGHT(fb_width, fb_height)) <= (entries_end)) ? + old_start + RGUI_TERM_HEIGHT(fb_width, fb_height) : entries_end; rgui_render_background(); @@ -774,7 +777,7 @@ static void rgui_navigation_set(void *data, bool scroll) size_t start, fb_pitch; unsigned fb_width, fb_height; bool do_set_start = false; - size_t end = menu_entries_get_end(); + size_t end = menu_entries_get_size(); size_t selection = menu_navigation_get_selection(); if (!scroll) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 8766f836ba..f1bfb2a97c 100755 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1161,7 +1161,7 @@ static void xmb_selection_pointer_changed( menu_entry_get(&entry, 0, selection, NULL, true); - end = (unsigned)menu_entries_get_end(); + end = (unsigned)menu_entries_get_size(); threshold = xmb->icon_size * 10; video_driver_get_size(NULL, &height); @@ -3324,7 +3324,7 @@ static void xmb_layout(xmb_handle_t *xmb) xmb_layout_psp(xmb, width); current = (unsigned)selection; - end = (unsigned)menu_entries_get_end(); + end = (unsigned)menu_entries_get_size(); for (i = 0; i < end; i++) { diff --git a/menu/drivers/xui.cpp b/menu/drivers/xui.cpp index 1da440c27c..ef910b98d8 100644 --- a/menu/drivers/xui.cpp +++ b/menu/drivers/xui.cpp @@ -588,7 +588,7 @@ static void xui_render(void *data, bool is_idle) } } - end = menu_entries_get_end(); + end = menu_entries_get_size(); for (i = 0; i < end; i++) { menu_entry_t entry; diff --git a/menu/menu_entries.c b/menu/menu_entries.c index cfdbe35a81..bc93186ad3 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -198,12 +198,6 @@ static bool menu_entries_refresh(void *data) return true; } -/* Returns the last index (+1) of the menu entry list. */ -size_t menu_entries_get_end(void) -{ - return menu_entries_get_size(); -} - /* Sets title to what the name of the current menu should be. */ int menu_entries_get_title(char *s, size_t len) { diff --git a/menu/menu_entries.h b/menu/menu_entries.h index 55c50cf5b4..a2a56077a0 100644 --- a/menu/menu_entries.h +++ b/menu/menu_entries.h @@ -113,8 +113,6 @@ typedef struct menu_file_list_cbs char *path_buf, size_t path_buf_size); } menu_file_list_cbs_t; -size_t menu_entries_get_end(void); - int menu_entries_get_title(char *title, size_t title_len); bool menu_entries_current_core_is_no_core(void); diff --git a/ui/drivers/cocoa/cocoatouch_menu.m b/ui/drivers/cocoa/cocoatouch_menu.m index 1f098ebd2f..003e7cc19a 100644 --- a/ui/drivers/cocoa/cocoatouch_menu.m +++ b/ui/drivers/cocoa/cocoatouch_menu.m @@ -723,7 +723,7 @@ didSelectRowAtIndexPath:(NSIndexPath *)indexPath menu_entries_get_title(title, sizeof(title)); self.title = BOXSTRING(title); - end = menu_entries_get_end(); + end = menu_entries_get_size(); menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i); for (; i < end; i++)