static void zarch_context_reset(void *data) { menu_display_ctx_font_t font_info; settings_t *settings = config_get_ptr(); zui_t *zui = (zui_t*)data; if (!zui || !settings) return; font_info.path = NULL; font_info.size = zui->font_size; if (settings->video.font_enable) font_info.path = settings->video.font_path; if (!menu_display_ctl(MENU_DISPLAY_CTL_FONT_MAIN_INIT, &font_info)) RARCH_WARN("Failed to load font."); zarch_context_bg_destroy(zui); rarch_task_push_image_load(settings->menu.wallpaper, "cb_menu_wallpaper", menu_display_handle_wallpaper_upload, NULL); zarch_allocate_white_texture(zui); menu_display_ctl(MENU_DISPLAY_CTL_SET_FONT_SIZE, &zui->font_size); zarch_zui_font(); }
static void zrmenu_context_reset(void *data) { char iconpath[PATH_MAX_LENGTH] = {0}; zrmenu_handle_t *zr = (zrmenu_handle_t*)data; settings_t *settings = config_get_ptr(); unsigned width, height = 0; video_driver_get_size(&width, &height); if (!zr || !settings) return; fill_pathname_join(iconpath, settings->assets_directory, "zahnrad", sizeof(iconpath)); fill_pathname_slash(iconpath, sizeof(iconpath)); zrmenu_layout(zr); zrmenu_init_device(zr); wimp_context_bg_destroy(zr); zrmenu_context_reset_textures(zr, iconpath); rarch_task_push_image_load(settings->menu.wallpaper, "cb_menu_wallpaper", menu_display_handle_wallpaper_upload, NULL); }
static void nk_menu_context_reset(void *data) { char iconpath[PATH_MAX_LENGTH] = {0}; nk_menu_handle_t *nk = (nk_menu_handle_t*)data; settings_t *settings = config_get_ptr(); unsigned width, height = 0; video_driver_get_size(&width, &height); if (!nk || !settings) return; fill_pathname_join(iconpath, settings->directory.assets, "nuklear", sizeof(iconpath)); fill_pathname_slash(iconpath, sizeof(iconpath)); nk_menu_layout(nk); nk_menu_init_device(nk); wimp_context_bg_destroy(nk); nk_menu_context_reset_textures(nk, iconpath); rarch_task_push_image_load(settings->path.menu_wallpaper, "cb_menu_wallpaper", menu_display_handle_wallpaper_upload, NULL); }
static void *zarch_init(void **userdata) { int unused; zui_t *zui = NULL; settings_t *settings = config_get_ptr(); menu_handle_t *menu = (menu_handle_t*) calloc(1, sizeof(*menu)); if (!menu) goto error; if (!menu_display_ctl(MENU_DISPLAY_CTL_INIT_FIRST_DRIVER, NULL)) goto error; zui = (zui_t*)calloc(1, sizeof(zui_t)); if (!zui) goto error; *userdata = zui; if (settings->menu.mouse.enable) { RARCH_WARN("Forcing menu_mouse_enable=false\n"); settings->menu.mouse.enable = false; } unused = 1000; menu_display_ctl(MENU_DISPLAY_CTL_SET_HEADER_HEIGHT, &unused); unused = 28; menu_display_ctl(MENU_DISPLAY_CTL_SET_FONT_SIZE, &unused); (void)unused; zui->header_height = 1000; /* dpi / 3; */ zui->font_size = 28; if (!string_is_empty(settings->menu.wallpaper)) rarch_task_push_image_load(settings->menu.wallpaper, "cb_menu_wallpaper", menu_display_handle_wallpaper_upload, NULL); zui->ca.allocated = 0; matrix_4x4_ortho(&zui->mvp, 0, 1, 1, 0, 0, 1); zarch_zui_font(); return menu; error: if (menu) free(menu); return NULL; }
static void mui_context_reset(void *data) { char iconpath[PATH_MAX_LENGTH] = {0}; mui_handle_t *mui = (mui_handle_t*)data; settings_t *settings = config_get_ptr(); if (!mui || !settings) return; fill_pathname_join(iconpath, settings->assets_directory, "glui", sizeof(iconpath)); fill_pathname_slash(iconpath, sizeof(iconpath)); mui_layout(mui); mui_context_bg_destroy(mui); mui_allocate_white_texture(mui); mui_context_reset_textures(mui, iconpath); rarch_task_push_image_load(settings->menu.wallpaper, "cb_menu_wallpaper", menu_display_handle_wallpaper_upload, NULL); }