(RPNG) Fix rpng_test.c

This commit is contained in:
twinaphex 2015-03-14 03:22:41 +01:00
parent 9a0bd3c650
commit 65f80aa5e0
1 changed files with 16 additions and 1 deletions

View File

@ -30,9 +30,18 @@
#include <Imlib2.h> #include <Imlib2.h>
#endif #endif
enum image_process_code
{
IMAGE_PROCESS_ERROR = -2,
IMAGE_PROCESS_ERROR_END = -1,
IMAGE_PROCESS_NEXT = 0,
IMAGE_PROCESS_END = 1,
};
static bool rpng_nbio_load_image_argb(const char *path, uint32_t **data, static bool rpng_nbio_load_image_argb(const char *path, uint32_t **data,
unsigned *width, unsigned *height) unsigned *width, unsigned *height)
{ {
int retval;
size_t file_len; size_t file_len;
bool ret = true; bool ret = true;
struct rpng_t *rpng = NULL; struct rpng_t *rpng = NULL;
@ -96,7 +105,13 @@ static bool rpng_nbio_load_image_argb(const char *path, uint32_t **data,
goto end; goto end;
} }
rpng_nbio_load_image_argb_process(rpng, data, width, height); do
{
retval = rpng_nbio_load_image_argb_process(rpng, data, width, height);
}while(retval == IMAGE_PROCESS_NEXT);
if (retval == IMAGE_PROCESS_ERROR || retval == IMAGE_PROCESS_ERROR_END)
ret = false;
end: end:
if (handle) if (handle)