diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index 7928c3009b..b055ef5e57 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -371,18 +371,12 @@ static void mui_render_messagebox(const char *message) unsigned i, width, height; uint32_t normal_color; int x, y, font_size; - struct string_list *list = NULL; - menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); - - if (!menu || !menu->userdata) - return; - - list = (struct string_list*)string_split(message, "\n"); + struct string_list *list = (struct string_list*) + string_split(message, "\n"); if (!list) return; - if (list->elems == 0) goto end; diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index d4adb4a02c..64d55711f7 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -272,9 +272,6 @@ static void rgui_render_background(void) uint16_t *fb_data = NULL; uint16_t *src = NULL; uint16_t *dst = NULL; - menu_handle_t *menu = menu_driver_get_ptr(); - if (!menu) - return; menu_display_ctl(MENU_DISPLAY_CTL_WIDTH, &fb_width); menu_display_ctl(MENU_DISPLAY_CTL_HEIGHT, &fb_height); @@ -322,14 +319,11 @@ static void rgui_render_messagebox(const char *message) uint16_t color; uint16_t *fb_data = NULL; struct string_list *list = NULL; - menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); - if (!menu || !message || !*message) + if (!message || !*message) return; - (void)settings; - list = string_split(message, "\n"); if (!list) return; @@ -394,7 +388,7 @@ end: string_list_free(list); } -static void rgui_blit_cursor(menu_handle_t *menu) +static void rgui_blit_cursor(void) { size_t fb_pitch; unsigned fb_width, fb_height; @@ -631,7 +625,7 @@ static void rgui_render(void) } if (settings->menu.mouse.enable && (settings->video.fullscreen || !video_driver_ctl(RARCH_DISPLAY_CTL_HAS_WINDOWED, NULL))) - rgui_blit_cursor(menu); + rgui_blit_cursor(); } static void *rgui_init(void) @@ -727,10 +721,6 @@ static void rgui_set_texture(void) unsigned fb_width, fb_height; uint16_t *fb_data = NULL; bool fb_dirty = false; - menu_handle_t *menu = menu_driver_get_ptr(); - - if (!menu) - return; menu_display_ctl(MENU_DISPLAY_CTL_GET_FRAMEBUFFER_DIRTY_FLAG, &fb_dirty); @@ -759,11 +749,10 @@ static void rgui_navigation_set(bool scroll) { size_t selection; unsigned fb_width, fb_height; - menu_handle_t *menu = menu_driver_get_ptr(); size_t end = menu_entries_get_end(); if (!menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection)) return; - if (!menu || !scroll) + if (!scroll) return; menu_display_ctl(MENU_DISPLAY_CTL_WIDTH, &fb_width); @@ -780,31 +769,23 @@ static void rgui_navigation_set(bool scroll) static void rgui_navigation_set_last(void) { - menu_handle_t *menu = menu_driver_get_ptr(); - if (menu) - rgui_navigation_set(true); + rgui_navigation_set(true); } static void rgui_navigation_descend_alphabet(size_t *unused) { - menu_handle_t *menu = menu_driver_get_ptr(); - if (menu) - rgui_navigation_set(true); + rgui_navigation_set(true); } static void rgui_navigation_ascend_alphabet(size_t *unused) { - menu_handle_t *menu = menu_driver_get_ptr(); - if (menu) - rgui_navigation_set(true); + rgui_navigation_set(true); } static void rgui_populate_entries(const char *path, const char *label, unsigned k) { - menu_handle_t *menu = menu_driver_get_ptr(); - if (menu) - rgui_navigation_set(true); + rgui_navigation_set(true); } static int rgui_environ(menu_environ_cb_t type, void *data) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 8241c3a558..6814a003d9 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -421,8 +421,7 @@ static void xmb_draw_boxart(xmb_handle_t *xmb, float *color, unsigned width, uns MENU_DISPLAY_PRIM_TRIANGLESTRIP); } -static void xmb_draw_text(menu_handle_t *menu, - xmb_handle_t *xmb, +static void xmb_draw_text(xmb_handle_t *xmb, const char *str, float x, float y, float scale_factor, float alpha, enum text_alignment text_align, @@ -511,9 +510,8 @@ static void xmb_frame_messagebox(const char *message) const char *msg = list->elems[i].data; if (msg) - xmb_draw_text(menu, - xmb, - msg, + xmb_draw_text( + xmb, msg, x, y + i * font_size, 1, @@ -1325,12 +1323,11 @@ static void xmb_draw_items(xmb_handle_t *xmb, math_matrix_4x4 mymat; xmb_node_t *core_node = NULL; size_t end = 0; - menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); video_driver_ctl(RARCH_DISPLAY_CTL_GET_FRAME_COUNT, &frame_count); - if (!list || !list->size || !menu) + if (!list || !list->size) return; if (cat_selection_ptr > XMB_SYSTEM_TAB_END) @@ -1496,7 +1493,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, *frame_count / 20, entry.path, (i == current)); - xmb_draw_text(menu, xmb, name, + xmb_draw_text(xmb, name, node->x + xmb->margins.screen.left + xmb->icon.spacing.horizontal + xmb->margins.label.left, xmb->margins.screen.top + node->y + xmb->margins.label.top, @@ -1509,7 +1506,7 @@ static void xmb_draw_items(xmb_handle_t *xmb, if (do_draw_text) - xmb_draw_text(menu, xmb, value, + xmb_draw_text(xmb, value, node->x + xmb->margins.screen.left + xmb->icon.spacing.horizontal + xmb->margins.label.left + xmb->margins.setting.left, xmb->margins.screen.top + node->y + xmb->margins.label.top, @@ -1716,7 +1713,7 @@ static void xmb_frame(void) &coord_color2[0], NULL, NULL, 4, MENU_DISPLAY_PRIM_TRIANGLESTRIP); - xmb_draw_text(menu, xmb, + xmb_draw_text(xmb, xmb->title_name, xmb->margins.title.left, xmb->margins.title.top, 1, 1, TEXT_ALIGN_LEFT, width, height); @@ -1725,14 +1722,14 @@ static void xmb_frame(void) { menu_display_timedate(timedate, sizeof(timedate), 4); - xmb_draw_text(menu, xmb, timedate, + xmb_draw_text(xmb, timedate, width - xmb->margins.title.left - xmb->icon.size / 4, xmb->margins.title.top, 1, 1, TEXT_ALIGN_RIGHT, width, height); } if (menu_entries_get_core_title(title_msg, sizeof(title_msg)) == 0) - xmb_draw_text(menu, xmb, title_msg, xmb->margins.title.left, + xmb_draw_text(xmb, title_msg, xmb->margins.title.left, height - xmb->margins.title.bottom, 1, 1, TEXT_ALIGN_LEFT, width, height); @@ -1855,7 +1852,7 @@ static void xmb_font(menu_handle_t *menu) RARCH_WARN("Failed to load font."); } -static void xmb_layout(menu_handle_t *menu, xmb_handle_t *xmb) +static void xmb_layout(xmb_handle_t *xmb) { int new_font_size; size_t selection; @@ -2282,7 +2279,7 @@ static void xmb_context_reset(void) fill_pathname_join(iconpath, themepath, xmb->icon.dir, sizeof(iconpath)); fill_pathname_slash(iconpath, sizeof(iconpath)); - xmb_layout(menu, xmb); + xmb_layout(xmb); xmb_font(menu); xmb_context_reset_textures(xmb, iconpath); xmb_context_reset_background(iconpath);