(Menu) Use separate iteration stepping for image processing

This commit is contained in:
twinaphex 2015-03-14 03:58:35 +01:00
parent 608df4f6de
commit 645c8bb0cc
2 changed files with 6 additions and 5 deletions

View File

@ -410,6 +410,7 @@ typedef struct nbio_image_handle
bool is_finished_with_processing; bool is_finished_with_processing;
transfer_cb_t cb; transfer_cb_t cb;
struct rpng_t *handle; struct rpng_t *handle;
unsigned processing_pos_increment;
unsigned pos_increment; unsigned pos_increment;
uint64_t frame_count; uint64_t frame_count;
uint64_t processing_frame_count; uint64_t processing_frame_count;

View File

@ -248,6 +248,7 @@ static int cb_nbio_image_menu_wallpaper(void *data, size_t len)
nbio->image.handle->buff_data = (uint8_t*)ptr; nbio->image.handle->buff_data = (uint8_t*)ptr;
nbio->image.pos_increment = (len / 2) ? (len / 2) : 1; nbio->image.pos_increment = (len / 2) ? (len / 2) : 1;
nbio->image.processing_pos_increment = (len / 4) ? (len / 4) : 1;
if (!rpng_nbio_load_image_argb_start(nbio->image.handle)) if (!rpng_nbio_load_image_argb_start(nbio->image.handle))
{ {
@ -328,7 +329,7 @@ static int rarch_main_iterate_image_processing_transfer(nbio_handle_t *nbio)
if (!nbio) if (!nbio)
return -1; return -1;
for (i = 0; i < nbio->image.pos_increment; i++) for (i = 0; i < nbio->image.processing_pos_increment; i++)
{ {
retval = rpng_nbio_load_image_argb_process(nbio->image.handle, retval = rpng_nbio_load_image_argb_process(nbio->image.handle,
&nbio->image.ti.pixels, &nbio->image.ti.width, &nbio->image.ti.height); &nbio->image.ti.pixels, &nbio->image.ti.width, &nbio->image.ti.height);
@ -337,11 +338,10 @@ static int rarch_main_iterate_image_processing_transfer(nbio_handle_t *nbio)
break; break;
} }
if (retval == IMAGE_PROCESS_NEXT)
{
nbio->image.processing_frame_count++; nbio->image.processing_frame_count++;
if (retval == IMAGE_PROCESS_NEXT)
return 0; return 0;
}
nbio->image.processing_final_state = retval; nbio->image.processing_final_state = retval;
return -1; return -1;