Start setting up some code in preparation for non-blocking image

loading
This commit is contained in:
twinaphex 2015-02-22 06:35:02 +01:00
parent fdfdb2defb
commit 98b0728604
3 changed files with 10 additions and 23 deletions

View File

@ -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

View File

@ -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);

View File

@ -919,8 +919,8 @@ static int rarch_main_iterate_http_parse(void)
g_extern.http.handle = NULL;
msg_queue_clear(g_extern.http.msg_queue);
msg_queue_clear(g_extern.nbio.msg_queue);
msg_queue_clear(g_extern.images.msg_queue);
return 0;
}