From 4100bf95b425bb12c61926a4e5a56feb39fdd028 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 11 May 2016 21:22:45 +0200 Subject: [PATCH] Able to compile without RPNG support --- Makefile.common | 6 +---- menu/cbs/menu_cbs_ok.c | 2 ++ qb/config.libs.sh | 6 +++++ qb/config.params.sh | 1 + tasks/task_image.c | 51 +++++++++++++++++++++--------------------- 5 files changed, 35 insertions(+), 31 deletions(-) diff --git a/Makefile.common b/Makefile.common index 4d909c217a..dfe3772c1e 100644 --- a/Makefile.common +++ b/Makefile.common @@ -890,7 +890,6 @@ ifeq ($(HAVE_ZLIB), 1) tasks/task_decompress.o OBJ += $(ZLIB_OBJS) DEFINES += -DHAVE_ZLIB - HAVE_RPNG = 1 HAVE_COMPRESSION = 1 ifeq ($(WANT_ZLIB), 1) DEFINES += -DWANT_ZLIB @@ -900,11 +899,8 @@ ifeq ($(HAVE_ZLIB), 1) endif endif -ifdef HAVE_RPNG - DEFINES += -DHAVE_RPNG -endif - ifeq ($(HAVE_RPNG), 1) + DEFINES += -DHAVE_RPNG OBJ += libretro-common/formats/png/rpng.o \ libretro-common/formats/png/rpng_encode.o endif diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index c129b1d76c..818266fe99 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -1259,6 +1259,7 @@ static int action_ok_save_state(const char *path, } #ifdef HAVE_NETWORKING +#ifdef HAVE_ZLIB static void cb_decompressed(void *task_data, void *user_data, const char *err) { decompress_task_data_t *dec = (decompress_task_data_t*)task_data; @@ -1289,6 +1290,7 @@ static void cb_decompressed(void *task_data, void *user_data, const char *err) free(dec); } } +#endif /* expects http_transfer_t*, menu_file_transfer_t* */ static void cb_generic_download(void *task_data, diff --git a/qb/config.libs.sh b/qb/config.libs.sh index 1bf9ec0816..01859e8ede 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -425,10 +425,16 @@ if [ "$HAVE_MATERIALUI" != 'no' ] || [ "$HAVE_XMB" != 'no' ] || [ "$HAVE_ZARCH" fi fi + check_macro NEON __ARM_NEON__ add_define_make OS "$OS" +if [ "$HAVE_ZLIB" = 'no' ] && [ "HAVE_RPNG" != 'no' ]; then + HAVE_RPNG=no + echo "Notice: zlib is not available, RPNG will also be disabled." +fi + if [ "$HAVE_THREADS" = 'no' ] && [ "HAVE_CHEEVOS" != 'no' ]; then HAVE_CHEEVOS=no echo "Notice: Threads are not available, Cheevos will also be disabled." diff --git a/qb/config.params.sh b/qb/config.params.sh index 16c576a2a6..e69da313e8 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -77,3 +77,4 @@ HAVE_XSHM=no # XShm video driver support (disabled because it's ju HAVE_CHEEVOS=yes # Retro Achievements HAVE_VULKAN=auto # Vulkan support C89_VULKAN=no +HAVE_RPNG=yes # RPNG support diff --git a/tasks/task_image.c b/tasks/task_image.c index 446a3f4dca..ea6e504279 100644 --- a/tasks/task_image.c +++ b/tasks/task_image.c @@ -163,7 +163,29 @@ static int cb_image_menu_thumbnail(void *data, size_t len) return 0; } -#ifdef HAVE_RPNG +static int rarch_main_data_image_iterate_process_transfer(nbio_handle_t *nbio) +{ + unsigned i, width = 0, height = 0; + int retval = 0; + + if (!nbio) + return -1; + + for (i = 0; i < nbio->image.processing_pos_increment; i++) + { + retval = rarch_main_data_image_process(nbio, + &width, &height); + if (retval != IMAGE_PROCESS_NEXT) + break; + } + + if (retval == IMAGE_PROCESS_NEXT) + return 0; + + nbio->image.processing_final_state = retval; + return -1; +} + static int rarch_main_data_image_iterate_transfer(nbio_handle_t *nbio) { unsigned i; @@ -192,32 +214,10 @@ static int rarch_main_data_image_iterate_transfer(nbio_handle_t *nbio) nbio->image.frame_count++; return 0; +#ifdef HAVE_RPNG error: return -1; -} - - -static int rarch_main_data_image_iterate_process_transfer(nbio_handle_t *nbio) -{ - unsigned i, width = 0, height = 0; - int retval = 0; - - if (!nbio) - return -1; - - for (i = 0; i < nbio->image.processing_pos_increment; i++) - { - retval = rarch_main_data_image_process(nbio, - &width, &height); - if (retval != IMAGE_PROCESS_NEXT) - break; - } - - if (retval == IMAGE_PROCESS_NEXT) - return 0; - - nbio->image.processing_final_state = retval; - return -1; +#endif } static void rarch_task_image_load_free_internal(nbio_handle_t *nbio) @@ -311,7 +311,6 @@ static int cb_nbio_image_menu_thumbnail(void *data, size_t len) return cb_nbio_generic(nbio, &len); } -#endif bool rarch_task_image_load_handler(retro_task_t *task) {