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 zarch_context_reset(void) { zui_t *zui = NULL; menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); const char *font_path = NULL; if (!menu || !menu->userdata || !settings) return; zui = (zui_t*)menu->userdata; font_path = settings->video.font_enable ? settings->video.font_path : NULL; if (!menu_display_init_main_font(menu, font_path, zui->font_size)) RARCH_WARN("Failed to load font."); zarch_context_bg_destroy(zui); rarch_main_data_msg_queue_push(DATA_TYPE_IMAGE, settings->menu.wallpaper, "cb_menu_wallpaper", 0, 1, true); zarch_allocate_white_texture(zui); menu_display_ctl(MENU_DISPLAY_CTL_SET_FONT_SIZE, &zui->font_size); zarch_zui_font(menu); }
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 *zarch_init(void) { 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_driver_init_first()) goto error; menu->userdata = (zui_t*)calloc(1, sizeof(zui_t)); if (!menu->userdata) goto error; zui = (zui_t*)menu->userdata; 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 (settings->menu.wallpaper[0] != '\0') rarch_main_data_msg_queue_push(DATA_TYPE_IMAGE, settings->menu.wallpaper, "cb_menu_wallpaper", 0, 1, true); zui->ca.allocated = 0; matrix_4x4_ortho(&zui->mvp, 0, 1, 1, 0, 0, 1); zarch_zui_font(menu); return menu; error: if (menu) free(menu); return NULL; }