/* Sets the starting index of the menu entry list. */ void menu_entries_set_start(size_t i) { menu_entries_t *entries = menu_entries_get_ptr(); if (entries) entries->begin = i; }
menu_list_t *menu_list_get_ptr(void) { menu_entries_t *entries = menu_entries_get_ptr(); if (!entries) return NULL; return entries->menu_list; }
rarch_setting_t *menu_setting_get_ptr(void) { menu_entries_t *entries = menu_entries_get_ptr(); if (!entries) return NULL; return entries->list_settings; }
/* Returns the starting index of the menu entry list. */ size_t menu_entries_get_start(void) { menu_entries_t *entries = menu_entries_get_ptr(); if (!entries) return 0; return entries->begin; }
bool menu_entries_needs_refresh(void) { menu_entries_t *entries = menu_entries_get_ptr(); if (!entries || entries->nonblocking_refresh) return false; if (entries->need_refresh) return true; return false; }
void menu_entries_unset_refresh(bool nonblocking) { menu_entries_t *entries = menu_entries_get_ptr(); if (entries) { if (nonblocking) entries->nonblocking_refresh = false; else entries->need_refresh = false; } }
void menu_entries_free(void) { menu_entries_t *entries = menu_entries_get_ptr(); if (!entries) return; if (entries->list_settings) menu_setting_free(entries->list_settings); entries->list_settings = NULL; menu_list_free(entries->menu_list); entries->menu_list = NULL; }
static void glui_render_menu_list(glui_handle_t *glui, menu_handle_t *menu, uint32_t normal_color, uint32_t hover_color) { unsigned width, height; size_t i = 0; uint64_t *frame_count = video_driver_get_frame_count(); size_t end = menu_entries_get_end(); menu_display_t *disp = menu_display_get_ptr(); menu_entries_t *entries = menu_entries_get_ptr(); if (!menu_display_update_pending()) return; video_driver_get_size(&width, &height); glui->list_block.carr.coords.vertices = 0; for (i = menu_entries_get_start(); i < end; i++) { bool entry_selected; menu_entry_t entry; int y = disp->header_height - menu->scroll_y + (glui->line_height * i); if (y > (int)height || ((y + (int)glui->line_height) < 0)) continue; menu_entries_get(i, &entry); entry_selected = entries->navigation.selection_ptr == i; glui_render_label_value(glui, y, width, *frame_count / 40, entry_selected ? hover_color : normal_color, entry_selected, entry.path, entry.value); } }