mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-03-07 02:47:24 +00:00
Start setting up some code in preparation for non-blocking image
loading
This commit is contained in:
parent
fdfdb2defb
commit
98b0728604
@ -33,6 +33,8 @@
|
||||
#include <retro_miscellaneous.h>
|
||||
#include "gfx/video_viewport.h"
|
||||
|
||||
#include <formats/rpng.h>
|
||||
|
||||
#include "playlist.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -594,6 +596,12 @@ struct global
|
||||
msg_queue_t *msg_queue;
|
||||
} nbio;
|
||||
|
||||
struct
|
||||
{
|
||||
msg_queue_t *msg_queue;
|
||||
struct rpng_t *handle;
|
||||
} images;
|
||||
|
||||
bool exec;
|
||||
|
||||
struct
|
||||
|
@ -194,29 +194,8 @@ bool texture_image_load(struct texture_image *out_img, const char *path)
|
||||
unsigned g_shift = 8;
|
||||
unsigned b_shift = use_rgba ? 16 : 0;
|
||||
|
||||
if (strstr(path, ".tga"))
|
||||
{
|
||||
void *raw_buf = NULL;
|
||||
uint8_t *buf = NULL;
|
||||
ssize_t len;
|
||||
bool ret = read_file(path, &raw_buf, &len);
|
||||
|
||||
if (!ret || len < 0)
|
||||
{
|
||||
RARCH_ERR("Failed to read image: %s.\n", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
buf = (uint8_t*)raw_buf;
|
||||
|
||||
ret = rtga_image_load_shift(buf, out_img,
|
||||
a_shift, r_shift, g_shift, b_shift);
|
||||
|
||||
if (buf)
|
||||
free(buf);
|
||||
}
|
||||
#ifdef HAVE_ZLIB
|
||||
else if (strstr(path, ".png"))
|
||||
if (strstr(path, ".png"))
|
||||
{
|
||||
ret = rpng_image_load_argb_shift(path, out_img,
|
||||
a_shift, r_shift, g_shift, b_shift);
|
||||
|
Loading…
x
Reference in New Issue
Block a user