From 645c8bb0ccb22ddae440cd1826e02a9ad0dec5c6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 14 Mar 2015 03:58:35 +0100 Subject: [PATCH] (Menu) Use separate iteration stepping for image processing --- general.h | 1 + runloop_data.c | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/general.h b/general.h index 7f061e8b15..5ea90f9c3b 100644 --- a/general.h +++ b/general.h @@ -410,6 +410,7 @@ typedef struct nbio_image_handle bool is_finished_with_processing; transfer_cb_t cb; struct rpng_t *handle; + unsigned processing_pos_increment; unsigned pos_increment; uint64_t frame_count; uint64_t processing_frame_count; diff --git a/runloop_data.c b/runloop_data.c index a4ab6c8e2b..3e860c2c7c 100644 --- a/runloop_data.c +++ b/runloop_data.c @@ -247,7 +247,8 @@ static int cb_nbio_image_menu_wallpaper(void *data, size_t len) } 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)) { @@ -328,7 +329,7 @@ static int rarch_main_iterate_image_processing_transfer(nbio_handle_t *nbio) if (!nbio) 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, &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; } + nbio->image.processing_frame_count++; + if (retval == IMAGE_PROCESS_NEXT) - { - nbio->image.processing_frame_count++; return 0; - } nbio->image.processing_final_state = retval; return -1;