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); task_push_image_load(settings->path.menu_wallpaper, "cb_menu_wallpaper", menu_display_handle_wallpaper_upload, NULL); }
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->path.font; if (!menu_display_font_main_init(&font_info)) RARCH_WARN("Failed to load font."); zarch_context_bg_destroy(zui); task_push_image_load(settings->path.menu_wallpaper, MENU_ENUM_LABEL_CB_MENU_WALLPAPER, menu_display_handle_wallpaper_upload, NULL); menu_display_allocate_white_texture(); menu_display_set_font_size(zui->font_size); menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT); }
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_init_first_driver()) 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_set_header_height(unused); unused = 28; menu_display_set_font_size(unused); (void)unused; zui->header_height = 1000; /* dpi / 3; */ zui->font_size = 28; if (!string_is_empty(settings->path.menu_wallpaper)) task_push_image_load(settings->path.menu_wallpaper, MENU_ENUM_LABEL_CB_MENU_WALLPAPER, menu_display_handle_wallpaper_upload, NULL); matrix_4x4_ortho(&zui->mvp, 0, 1, 1, 0, 0, 1); menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT); return menu; error: if (menu) free(menu); return NULL; }
static void zarch_context_reset(void *data) { settings_t *settings = config_get_ptr(); zui_t *zui = (zui_t*)data; if (!zui || !settings) return; zarch_context_bg_destroy(zui); task_push_image_load(settings->path.menu_wallpaper, menu_display_handle_wallpaper_upload, NULL); menu_display_allocate_white_texture(); menu_display_set_header_height(zui->header_height); zui->font = menu_display_font(APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_FONT, zui->font_size); }