mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-04 00:06:11 +00:00
(Image) Add texture image handle to nbio_image_t
This commit is contained in:
parent
4124fb7130
commit
06dcd7543f
@ -403,6 +403,7 @@ typedef int (*transfer_cb_t )(void *data, size_t len);
|
|||||||
|
|
||||||
typedef struct nbio_image_handle
|
typedef struct nbio_image_handle
|
||||||
{
|
{
|
||||||
|
struct texture_image ti;
|
||||||
bool is_blocking;
|
bool is_blocking;
|
||||||
bool is_finished;
|
bool is_finished;
|
||||||
transfer_cb_t cb;
|
transfer_cb_t cb;
|
||||||
|
@ -166,10 +166,10 @@ static int rarch_main_iterate_http_poll(void)
|
|||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
static int cb_image_menu_wallpaper(void *data, size_t len)
|
static int cb_image_menu_wallpaper(void *data, size_t len)
|
||||||
{
|
{
|
||||||
struct texture_image ti = {0};
|
uint32_t **pixels = NULL;
|
||||||
uint32_t **pixels = &ti.pixels;
|
unsigned *width = NULL;
|
||||||
unsigned *width = &ti.width;
|
unsigned *height = NULL;
|
||||||
unsigned *height = &ti.height;
|
|
||||||
nbio_handle_t *nbio = (nbio_handle_t*)data;
|
nbio_handle_t *nbio = (nbio_handle_t*)data;
|
||||||
|
|
||||||
if (!nbio || !data)
|
if (!nbio || !data)
|
||||||
@ -180,12 +180,16 @@ static int cb_image_menu_wallpaper(void *data, size_t len)
|
|||||||
!nbio->image.handle->has_iend)
|
!nbio->image.handle->has_iend)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
pixels = &nbio->image.ti.pixels;
|
||||||
|
width = &nbio->image.ti.width;
|
||||||
|
height = &nbio->image.ti.height;
|
||||||
|
|
||||||
rpng_nbio_load_image_argb_process(nbio->image.handle, pixels, width, height);
|
rpng_nbio_load_image_argb_process(nbio->image.handle, pixels, width, height);
|
||||||
|
|
||||||
if (driver.menu_ctx && driver.menu_ctx->load_background)
|
if (driver.menu_ctx && driver.menu_ctx->load_background)
|
||||||
driver.menu_ctx->load_background(&ti);
|
driver.menu_ctx->load_background(&nbio->image.ti);
|
||||||
|
|
||||||
texture_image_free(&ti);
|
texture_image_free(&nbio->image.ti);
|
||||||
|
|
||||||
nbio->image.is_blocking = true;
|
nbio->image.is_blocking = true;
|
||||||
nbio->image.is_finished = true;
|
nbio->image.is_finished = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user