Create menu_driver_load_background

This commit is contained in:
twinaphex 2015-03-22 06:48:03 +01:00
parent 7d7f797c8f
commit 36351bf78d
3 changed files with 15 additions and 2 deletions

View File

@ -324,3 +324,15 @@ void menu_driver_populate_entries(const char *path, const char *label,
if (driver->menu_ctx && driver->menu_ctx->populate_entries)
driver->menu_ctx->populate_entries(path, label, k);
}
bool menu_driver_load_background(void *data)
{
driver_t *driver = driver_get_ptr();
if (!driver)
return false;
if (driver->menu_ctx && driver->menu_ctx->load_background)
return driver->menu_ctx->load_background(data);
return false;
}

View File

@ -317,6 +317,8 @@ void menu_driver_render_messagebox(const char *msg);
void menu_driver_populate_entries(const char *path, const char *label,
unsigned k);
bool menu_driver_load_background(void *data);
#ifdef __cplusplus
}
#endif

View File

@ -276,8 +276,7 @@ static int cb_image_menu_wallpaper_upload(void *data, size_t len)
nbio->image.processing_final_state == IMAGE_PROCESS_ERROR_END)
return -1;
if (driver->menu_ctx && driver->menu_ctx->load_background)
driver->menu_ctx->load_background(&nbio->image.ti);
menu_driver_load_background(&nbio->image.ti);
texture_image_free(&nbio->image.ti);