(task_image.c) Cleanups

This commit is contained in:
twinaphex 2016-05-11 20:38:09 +02:00
parent dc46c0d012
commit 5cc86384b8

View File

@ -99,9 +99,10 @@ static int cb_nbio_default(void *data, size_t len)
static int rarch_main_data_image_process( static int rarch_main_data_image_process(
nbio_handle_t *nbio, nbio_handle_t *nbio,
unsigned *width, unsigned *width,
unsigned *height, unsigned *height)
int *retval)
{ {
int retval = 0;
switch (nbio->image_type) switch (nbio->image_type)
{ {
case IMAGE_TYPE_PNG: case IMAGE_TYPE_PNG:
@ -109,7 +110,7 @@ static int rarch_main_data_image_process(
if (!rpng_is_valid((rpng_t*)nbio->image.handle)) if (!rpng_is_valid((rpng_t*)nbio->image.handle))
return IMAGE_PROCESS_ERROR; return IMAGE_PROCESS_ERROR;
*retval = rpng_nbio_load_image_argb_process( retval = rpng_nbio_load_image_argb_process(
(rpng_t*)nbio->image.handle, (rpng_t*)nbio->image.handle,
&nbio->image.ti.pixels, &nbio->image.ti.pixels,
width, height); width, height);
@ -122,7 +123,7 @@ static int rarch_main_data_image_process(
nbio->image.ti.width = *width; nbio->image.ti.width = *width;
nbio->image.ti.height = *height; nbio->image.ti.height = *height;
return *retval; return retval;
} }
static int cb_image_menu_generic(nbio_handle_t *nbio) static int cb_image_menu_generic(nbio_handle_t *nbio)
@ -132,8 +133,10 @@ static int cb_image_menu_generic(nbio_handle_t *nbio)
if (!nbio) if (!nbio)
return -1; return -1;
switch (rarch_main_data_image_process(nbio, retval = rarch_main_data_image_process(nbio,
&width, &height, &retval)) &width, &height);
switch (retval)
{ {
case IMAGE_PROCESS_ERROR: case IMAGE_PROCESS_ERROR:
case IMAGE_PROCESS_ERROR_END: case IMAGE_PROCESS_ERROR_END:
@ -204,8 +207,9 @@ static int rarch_main_data_image_iterate_process_transfer(nbio_handle_t *nbio)
for (i = 0; i < nbio->image.processing_pos_increment; i++) for (i = 0; i < nbio->image.processing_pos_increment; i++)
{ {
if (rarch_main_data_image_process(nbio, retval = rarch_main_data_image_process(nbio,
&width, &height, &retval) != IMAGE_PROCESS_NEXT) &width, &height);
if (retval != IMAGE_PROCESS_NEXT)
break; break;
} }