Use video_driver_texture_load and video_driver_texture_unload

directly from menu drivers
This commit is contained in:
twinaphex 2016-02-09 01:45:37 +01:00
parent cdf272665e
commit 38a341e6b5
5 changed files with 24 additions and 33 deletions

View File

@ -171,9 +171,8 @@ static void mui_context_reset_textures(mui_handle_t *mui,
continue;
video_texture_image_load(&ti, path);
mui->textures.list[i].id = menu_display_texture_load(&ti,
TEXTURE_FILTER_MIPMAP_LINEAR);
video_driver_texture_load(&ti,
TEXTURE_FILTER_MIPMAP_LINEAR, (unsigned*)&mui->textures.list[i].id);
video_texture_image_free(&ti);
}
@ -964,8 +963,8 @@ static void mui_allocate_white_texture(mui_handle_t *mui)
ti.height = 1;
ti.pixels = (uint32_t*)&white_data;
mui->textures.white = menu_display_texture_load(&ti,
TEXTURE_FILTER_NEAREST);
video_driver_texture_load(&ti,
TEXTURE_FILTER_NEAREST, (unsigned*)&mui->textures.white);
}
static void mui_font(void)
@ -1116,9 +1115,8 @@ static bool mui_load_image(void *userdata, void *data,
break;
case MENU_IMAGE_WALLPAPER:
mui_context_bg_destroy(mui);
mui->textures.bg.id = menu_display_texture_load(data,
TEXTURE_FILTER_MIPMAP_LINEAR);
video_driver_texture_load(data,
TEXTURE_FILTER_MIPMAP_LINEAR, (unsigned*)&mui->textures.bg.id);
mui_allocate_white_texture(mui);
break;
case MENU_IMAGE_BOXART:

View File

@ -1124,15 +1124,15 @@ static void xmb_context_reset_horizontal_list(
video_texture_image_load(&ti, texturepath);
node->icon = menu_display_texture_load(&ti,
TEXTURE_FILTER_MIPMAP_LINEAR);
video_driver_texture_load(&ti,
TEXTURE_FILTER_MIPMAP_LINEAR, (unsigned*)&node->icon);
video_texture_image_free(&ti);
video_texture_image_load(&ti, content_texturepath);
node->content_icon = menu_display_texture_load(&ti,
TEXTURE_FILTER_MIPMAP_LINEAR);
video_driver_texture_load(&ti,
TEXTURE_FILTER_MIPMAP_LINEAR, (unsigned*)&node->content_icon);
video_texture_image_free(&ti);
}
@ -2093,16 +2093,17 @@ static bool xmb_load_image(void *userdata, void *data, menu_image_type_t type)
break;
case MENU_IMAGE_WALLPAPER:
xmb_context_bg_destroy(xmb);
xmb->textures.bg.id = menu_display_texture_load(data,
TEXTURE_FILTER_MIPMAP_LINEAR);
video_driver_texture_load(data,
TEXTURE_FILTER_MIPMAP_LINEAR,
(unsigned*)&xmb->textures.bg.id);
break;
case MENU_IMAGE_BOXART:
{
struct texture_image *img = (struct texture_image*)data;
xmb->boxart_height = xmb->boxart_width
* (float)img->height / (float)img->width;
xmb->boxart = menu_display_texture_load(data,
TEXTURE_FILTER_MIPMAP_LINEAR);
video_driver_texture_load(data,
TEXTURE_FILTER_MIPMAP_LINEAR, (unsigned*)&xmb->boxart);
}
break;
}
@ -2240,8 +2241,9 @@ static void xmb_context_reset_textures(
video_texture_image_load(&ti, path);
xmb->textures.list[i].id = menu_display_texture_load(&ti,
TEXTURE_FILTER_MIPMAP_LINEAR);
video_driver_texture_load(&ti,
TEXTURE_FILTER_MIPMAP_LINEAR,
(unsigned*)&xmb->textures.list[i].id);
video_texture_image_free(&ti);
}

View File

@ -1149,8 +1149,9 @@ static bool zarch_load_image(void *userdata,
break;
case MENU_IMAGE_WALLPAPER:
zarch_context_bg_destroy(zui);
zui->textures.bg.id = menu_display_texture_load(data,
TEXTURE_FILTER_MIPMAP_LINEAR);
video_driver_texture_load(data,
TEXTURE_FILTER_MIPMAP_LINEAR,
(unsigned*)&zui->textures.bg.id);
break;
case MENU_IMAGE_BOXART:
break;
@ -1168,8 +1169,9 @@ static void zarch_allocate_white_texture(zui_t *zui)
ti.height = 1;
ti.pixels = (uint32_t*)&data;
zui->textures.white = menu_display_texture_load(&ti,
TEXTURE_FILTER_NEAREST);
video_driver_texture_load(&ti,
TEXTURE_FILTER_NEAREST,
(unsigned*)&zui->textures.white);
}
static void zarch_context_reset(void *data)

View File

@ -511,14 +511,6 @@ void menu_display_matrix_4x4_rotate_z(
matrix_4x4_multiply(matrix, &matrix_scaled, matrix);
}
unsigned menu_display_texture_load(void *data,
enum texture_filter_type filter_type)
{
unsigned id = 0;
video_driver_texture_load(data, filter_type, &id);
return id;
}
void menu_display_draw(float x, float y,
unsigned width, unsigned height,
struct gfx_coords *coords,

View File

@ -170,9 +170,6 @@ void menu_display_matrix_4x4_rotate_z(
float scale_x, float scale_y, float scale_z,
bool scale_enable);
unsigned menu_display_texture_load(void *data,
enum texture_filter_type filter_type);
void menu_display_clear_color(float r, float g, float b, float a);
void menu_display_handle_wallpaper_upload(void *task_data,