From f74225721ddc52f7bbcfaac6c2124efbb693fedc Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 16 Feb 2020 16:38:17 +0100 Subject: [PATCH] menu_thumbnail and menu_thumbnail_path now decoupled from menu system --- Makefile.common | 4 +- config.def.h | 4 +- configuration.c | 4 +- configuration.h | 4 +- menu/menu_thumbnail.c => gfx/gfx_thumbnail.c | 271 +++++++++--------- menu/menu_thumbnail.h => gfx/gfx_thumbnail.h | 124 ++++---- .../gfx_thumbnail_path.c | 123 ++++---- .../gfx_thumbnail_path.h | 62 ++-- griffin/griffin.c | 4 +- menu/cbs/menu_cbs_scan.c | 8 +- menu/drivers/materialui.c | 118 ++++---- menu/drivers/ozone/ozone.c | 80 +++--- menu/drivers/ozone/ozone.h | 10 +- menu/drivers/ozone/ozone_display.c | 20 +- menu/drivers/ozone/ozone_entries.c | 20 +- menu/drivers/rgui.c | 54 ++-- menu/drivers/stripes.c | 2 +- menu/drivers/xmb.c | 232 +++++++-------- menu/menu_setting.c | 8 +- playlist.h | 6 +- tasks/task_pl_thumbnail_download.c | 46 +-- 21 files changed, 606 insertions(+), 598 deletions(-) rename menu/menu_thumbnail.c => gfx/gfx_thumbnail.c (73%) rename menu/menu_thumbnail.h => gfx/gfx_thumbnail.h (65%) rename menu/menu_thumbnail_path.c => gfx/gfx_thumbnail_path.c (87%) rename menu/menu_thumbnail_path.h => gfx/gfx_thumbnail_path.h (64%) diff --git a/Makefile.common b/Makefile.common index b04812f436..2024e2031d 100644 --- a/Makefile.common +++ b/Makefile.common @@ -226,6 +226,8 @@ OBJ += \ gfx/video_crt_switch.o \ gfx/gfx_display.o \ gfx/gfx_animation.o \ + gfx/gfx_thumbnail_path.o \ + gfx/gfx_thumbnail.o \ configuration.o \ $(LIBRETRO_COMM_DIR)/dynamic/dylib.o \ cores/dynamic_dummy.o \ @@ -836,8 +838,6 @@ ifeq ($(HAVE_MENU_COMMON), 1) menu/cbs/menu_cbs_contentlist_switch.o \ menu/menu_displaylist.o \ menu/drivers/menu_generic.o \ - menu/menu_thumbnail_path.o \ - menu/menu_thumbnail.o ifeq ($(HAVE_MENU_WIDGETS), 1) OBJ += menu/widgets/menu_widgets.o diff --git a/config.def.h b/config.def.h index e6f1092c8e..465a8d0a64 100644 --- a/config.def.h +++ b/config.def.h @@ -1025,11 +1025,11 @@ static const unsigned input_bind_timeout = 5; static const unsigned input_bind_hold = 2; -static const unsigned menu_thumbnails_default = 3; +static const unsigned gfx_thumbnails_default = 3; static const unsigned menu_left_thumbnails_default = 0; -static const unsigned menu_thumbnail_upscale_threshold = 0; +static const unsigned gfx_thumbnail_upscale_threshold = 0; #ifdef HAVE_MENU static const unsigned menu_timedate_style = MENU_TIMEDATE_STYLE_DM_HM; diff --git a/configuration.c b/configuration.c index 567ac1a2b2..6278600e06 100644 --- a/configuration.c +++ b/configuration.c @@ -1782,9 +1782,9 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings, SETTING_UINT("video_overscan_correction_bottom", &settings->uints.video_overscan_correction_bottom, true, DEFAULT_VIDEO_OVERSCAN_CORRECTION_BOTTOM, false); #endif #ifdef HAVE_MENU - SETTING_UINT("menu_thumbnails", &settings->uints.menu_thumbnails, true, menu_thumbnails_default, false); + SETTING_UINT("menu_thumbnails", &settings->uints.gfx_thumbnails, true, gfx_thumbnails_default, false); SETTING_UINT("menu_left_thumbnails", &settings->uints.menu_left_thumbnails, true, menu_left_thumbnails_default, false); - SETTING_UINT("menu_thumbnail_upscale_threshold", &settings->uints.menu_thumbnail_upscale_threshold, true, menu_thumbnail_upscale_threshold, false); + SETTING_UINT("menu_thumbnail_upscale_threshold", &settings->uints.gfx_thumbnail_upscale_threshold, true, gfx_thumbnail_upscale_threshold, false); SETTING_UINT("menu_timedate_style", &settings->uints.menu_timedate_style, true, menu_timedate_style, false); SETTING_UINT("menu_ticker_type", &settings->uints.menu_ticker_type, true, menu_ticker_type, false); #ifdef HAVE_RGUI diff --git a/configuration.h b/configuration.h index 2b18499f13..7f9295ea1a 100644 --- a/configuration.h +++ b/configuration.h @@ -530,9 +530,9 @@ typedef struct settings unsigned accessibility_narrator_speech_speed; unsigned menu_timedate_style; - unsigned menu_thumbnails; + unsigned gfx_thumbnails; unsigned menu_left_thumbnails; - unsigned menu_thumbnail_upscale_threshold; + unsigned gfx_thumbnail_upscale_threshold; unsigned menu_rgui_thumbnail_downscaler; unsigned menu_rgui_thumbnail_delay; unsigned menu_rgui_color_theme; diff --git a/menu/menu_thumbnail.c b/gfx/gfx_thumbnail.c similarity index 73% rename from menu/menu_thumbnail.c rename to gfx/gfx_thumbnail.c index cb10764d46..56337a5429 100644 --- a/menu/menu_thumbnail.c +++ b/gfx/gfx_thumbnail.c @@ -1,7 +1,7 @@ /* Copyright (C) 2010-2019 The RetroArch team * * --------------------------------------------------------------------------------------- - * The following license statement only applies to this file (menu_thumbnail.c). + * The following license statement only applies to this file (gfx_thumbnail.c). * --------------------------------------------------------------------------------------- * * Permission is hereby granted, free of charge, @@ -29,24 +29,23 @@ #include #include -#include "../gfx/gfx_animation.h" -#include "menu_driver.h" +#include "gfx_display.h" +#include "gfx_animation.h" -#include "menu_thumbnail.h" +#include "gfx_thumbnail.h" -#include "../retroarch.h" #include "../tasks/tasks_internal.h" /* When streaming thumbnails, to minimise the processing * of unnecessary images (i.e. when scrolling rapidly through * playlists), we delay loading until an entry has been on screen - * for at least menu_thumbnail_delay ms */ -#define DEFAULT_MENU_THUMBNAIL_STREAM_DELAY 83.333333f -static float menu_thumbnail_stream_delay = DEFAULT_MENU_THUMBNAIL_STREAM_DELAY; + * for at least gfx_thumbnail_delay ms */ +#define DEFAULT_GFX_THUMBNAIL_STREAM_DELAY 83.333333f +static float gfx_thumbnail_stream_delay = DEFAULT_GFX_THUMBNAIL_STREAM_DELAY; /* Duration in ms of the thumbnail 'fade in' animation */ -#define DEFAULT_MENU_THUMBNAIL_FADE_DURATION 166.66667f -static float menu_thumbnail_fade_duration = DEFAULT_MENU_THUMBNAIL_FADE_DURATION; +#define DEFAULT_GFX_THUMBNAIL_FADE_DURATION 166.66667f +static float gfx_thumbnail_fade_duration = DEFAULT_GFX_THUMBNAIL_FADE_DURATION; /* Due to the asynchronous nature of thumbnail * loading, it is quite possible to trigger a load @@ -58,59 +57,59 @@ static float menu_thumbnail_fade_duration = DEFAULT_MENU_THUMBNAIL_FADE_DURATION * requesting a thumbnail, and the upload is only * handled if the tag matches the most recent value * at the time when the load completes */ -static uint64_t menu_thumbnail_list_id = 0; +static uint64_t gfx_thumbnail_list_id = 0; /* Utility structure, sent as userdata when pushing * an image load */ typedef struct { - menu_thumbnail_t *thumbnail; + gfx_thumbnail_t *thumbnail; retro_time_t list_id; -} menu_thumbnail_tag_t; +} gfx_thumbnail_tag_t; /* Setters */ /* When streaming thumbnails, sets time in ms that an * entry must be on screen before an image load is * requested */ -void menu_thumbnail_set_stream_delay(float delay) +void gfx_thumbnail_set_stream_delay(float delay) { - menu_thumbnail_stream_delay = (delay >= 0.0f) ? - delay : DEFAULT_MENU_THUMBNAIL_STREAM_DELAY; + gfx_thumbnail_stream_delay = (delay >= 0.0f) ? + delay : DEFAULT_GFX_THUMBNAIL_STREAM_DELAY; } /* Sets duration in ms of the thumbnail 'fade in' * animation */ -void menu_thumbnail_set_fade_duration(float duration) +void gfx_thumbnail_set_fade_duration(float duration) { - menu_thumbnail_fade_duration = (duration >= 0.0f) ? - duration : DEFAULT_MENU_THUMBNAIL_FADE_DURATION; + gfx_thumbnail_fade_duration = (duration >= 0.0f) ? + duration : DEFAULT_GFX_THUMBNAIL_FADE_DURATION; } /* Getters */ /* Fetches current streaming thumbnails request delay */ -float menu_thumbnail_get_stream_delay(void) +float gfx_thumbnail_get_stream_delay(void) { - return menu_thumbnail_stream_delay; + return gfx_thumbnail_stream_delay; } /* Fetches current 'fade in' animation duration */ -float menu_thumbnail_get_fade_duration(void) +float gfx_thumbnail_get_fade_duration(void) { - return menu_thumbnail_fade_duration; + return gfx_thumbnail_fade_duration; } /* Callbacks */ /* Used to process thumbnail data following completion * of image load task */ -static void menu_thumbnail_handle_upload( +static void gfx_thumbnail_handle_upload( retro_task_t *task, void *task_data, void *user_data, const char *err) { gfx_animation_ctx_entry_t animation_entry; struct texture_image *img = (struct texture_image*)task_data; - menu_thumbnail_tag_t *thumbnail_tag = (menu_thumbnail_tag_t*)user_data; + gfx_thumbnail_tag_t *thumbnail_tag = (gfx_thumbnail_tag_t*)user_data; /* Sanity check */ if (!thumbnail_tag) @@ -118,11 +117,11 @@ static void menu_thumbnail_handle_upload( /* Ensure that we are operating on the correct * thumbnail... */ - if (thumbnail_tag->list_id != menu_thumbnail_list_id) + if (thumbnail_tag->list_id != gfx_thumbnail_list_id) goto end; /* Only process image if we are waiting for it */ - if (thumbnail_tag->thumbnail->status != MENU_THUMBNAIL_STATUS_PENDING) + if (thumbnail_tag->thumbnail->status != GFX_THUMBNAIL_STATUS_PENDING) goto end; /* Sanity check: if thumbnail already has a texture, @@ -130,11 +129,11 @@ static void menu_thumbnail_handle_upload( * case, the best course of action is to just reset * the thumbnail... */ if (thumbnail_tag->thumbnail->texture) - menu_thumbnail_reset(thumbnail_tag->thumbnail); + gfx_thumbnail_reset(thumbnail_tag->thumbnail); /* Set thumbnail 'missing' status by default * (saves a number of checks later) */ - thumbnail_tag->thumbnail->status = MENU_THUMBNAIL_STATUS_MISSING; + thumbnail_tag->thumbnail->status = GFX_THUMBNAIL_STATUS_MISSING; /* Check we have a valid image */ if (!img) @@ -153,16 +152,16 @@ static void menu_thumbnail_handle_upload( thumbnail_tag->thumbnail->height = img->height; /* Update thumbnail status */ - thumbnail_tag->thumbnail->status = MENU_THUMBNAIL_STATUS_AVAILABLE; + thumbnail_tag->thumbnail->status = GFX_THUMBNAIL_STATUS_AVAILABLE; /* Trigger 'fade in' animation, if required */ - if (menu_thumbnail_fade_duration > 0.0f) + if (gfx_thumbnail_fade_duration > 0.0f) { thumbnail_tag->thumbnail->alpha = 0.0f; animation_entry.easing_enum = EASING_OUT_QUAD; animation_entry.tag = (uintptr_t)&thumbnail_tag->thumbnail->alpha; - animation_entry.duration = menu_thumbnail_fade_duration; + animation_entry.duration = gfx_thumbnail_fade_duration; animation_entry.target_value = 1.0f; animation_entry.subject = &thumbnail_tag->thumbnail->alpha; animation_entry.cb = NULL; @@ -189,31 +188,31 @@ end: /* When called, prevents the handling of any pending * thumbnail load requests - * >> **MUST** be called before deleting any menu_thumbnail_t - * objects passed to menu_thumbnail_request() or - * menu_thumbnail_process_stream(), otherwise + * >> **MUST** be called before deleting any gfx_thumbnail_t + * objects passed to gfx_thumbnail_request() or + * gfx_thumbnail_process_stream(), otherwise * heap-use-after-free errors *will* occur */ -void menu_thumbnail_cancel_pending_requests(void) +void gfx_thumbnail_cancel_pending_requests(void) { - menu_thumbnail_list_id++; + gfx_thumbnail_list_id++; } /* Requests loading of the specified thumbnail * - If operation fails, 'thumbnail->status' will be set to - * MENU_THUMBNAIL_STATUS_MISSING + * GFX_THUMBNAIL_STATUS_MISSING * - If operation is successful, 'thumbnail->status' will be - * set to MENU_THUMBNAIL_STATUS_PENDING + * set to GFX_THUMBNAIL_STATUS_PENDING * 'thumbnail' will be populated with texture info/metadata * once the image load is complete - * NOTE 1: Must be called *after* menu_thumbnail_set_system() - * and menu_thumbnail_set_content*() + * NOTE 1: Must be called *after* gfx_thumbnail_set_system() + * and gfx_thumbnail_set_content*() * NOTE 2: 'playlist' and 'idx' are only required here for * on-demand thumbnail download support * (an annoyance...) */ -void menu_thumbnail_request( - menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id, - playlist_t *playlist, size_t idx, menu_thumbnail_t *thumbnail, - unsigned menu_thumbnail_upscale_threshold, +void gfx_thumbnail_request( + gfx_thumbnail_path_data_t *path_data, enum gfx_thumbnail_id thumbnail_id, + playlist_t *playlist, size_t idx, gfx_thumbnail_t *thumbnail, + unsigned gfx_thumbnail_upscale_threshold, bool network_on_demand_thumbnails ) { @@ -225,36 +224,36 @@ void menu_thumbnail_request( /* Reset thumbnail, then set 'missing' status by default * (saves a number of checks later) */ - menu_thumbnail_reset(thumbnail); - thumbnail->status = MENU_THUMBNAIL_STATUS_MISSING; + gfx_thumbnail_reset(thumbnail); + thumbnail->status = GFX_THUMBNAIL_STATUS_MISSING; /* Update/extract thumbnail path */ - if (menu_thumbnail_is_enabled(path_data, thumbnail_id)) - if (menu_thumbnail_update_path(path_data, thumbnail_id)) - has_thumbnail = menu_thumbnail_get_path(path_data, thumbnail_id, &thumbnail_path); + if (gfx_thumbnail_is_enabled(path_data, thumbnail_id)) + if (gfx_thumbnail_update_path(path_data, thumbnail_id)) + has_thumbnail = gfx_thumbnail_get_path(path_data, thumbnail_id, &thumbnail_path); /* Load thumbnail, if required */ if (has_thumbnail) { if (path_is_valid(thumbnail_path)) { - menu_thumbnail_tag_t *thumbnail_tag = - (menu_thumbnail_tag_t*)calloc(1, sizeof(menu_thumbnail_tag_t)); + gfx_thumbnail_tag_t *thumbnail_tag = + (gfx_thumbnail_tag_t*)calloc(1, sizeof(gfx_thumbnail_tag_t)); if (!thumbnail_tag) return; /* Configure user data */ thumbnail_tag->thumbnail = thumbnail; - thumbnail_tag->list_id = menu_thumbnail_list_id; + thumbnail_tag->list_id = gfx_thumbnail_list_id; /* Would like to cancel any existing image load tasks * here, but can't see how to do it... */ if (task_push_image_load( thumbnail_path, video_driver_supports_rgba(), - menu_thumbnail_upscale_threshold, - menu_thumbnail_handle_upload, thumbnail_tag)) - thumbnail->status = MENU_THUMBNAIL_STATUS_PENDING; + gfx_thumbnail_upscale_threshold, + gfx_thumbnail_handle_upload, thumbnail_tag)) + thumbnail->status = GFX_THUMBNAIL_STATUS_PENDING; } #ifdef HAVE_NETWORKING /* Handle on demand thumbnail downloads */ @@ -268,13 +267,13 @@ void menu_thumbnail_request( return; /* Get current image name */ - if (!menu_thumbnail_get_img_name(path_data, &img_name)) + if (!gfx_thumbnail_get_img_name(path_data, &img_name)) return; /* Only trigger a thumbnail download if image * name has changed since the last call of - * menu_thumbnail_request() - * > Allows menu_thumbnail_request() to be used + * gfx_thumbnail_request() + * > Allows gfx_thumbnail_request() to be used * for successive right/left thumbnail requests * with minimal duplication of effort * (i.e. task_push_pl_entry_thumbnail_download() @@ -289,7 +288,7 @@ void menu_thumbnail_request( strlcpy(last_img_name, img_name, sizeof(last_img_name)); /* Get system name */ - if (!menu_thumbnail_get_system(path_data, &system)) + if (!gfx_thumbnail_get_system(path_data, &system)) return; /* Trigger thumbnail download */ @@ -309,20 +308,20 @@ void menu_thumbnail_request( * set to MUI_THUMBNAIL_STATUS_PENDING * 'thumbnail' will be populated with texture info/metadata * once the image load is complete */ -void menu_thumbnail_request_file( - const char *file_path, menu_thumbnail_t *thumbnail, - unsigned menu_thumbnail_upscale_threshold +void gfx_thumbnail_request_file( + const char *file_path, gfx_thumbnail_t *thumbnail, + unsigned gfx_thumbnail_upscale_threshold ) { - menu_thumbnail_tag_t *thumbnail_tag = NULL; + gfx_thumbnail_tag_t *thumbnail_tag = NULL; if (!thumbnail) return; /* Reset thumbnail, then set 'missing' status by default * (saves a number of checks later) */ - menu_thumbnail_reset(thumbnail); - thumbnail->status = MENU_THUMBNAIL_STATUS_MISSING; + gfx_thumbnail_reset(thumbnail); + thumbnail->status = GFX_THUMBNAIL_STATUS_MISSING; /* Check if file path is valid */ if (string_is_empty(file_path)) @@ -332,27 +331,27 @@ void menu_thumbnail_request_file( return; /* Load thumbnail */ - thumbnail_tag = (menu_thumbnail_tag_t*)calloc(1, sizeof(menu_thumbnail_tag_t)); + thumbnail_tag = (gfx_thumbnail_tag_t*)calloc(1, sizeof(gfx_thumbnail_tag_t)); if (!thumbnail_tag) return; /* Configure user data */ thumbnail_tag->thumbnail = thumbnail; - thumbnail_tag->list_id = menu_thumbnail_list_id; + thumbnail_tag->list_id = gfx_thumbnail_list_id; /* Would like to cancel any existing image load tasks * here, but can't see how to do it... */ if (task_push_image_load( file_path, video_driver_supports_rgba(), - menu_thumbnail_upscale_threshold, - menu_thumbnail_handle_upload, thumbnail_tag)) - thumbnail->status = MENU_THUMBNAIL_STATUS_PENDING; + gfx_thumbnail_upscale_threshold, + gfx_thumbnail_handle_upload, thumbnail_tag)) + thumbnail->status = GFX_THUMBNAIL_STATUS_PENDING; } /* Resets (and free()s the current texture of) the * specified thumbnail */ -void menu_thumbnail_reset(menu_thumbnail_t *thumbnail) +void gfx_thumbnail_reset(gfx_thumbnail_t *thumbnail) { if (!thumbnail) return; @@ -369,7 +368,7 @@ void menu_thumbnail_reset(menu_thumbnail_t *thumbnail) } /* Reset all parameters */ - thumbnail->status = MENU_THUMBNAIL_STATUS_UNKNOWN; + thumbnail->status = GFX_THUMBNAIL_STATUS_UNKNOWN; thumbnail->texture = 0; thumbnail->width = 0; thumbnail->height = 0; @@ -384,17 +383,17 @@ void menu_thumbnail_reset(menu_thumbnail_t *thumbnail) * - Must be called each frame for every on-screen entry * - Must be called once for each entry as it moves off-screen * (or can be called each frame - overheads are small) - * NOTE 1: Must be called *after* menu_thumbnail_set_system() - * NOTE 2: This function calls menu_thumbnail_set_content*() + * NOTE 1: Must be called *after* gfx_thumbnail_set_system() + * NOTE 2: This function calls gfx_thumbnail_set_content*() * NOTE 3: This function is intended for use in situations * where each menu entry has a *single* thumbnail. * If each entry has two thumbnails, use - * menu_thumbnail_process_streams() for improved + * gfx_thumbnail_process_streams() for improved * performance */ -void menu_thumbnail_process_stream( - menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id, - playlist_t *playlist, size_t idx, menu_thumbnail_t *thumbnail, bool on_screen, - unsigned menu_thumbnail_upscale_threshold, +void gfx_thumbnail_process_stream( + gfx_thumbnail_path_data_t *path_data, enum gfx_thumbnail_id thumbnail_id, + playlist_t *playlist, size_t idx, gfx_thumbnail_t *thumbnail, bool on_screen, + unsigned gfx_thumbnail_upscale_threshold, bool network_on_demand_thumbnails ) { @@ -405,32 +404,32 @@ void menu_thumbnail_process_stream( { /* Entry is on-screen * > Only process if current status is - * MENU_THUMBNAIL_STATUS_UNKNOWN */ - if (thumbnail->status == MENU_THUMBNAIL_STATUS_UNKNOWN) + * GFX_THUMBNAIL_STATUS_UNKNOWN */ + if (thumbnail->status == GFX_THUMBNAIL_STATUS_UNKNOWN) { /* Check if stream delay timer has elapsed */ thumbnail->delay_timer += gfx_animation_get_delta_time(); - if (thumbnail->delay_timer > menu_thumbnail_stream_delay) + if (thumbnail->delay_timer > gfx_thumbnail_stream_delay) { /* Sanity check */ if (!path_data || !playlist) return; /* Update thumbnail content */ - if (!menu_thumbnail_set_content_playlist(path_data, playlist, idx)) + if (!gfx_thumbnail_set_content_playlist(path_data, playlist, idx)) { /* Content is invalid * > Reset thumbnail and set missing status */ - menu_thumbnail_reset(thumbnail); - thumbnail->status = MENU_THUMBNAIL_STATUS_MISSING; + gfx_thumbnail_reset(thumbnail); + thumbnail->status = GFX_THUMBNAIL_STATUS_MISSING; return; } /* Request image load */ - menu_thumbnail_request( + gfx_thumbnail_request( path_data, thumbnail_id, playlist, idx, thumbnail, - menu_thumbnail_upscale_threshold, + gfx_thumbnail_upscale_threshold, network_on_demand_thumbnails ); } @@ -439,14 +438,14 @@ void menu_thumbnail_process_stream( else { /* Entry is off-screen - * > If status is MENU_THUMBNAIL_STATUS_UNKNOWN, + * > If status is GFX_THUMBNAIL_STATUS_UNKNOWN, * thumbnail is already in a blank state - but we * must ensure that delay timer is set to zero */ - if (thumbnail->status == MENU_THUMBNAIL_STATUS_UNKNOWN) + if (thumbnail->status == GFX_THUMBNAIL_STATUS_UNKNOWN) thumbnail->delay_timer = 0.0f; /* In all other cases, reset thumbnail */ else - menu_thumbnail_reset(thumbnail); + gfx_thumbnail_reset(thumbnail); } } @@ -455,19 +454,19 @@ void menu_thumbnail_process_stream( * - Must be called each frame for every on-screen entry * - Must be called once for each entry as it moves off-screen * (or can be called each frame - overheads are small) - * NOTE 1: Must be called *after* menu_thumbnail_set_system() - * NOTE 2: This function calls menu_thumbnail_set_content*() + * NOTE 1: Must be called *after* gfx_thumbnail_set_system() + * NOTE 2: This function calls gfx_thumbnail_set_content*() * NOTE 3: This function is intended for use in situations * where each menu entry has *two* thumbnails. * If each entry only has a single thumbnail, use - * menu_thumbnail_process_stream() for improved + * gfx_thumbnail_process_stream() for improved * performance */ -void menu_thumbnail_process_streams( - menu_thumbnail_path_data_t *path_data, +void gfx_thumbnail_process_streams( + gfx_thumbnail_path_data_t *path_data, playlist_t *playlist, size_t idx, - menu_thumbnail_t *right_thumbnail, menu_thumbnail_t *left_thumbnail, + gfx_thumbnail_t *right_thumbnail, gfx_thumbnail_t *left_thumbnail, bool on_screen, - unsigned menu_thumbnail_upscale_threshold, + unsigned gfx_thumbnail_upscale_threshold, bool network_on_demand_thumbnails ) { @@ -478,9 +477,9 @@ void menu_thumbnail_process_streams( { /* Entry is on-screen * > Only process if current status is - * MENU_THUMBNAIL_STATUS_UNKNOWN */ - bool process_right = (right_thumbnail->status == MENU_THUMBNAIL_STATUS_UNKNOWN); - bool process_left = (left_thumbnail->status == MENU_THUMBNAIL_STATUS_UNKNOWN); + * GFX_THUMBNAIL_STATUS_UNKNOWN */ + bool process_right = (right_thumbnail->status == GFX_THUMBNAIL_STATUS_UNKNOWN); + bool process_left = (left_thumbnail->status == GFX_THUMBNAIL_STATUS_UNKNOWN); if (process_right || process_left) { @@ -493,14 +492,14 @@ void menu_thumbnail_process_streams( { right_thumbnail->delay_timer += delta_time; request_right = - (right_thumbnail->delay_timer > menu_thumbnail_stream_delay); + (right_thumbnail->delay_timer > gfx_thumbnail_stream_delay); } if (process_left) { left_thumbnail->delay_timer += delta_time; request_left = - (left_thumbnail->delay_timer > menu_thumbnail_stream_delay); + (left_thumbnail->delay_timer > gfx_thumbnail_stream_delay); } /* Check if one or more thumbnails should be requested */ @@ -511,20 +510,20 @@ void menu_thumbnail_process_streams( return; /* Update thumbnail content */ - if (!menu_thumbnail_set_content_playlist(path_data, playlist, idx)) + if (!gfx_thumbnail_set_content_playlist(path_data, playlist, idx)) { /* Content is invalid * > Reset thumbnail and set missing status */ if (request_right) { - menu_thumbnail_reset(right_thumbnail); - right_thumbnail->status = MENU_THUMBNAIL_STATUS_MISSING; + gfx_thumbnail_reset(right_thumbnail); + right_thumbnail->status = GFX_THUMBNAIL_STATUS_MISSING; } if (request_left) { - menu_thumbnail_reset(left_thumbnail); - left_thumbnail->status = MENU_THUMBNAIL_STATUS_MISSING; + gfx_thumbnail_reset(left_thumbnail); + left_thumbnail->status = GFX_THUMBNAIL_STATUS_MISSING; } return; @@ -532,15 +531,15 @@ void menu_thumbnail_process_streams( /* Request image load */ if (request_right) - menu_thumbnail_request( - path_data, MENU_THUMBNAIL_RIGHT, playlist, idx, right_thumbnail, - menu_thumbnail_upscale_threshold, + gfx_thumbnail_request( + path_data, GFX_THUMBNAIL_RIGHT, playlist, idx, right_thumbnail, + gfx_thumbnail_upscale_threshold, network_on_demand_thumbnails); if (request_left) - menu_thumbnail_request( - path_data, MENU_THUMBNAIL_LEFT, playlist, idx, left_thumbnail, - menu_thumbnail_upscale_threshold, + gfx_thumbnail_request( + path_data, GFX_THUMBNAIL_LEFT, playlist, idx, left_thumbnail, + gfx_thumbnail_upscale_threshold, network_on_demand_thumbnails); } } @@ -548,19 +547,19 @@ void menu_thumbnail_process_streams( else { /* Entry is off-screen - * > If status is MENU_THUMBNAIL_STATUS_UNKNOWN, + * > If status is GFX_THUMBNAIL_STATUS_UNKNOWN, * thumbnail is already in a blank state - but we * must ensure that delay timer is set to zero * > In all other cases, reset thumbnail */ - if (right_thumbnail->status == MENU_THUMBNAIL_STATUS_UNKNOWN) + if (right_thumbnail->status == GFX_THUMBNAIL_STATUS_UNKNOWN) right_thumbnail->delay_timer = 0.0f; else - menu_thumbnail_reset(right_thumbnail); + gfx_thumbnail_reset(right_thumbnail); - if (left_thumbnail->status == MENU_THUMBNAIL_STATUS_UNKNOWN) + if (left_thumbnail->status == GFX_THUMBNAIL_STATUS_UNKNOWN) left_thumbnail->delay_timer = 0.0f; else - menu_thumbnail_reset(left_thumbnail); + gfx_thumbnail_reset(left_thumbnail); } } @@ -569,8 +568,8 @@ void menu_thumbnail_process_streams( /* Determines the actual screen dimensions of a * thumbnail when centred with aspect correct * scaling within a rectangle of (width x height) */ -void menu_thumbnail_get_draw_dimensions( - menu_thumbnail_t *thumbnail, +void gfx_thumbnail_get_draw_dimensions( + gfx_thumbnail_t *thumbnail, unsigned width, unsigned height, float scale_factor, float *draw_width, float *draw_height) { @@ -626,12 +625,12 @@ error: * size of the thumbnail beyond the limits of the * (width x height) rectangle (alignment + aspect * correct scaling is preserved). Use with caution */ -void menu_thumbnail_draw( - video_frame_info_t *video_info, menu_thumbnail_t *thumbnail, +void gfx_thumbnail_draw( + video_frame_info_t *video_info, gfx_thumbnail_t *thumbnail, float x, float y, unsigned width, unsigned height, - enum menu_thumbnail_alignment alignment, + enum gfx_thumbnail_alignment alignment, float alpha, float scale_factor, - menu_thumbnail_shadow_t *shadow) + gfx_thumbnail_shadow_t *shadow) { /* Sanity check */ if (!video_info || !thumbnail || @@ -639,7 +638,7 @@ void menu_thumbnail_draw( return; /* Only draw thumbnail if it is available... */ - if (thumbnail->status == MENU_THUMBNAIL_STATUS_AVAILABLE) + if (thumbnail->status == GFX_THUMBNAIL_STATUS_AVAILABLE) { gfx_display_ctx_rotate_draw_t rotate_draw; gfx_display_ctx_draw_t draw; @@ -664,7 +663,7 @@ void menu_thumbnail_draw( gfx_display_set_alpha(thumbnail_color, thumbnail_alpha); /* Get thumbnail dimensions */ - menu_thumbnail_get_draw_dimensions( + gfx_thumbnail_get_draw_dimensions( thumbnail, width, height, scale_factor, &draw_width, &draw_height); @@ -709,31 +708,31 @@ void menu_thumbnail_draw( /* Set thumbnail alignment within bounding box */ switch (alignment) { - case MENU_THUMBNAIL_ALIGN_TOP: + case GFX_THUMBNAIL_ALIGN_TOP: /* Centred horizontally */ draw_x = x + ((float)width - draw_width) / 2.0f; /* Drawn at top of bounding box */ draw_y = (float)video_info->height - y - draw_height; break; - case MENU_THUMBNAIL_ALIGN_BOTTOM: + case GFX_THUMBNAIL_ALIGN_BOTTOM: /* Centred horizontally */ draw_x = x + ((float)width - draw_width) / 2.0f; /* Drawn at bottom of bounding box */ draw_y = (float)video_info->height - y - (float)height; break; - case MENU_THUMBNAIL_ALIGN_LEFT: + case GFX_THUMBNAIL_ALIGN_LEFT: /* Drawn at left side of bounding box */ draw_x = x; /* Centred vertically */ draw_y = (float)video_info->height - y - draw_height - ((float)height - draw_height) / 2.0f; break; - case MENU_THUMBNAIL_ALIGN_RIGHT: + case GFX_THUMBNAIL_ALIGN_RIGHT: /* Drawn at right side of bounding box */ draw_x = x + (float)width - draw_width; /* Centred vertically */ draw_y = (float)video_info->height - y - draw_height - ((float)height - draw_height) / 2.0f; break; - case MENU_THUMBNAIL_ALIGN_CENTRE: + case GFX_THUMBNAIL_ALIGN_CENTRE: default: /* Centred both horizontally and vertically */ draw_x = x + ((float)width - draw_width) / 2.0f; @@ -745,7 +744,7 @@ void menu_thumbnail_draw( if (shadow) { /* Sanity check */ - if ((shadow->type != MENU_THUMBNAIL_SHADOW_NONE) && + if ((shadow->type != GFX_THUMBNAIL_SHADOW_NONE) && (shadow->alpha > 0.0f)) { float shadow_width; @@ -768,15 +767,15 @@ void menu_thumbnail_draw( /* Configure shadow based on effect type * > Not using a switch() here, since we've - * already eliminated MENU_THUMBNAIL_SHADOW_NONE */ - if (shadow->type == MENU_THUMBNAIL_SHADOW_OUTLINE) + * already eliminated GFX_THUMBNAIL_SHADOW_NONE */ + if (shadow->type == GFX_THUMBNAIL_SHADOW_OUTLINE) { shadow_width = draw_width + (float)(shadow->outline.width * 2); shadow_height = draw_height + (float)(shadow->outline.width * 2); shadow_x = draw_x - (float)shadow->outline.width; shadow_y = draw_y - (float)shadow->outline.width; } - /* Default: MENU_THUMBNAIL_SHADOW_DROP */ + /* Default: GFX_THUMBNAIL_SHADOW_DROP */ else { shadow_width = draw_width; diff --git a/menu/menu_thumbnail.h b/gfx/gfx_thumbnail.h similarity index 65% rename from menu/menu_thumbnail.h rename to gfx/gfx_thumbnail.h index d6cb33e18e..29577f2113 100644 --- a/menu/menu_thumbnail.h +++ b/gfx/gfx_thumbnail.h @@ -1,7 +1,7 @@ /* Copyright (C) 2010-2019 The RetroArch team * * --------------------------------------------------------------------------------------- - * The following license statement only applies to this file (menu_thumbnail.c). + * The following license statement only applies to this file (gfx_thumbnail.c). * --------------------------------------------------------------------------------------- * * Permission is hereby granted, free of charge, @@ -20,65 +20,65 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef __MENU_THUMBNAIL_H -#define __MENU_THUMBNAIL_H +#ifndef __GFX_THUMBNAIL_H +#define __GFX_THUMBNAIL_H #include #include #include -#include "menu_thumbnail_path.h" +#include "gfx_thumbnail_path.h" RETRO_BEGIN_DECLS /* Defines the current status of an entry * thumbnail texture */ -enum menu_thumbnail_status +enum gfx_thumbnail_status { - MENU_THUMBNAIL_STATUS_UNKNOWN = 0, - MENU_THUMBNAIL_STATUS_PENDING, - MENU_THUMBNAIL_STATUS_AVAILABLE, - MENU_THUMBNAIL_STATUS_MISSING + GFX_THUMBNAIL_STATUS_UNKNOWN = 0, + GFX_THUMBNAIL_STATUS_PENDING, + GFX_THUMBNAIL_STATUS_AVAILABLE, + GFX_THUMBNAIL_STATUS_MISSING }; /* Defines thumbnail alignment within - * menu_thumbnail_draw() bounding box */ -enum menu_thumbnail_alignment + * gfx_thumbnail_draw() bounding box */ +enum gfx_thumbnail_alignment { - MENU_THUMBNAIL_ALIGN_CENTRE = 0, - MENU_THUMBNAIL_ALIGN_TOP, - MENU_THUMBNAIL_ALIGN_BOTTOM, - MENU_THUMBNAIL_ALIGN_LEFT, - MENU_THUMBNAIL_ALIGN_RIGHT + GFX_THUMBNAIL_ALIGN_CENTRE = 0, + GFX_THUMBNAIL_ALIGN_TOP, + GFX_THUMBNAIL_ALIGN_BOTTOM, + GFX_THUMBNAIL_ALIGN_LEFT, + GFX_THUMBNAIL_ALIGN_RIGHT }; /* Defines all possible thumbnail shadow * effect types */ -enum menu_thumbnail_shadow_type +enum gfx_thumbnail_shadow_type { - MENU_THUMBNAIL_SHADOW_NONE = 0, - MENU_THUMBNAIL_SHADOW_DROP, - MENU_THUMBNAIL_SHADOW_OUTLINE + GFX_THUMBNAIL_SHADOW_NONE = 0, + GFX_THUMBNAIL_SHADOW_DROP, + GFX_THUMBNAIL_SHADOW_OUTLINE }; /* Holds all runtime parameters associated with * an entry thumbnail */ typedef struct { - enum menu_thumbnail_status status; + enum gfx_thumbnail_status status; uintptr_t texture; unsigned width; unsigned height; float alpha; float delay_timer; -} menu_thumbnail_t; +} gfx_thumbnail_t; /* Holds all configuration parameters associated * with a thumbnail shadow effect */ typedef struct { - enum menu_thumbnail_shadow_type type; + enum gfx_thumbnail_shadow_type type; float alpha; struct { @@ -89,36 +89,36 @@ typedef struct { unsigned width; } outline; -} menu_thumbnail_shadow_t; +} gfx_thumbnail_shadow_t; /* Setters */ /* When streaming thumbnails, sets time in ms that an * entry must be on screen before an image load is * requested */ -void menu_thumbnail_set_stream_delay(float delay); +void gfx_thumbnail_set_stream_delay(float delay); /* Sets duration in ms of the thumbnail 'fade in' * animation */ -void menu_thumbnail_set_fade_duration(float duration); +void gfx_thumbnail_set_fade_duration(float duration); /* Getters */ /* Fetches current streaming thumbnails request delay */ -float menu_thumbnail_get_stream_delay(void); +float gfx_thumbnail_get_stream_delay(void); /* Fetches current 'fade in' animation duration */ -float menu_thumbnail_get_fade_duration(void); +float gfx_thumbnail_get_fade_duration(void); /* Core interface */ /* When called, prevents the handling of any pending * thumbnail load requests - * >> **MUST** be called before deleting any menu_thumbnail_t - * objects passed to menu_thumbnail_request() or - * menu_thumbnail_process_stream(), otherwise + * >> **MUST** be called before deleting any gfx_thumbnail_t + * objects passed to gfx_thumbnail_request() or + * gfx_thumbnail_process_stream(), otherwise * heap-use-after-free errors *will* occur */ -void menu_thumbnail_cancel_pending_requests(void); +void gfx_thumbnail_cancel_pending_requests(void); /* Requests loading of the specified thumbnail * - If operation fails, 'thumbnail->status' will be set to @@ -127,15 +127,15 @@ void menu_thumbnail_cancel_pending_requests(void); * set to MUI_THUMBNAIL_STATUS_PENDING * 'thumbnail' will be populated with texture info/metadata * once the image load is complete - * NOTE 1: Must be called *after* menu_thumbnail_set_system() - * and menu_thumbnail_set_content*() + * NOTE 1: Must be called *after* gfx_thumbnail_set_system() + * and gfx_thumbnail_set_content*() * NOTE 2: 'playlist' and 'idx' are only required here for * on-demand thumbnail download support * (an annoyance...) */ -void menu_thumbnail_request( - menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id, - playlist_t *playlist, size_t idx, menu_thumbnail_t *thumbnail, - unsigned menu_thumbnail_upscale_threshold, +void gfx_thumbnail_request( + gfx_thumbnail_path_data_t *path_data, enum gfx_thumbnail_id thumbnail_id, + playlist_t *playlist, size_t idx, gfx_thumbnail_t *thumbnail, + unsigned gfx_thumbnail_upscale_threshold, bool network_on_demand_thumbnails ); @@ -147,13 +147,13 @@ void menu_thumbnail_request( * set to MUI_THUMBNAIL_STATUS_PENDING * 'thumbnail' will be populated with texture info/metadata * once the image load is complete */ -void menu_thumbnail_request_file( - const char *file_path, menu_thumbnail_t *thumbnail, - unsigned menu_thumbnail_upscale_threshold); +void gfx_thumbnail_request_file( + const char *file_path, gfx_thumbnail_t *thumbnail, + unsigned gfx_thumbnail_upscale_threshold); /* Resets (and free()s the current texture of) the * specified thumbnail */ -void menu_thumbnail_reset(menu_thumbnail_t *thumbnail); +void gfx_thumbnail_reset(gfx_thumbnail_t *thumbnail); /* Stream processing */ @@ -162,17 +162,17 @@ void menu_thumbnail_reset(menu_thumbnail_t *thumbnail); * - Must be called each frame for every on-screen entry * - Must be called once for each entry as it moves off-screen * (or can be called each frame - overheads are small) - * NOTE 1: Must be called *after* menu_thumbnail_set_system() - * NOTE 2: This function calls menu_thumbnail_set_content*() + * NOTE 1: Must be called *after* gfx_thumbnail_set_system() + * NOTE 2: This function calls gfx_thumbnail_set_content*() * NOTE 3: This function is intended for use in situations * where each menu entry has a *single* thumbnail. * If each entry has two thumbnails, use - * menu_thumbnail_process_streams() for improved + * gfx_thumbnail_process_streams() for improved * performance */ -void menu_thumbnail_process_stream( - menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id, - playlist_t *playlist, size_t idx, menu_thumbnail_t *thumbnail, bool on_screen, - unsigned menu_thumbnail_upscale_threshold, +void gfx_thumbnail_process_stream( + gfx_thumbnail_path_data_t *path_data, enum gfx_thumbnail_id thumbnail_id, + playlist_t *playlist, size_t idx, gfx_thumbnail_t *thumbnail, bool on_screen, + unsigned gfx_thumbnail_upscale_threshold, bool network_on_demand_thumbnails ); @@ -181,19 +181,19 @@ void menu_thumbnail_process_stream( * - Must be called each frame for every on-screen entry * - Must be called once for each entry as it moves off-screen * (or can be called each frame - overheads are small) - * NOTE 1: Must be called *after* menu_thumbnail_set_system() - * NOTE 2: This function calls menu_thumbnail_set_content*() + * NOTE 1: Must be called *after* gfx_thumbnail_set_system() + * NOTE 2: This function calls gfx_thumbnail_set_content*() * NOTE 3: This function is intended for use in situations * where each menu entry has *two* thumbnails. * If each entry only has a single thumbnail, use - * menu_thumbnail_process_stream() for improved + * gfx_thumbnail_process_stream() for improved * performance */ -void menu_thumbnail_process_streams( - menu_thumbnail_path_data_t *path_data, +void gfx_thumbnail_process_streams( + gfx_thumbnail_path_data_t *path_data, playlist_t *playlist, size_t idx, - menu_thumbnail_t *right_thumbnail, menu_thumbnail_t *left_thumbnail, + gfx_thumbnail_t *right_thumbnail, gfx_thumbnail_t *left_thumbnail, bool on_screen, - unsigned menu_thumbnail_upscale_threshold, + unsigned gfx_thumbnail_upscale_threshold, bool network_on_demand_thumbnails ); @@ -202,8 +202,8 @@ void menu_thumbnail_process_streams( /* Determines the actual screen dimensions of a * thumbnail when centred with aspect correct * scaling within a rectangle of (width x height) */ -void menu_thumbnail_get_draw_dimensions( - menu_thumbnail_t *thumbnail, +void gfx_thumbnail_get_draw_dimensions( + gfx_thumbnail_t *thumbnail, unsigned width, unsigned height, float scale_factor, float *draw_width, float *draw_height); @@ -216,12 +216,12 @@ void menu_thumbnail_get_draw_dimensions( * size of the thumbnail beyond the limits of the * (width x height) rectangle (alignment + aspect * correct scaling is preserved). Use with caution */ -void menu_thumbnail_draw( - video_frame_info_t *video_info, menu_thumbnail_t *thumbnail, +void gfx_thumbnail_draw( + video_frame_info_t *video_info, gfx_thumbnail_t *thumbnail, float x, float y, unsigned width, unsigned height, - enum menu_thumbnail_alignment alignment, + enum gfx_thumbnail_alignment alignment, float alpha, float scale_factor, - menu_thumbnail_shadow_t *shadow); + gfx_thumbnail_shadow_t *shadow); RETRO_END_DECLS diff --git a/menu/menu_thumbnail_path.c b/gfx/gfx_thumbnail_path.c similarity index 87% rename from menu/menu_thumbnail_path.c rename to gfx/gfx_thumbnail_path.c index 346a777999..53a7855c71 100644 --- a/menu/menu_thumbnail_path.c +++ b/gfx/gfx_thumbnail_path.c @@ -1,7 +1,7 @@ /* Copyright (C) 2010-2019 The RetroArch team * * --------------------------------------------------------------------------------------- - * The following license statement only applies to this file (menu_thumbnail_path.c). + * The following license statement only applies to this file (gfx_thumbnail_path.c). * --------------------------------------------------------------------------------------- * * Permission is hereby granted, free of charge, @@ -34,14 +34,12 @@ #include "../paths.h" #include "../file_path_special.h" -#include "menu_driver.h" - -#include "menu_thumbnail_path.h" +#include "gfx_thumbnail_path.h" /* Used fixed size char arrays here, just to avoid * the inconvenience of having to calloc()/free() * each individual entry by hand... */ -struct menu_thumbnail_path_data +struct gfx_thumbnail_path_data { char system[PATH_MAX_LENGTH]; char content_path[PATH_MAX_LENGTH]; @@ -58,12 +56,12 @@ struct menu_thumbnail_path_data /* Initialisation */ /* Creates new thumbnail path data container. - * Returns handle to new menu_thumbnail_path_data_t object. + * Returns handle to new gfx_thumbnail_path_data_t object. * on success, otherwise NULL. * Note: Returned object must be free()d */ -menu_thumbnail_path_data_t *menu_thumbnail_path_init(void) +gfx_thumbnail_path_data_t *gfx_thumbnail_path_init(void) { - menu_thumbnail_path_data_t *path_data = (menu_thumbnail_path_data_t*) + gfx_thumbnail_path_data_t *path_data = (gfx_thumbnail_path_data_t*) calloc(1, sizeof(*path_data)); if (!path_data) return NULL; @@ -78,7 +76,7 @@ menu_thumbnail_path_data_t *menu_thumbnail_path_init(void) /* Resets thumbnail path data * (blanks all internal string containers) */ -void menu_thumbnail_path_reset(menu_thumbnail_path_data_t *path_data) +void gfx_thumbnail_path_reset(gfx_thumbnail_path_data_t *path_data) { if (!path_data) return; @@ -102,7 +100,8 @@ void menu_thumbnail_path_reset(menu_thumbnail_path_data_t *path_data) * Named_Titles, Named_Boxarts) corresponding to the * specified 'type index' (1, 2, 3). * Returns true if 'type index' is valid */ -bool menu_thumbnail_get_sub_directory(unsigned type_idx, const char **sub_directory) +bool gfx_thumbnail_get_sub_directory( + unsigned type_idx, const char **sub_directory) { if (!sub_directory) return false; @@ -129,7 +128,8 @@ bool menu_thumbnail_get_sub_directory(unsigned type_idx, const char **sub_direct /* Returns currently set thumbnail 'type' (Named_Snaps, * Named_Titles, Named_Boxarts) for specified thumbnail * identifier (right, left) */ -const char *menu_thumbnail_get_type(menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id) +const char *gfx_thumbnail_get_type( + gfx_thumbnail_path_data_t *path_data, enum gfx_thumbnail_id thumbnail_id) { settings_t *settings = config_get_ptr(); unsigned type = 0; @@ -139,13 +139,13 @@ const char *menu_thumbnail_get_type(menu_thumbnail_path_data_t *path_data, enum switch (thumbnail_id) { - case MENU_THUMBNAIL_RIGHT: + case GFX_THUMBNAIL_RIGHT: if (path_data->playlist_right_mode != PLAYLIST_THUMBNAIL_MODE_DEFAULT) type = (unsigned)path_data->playlist_right_mode - 1; else - type = settings->uints.menu_thumbnails; + type = settings->uints.gfx_thumbnails; break; - case MENU_THUMBNAIL_LEFT: + case GFX_THUMBNAIL_LEFT: if (path_data->playlist_left_mode != PLAYLIST_THUMBNAIL_MODE_DEFAULT) type = (unsigned)path_data->playlist_left_mode - 1; else @@ -173,7 +173,7 @@ const char *menu_thumbnail_get_type(menu_thumbnail_path_data_t *path_data, enum /* Returns true if specified thumbnail is enabled * (i.e. if 'type' is not equal to MENU_ENUM_LABEL_VALUE_OFF) */ -bool menu_thumbnail_is_enabled(menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id) +bool gfx_thumbnail_is_enabled(gfx_thumbnail_path_data_t *path_data, enum gfx_thumbnail_id thumbnail_id) { settings_t *settings = config_get_ptr(); @@ -182,11 +182,11 @@ bool menu_thumbnail_is_enabled(menu_thumbnail_path_data_t *path_data, enum menu_ switch (thumbnail_id) { - case MENU_THUMBNAIL_RIGHT: + case GFX_THUMBNAIL_RIGHT: if (path_data->playlist_right_mode != PLAYLIST_THUMBNAIL_MODE_DEFAULT) return path_data->playlist_right_mode != PLAYLIST_THUMBNAIL_MODE_OFF; - return settings->uints.menu_thumbnails != 0; - case MENU_THUMBNAIL_LEFT: + return settings->uints.gfx_thumbnails != 0; + case GFX_THUMBNAIL_LEFT: if (path_data->playlist_left_mode != PLAYLIST_THUMBNAIL_MODE_DEFAULT) return path_data->playlist_left_mode != PLAYLIST_THUMBNAIL_MODE_OFF; return settings->uints.menu_left_thumbnails != 0; @@ -201,7 +201,7 @@ bool menu_thumbnail_is_enabled(menu_thumbnail_path_data_t *path_data, enum menu_ /* Fills content_img field of path_data using existing * content_label field (for internal use only) */ -static void fill_content_img(menu_thumbnail_path_data_t *path_data) +static void fill_content_img(gfx_thumbnail_path_data_t *path_data) { char *scrub_char_pointer = NULL; @@ -224,10 +224,10 @@ static void fill_content_img(menu_thumbnail_path_data_t *path_data) * Returns true if 'system' is valid. * If playlist is provided, extracts system-specific * thumbnail assignment metadata (required for accurate - * usage of menu_thumbnail_is_enabled()) + * usage of gfx_thumbnail_is_enabled()) * > Used as a fallback when individual content lacks an * associated database name */ -bool menu_thumbnail_set_system(menu_thumbnail_path_data_t *path_data, +bool gfx_thumbnail_set_system(gfx_thumbnail_path_data_t *path_data, const char *system, playlist_t *playlist) { if (!path_data) @@ -257,7 +257,7 @@ bool menu_thumbnail_set_system(menu_thumbnail_path_data_t *path_data, /* Addendum: Now that we have per-playlist thumbnail display * modes, we must extract them here - otherwise - * menu_thumbnail_is_enabled() will go out of sync */ + * gfx_thumbnail_is_enabled() will go out of sync */ if (playlist) { const char *playlist_path = playlist_get_conf_path(playlist); @@ -315,7 +315,7 @@ bool menu_thumbnail_set_system(menu_thumbnail_path_data_t *path_data, /* Sets current thumbnail content according to the specified label. * Returns true if content is valid */ -bool menu_thumbnail_set_content(menu_thumbnail_path_data_t *path_data, const char *label) +bool gfx_thumbnail_set_content(gfx_thumbnail_path_data_t *path_data, const char *label) { if (!path_data) return false; @@ -358,8 +358,8 @@ bool menu_thumbnail_set_content(menu_thumbnail_path_data_t *path_data, const cha /* Sets current thumbnail content to the specified image. * Returns true if content is valid */ -bool menu_thumbnail_set_content_image( - menu_thumbnail_path_data_t *path_data, +bool gfx_thumbnail_set_content_image( + gfx_thumbnail_path_data_t *path_data, const char *img_dir, const char *img_name) { char *content_img_no_ext = NULL; @@ -415,7 +415,7 @@ bool menu_thumbnail_set_content_image( "imageviewer", sizeof(path_data->content_core_name)); /* Set database name (arbitrarily) to "_images_" - * (required for compatibility with menu_thumbnail_update_path(), + * (required for compatibility with gfx_thumbnail_update_path(), * but not actually used...) */ strlcpy(path_data->content_db_name, "_images_", sizeof(path_data->content_db_name)); @@ -434,7 +434,8 @@ bool menu_thumbnail_set_content_image( * corresponding menu entry label will contain a useful * identifier (it may be 'tainted', e.g. with the current * core name). 'Real' labels should be extracted from source */ -bool menu_thumbnail_set_content_playlist(menu_thumbnail_path_data_t *path_data, playlist_t *playlist, size_t idx) +bool gfx_thumbnail_set_content_playlist( + gfx_thumbnail_path_data_t *path_data, playlist_t *playlist, size_t idx) { const char *content_path = NULL; const char *content_label = NULL; @@ -553,18 +554,20 @@ bool menu_thumbnail_set_content_playlist(menu_thumbnail_path_data_t *path_data, /* Updates path for specified thumbnail identifier (right, left). * Must be called after: - * - menu_thumbnail_set_system() - * - menu_thumbnail_set_content*() + * - gfx_thumbnail_set_system() + * - gfx_thumbnail_set_content*() * ...and before: - * - menu_thumbnail_get_path() + * - gfx_thumbnail_get_path() * Returns true if generated path is valid */ -bool menu_thumbnail_update_path(menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id) +bool gfx_thumbnail_update_path( + gfx_thumbnail_path_data_t *path_data, enum gfx_thumbnail_id thumbnail_id) { - settings_t *settings = config_get_ptr(); - const char *type = menu_thumbnail_get_type(path_data, thumbnail_id); - const char *system_name = NULL; - char *thumbnail_path = NULL; char content_dir[PATH_MAX_LENGTH]; + settings_t *settings = config_get_ptr(); + const char *type = gfx_thumbnail_get_type(path_data, thumbnail_id); + const char *system_name = NULL; + char *thumbnail_path = NULL; + const char *dir_thumbnails = settings ? settings->paths.directory_thumbnails : NULL; if (!path_data) return false; @@ -572,10 +575,10 @@ bool menu_thumbnail_update_path(menu_thumbnail_path_data_t *path_data, enum menu /* Determine which path we are updating... */ switch (thumbnail_id) { - case MENU_THUMBNAIL_RIGHT: + case GFX_THUMBNAIL_RIGHT: thumbnail_path = path_data->right_path; break; - case MENU_THUMBNAIL_LEFT: + case GFX_THUMBNAIL_LEFT: thumbnail_path = path_data->left_path; break; default: @@ -589,10 +592,10 @@ bool menu_thumbnail_update_path(menu_thumbnail_path_data_t *path_data, enum menu if (!settings) return false; - if (string_is_empty(settings->paths.directory_thumbnails)) + if (string_is_empty(dir_thumbnails)) return false; - if (!menu_thumbnail_is_enabled(path_data, thumbnail_id)) + if (!gfx_thumbnail_is_enabled(path_data, thumbnail_id)) return false; /* Generate new path */ @@ -614,7 +617,7 @@ bool menu_thumbnail_update_path(menu_thumbnail_path_data_t *path_data, enum menu if (string_is_equal(path_data->system, "history") || string_is_equal(path_data->system, "favorites")) { - if (!menu_thumbnail_get_content_dir( + if (!gfx_thumbnail_get_content_dir( path_data, content_dir, sizeof(content_dir))) return false; @@ -644,7 +647,7 @@ bool menu_thumbnail_update_path(menu_thumbnail_path_data_t *path_data, enum menu /* > Normal content: assemble path */ /* >> Base + system name */ - fill_pathname_join(thumbnail_path, settings->paths.directory_thumbnails, + fill_pathname_join(thumbnail_path, dir_thumbnails, system_name, PATH_MAX_LENGTH * sizeof(char)); /* >> Add type */ @@ -668,9 +671,9 @@ bool menu_thumbnail_update_path(menu_thumbnail_path_data_t *path_data, enum menu /* Fetches the current thumbnail file path of the * specified thumbnail 'type'. * Returns true if path is valid. */ -bool menu_thumbnail_get_path( - menu_thumbnail_path_data_t *path_data, - enum menu_thumbnail_id thumbnail_id, const char **path) +bool gfx_thumbnail_get_path( + gfx_thumbnail_path_data_t *path_data, + enum gfx_thumbnail_id thumbnail_id, const char **path) { char *thumbnail_path = NULL; @@ -682,10 +685,10 @@ bool menu_thumbnail_get_path( switch (thumbnail_id) { - case MENU_THUMBNAIL_RIGHT: + case GFX_THUMBNAIL_RIGHT: thumbnail_path = path_data->right_path; break; - case MENU_THUMBNAIL_LEFT: + case GFX_THUMBNAIL_LEFT: thumbnail_path = path_data->left_path; break; default: @@ -702,8 +705,8 @@ bool menu_thumbnail_get_path( /* Fetches current 'system' (default database name). * Returns true if 'system' is valid. */ -bool menu_thumbnail_get_system( - menu_thumbnail_path_data_t *path_data, const char **system) +bool gfx_thumbnail_get_system( + gfx_thumbnail_path_data_t *path_data, const char **system) { if (!path_data) return false; @@ -721,8 +724,8 @@ bool menu_thumbnail_get_system( /* Fetches current content path. * Returns true if content path is valid. */ -bool menu_thumbnail_get_content_path( - menu_thumbnail_path_data_t *path_data, const char **content_path) +bool gfx_thumbnail_get_content_path( + gfx_thumbnail_path_data_t *path_data, const char **content_path) { if (!path_data) return false; @@ -740,8 +743,8 @@ bool menu_thumbnail_get_content_path( /* Fetches current thumbnail label. * Returns true if label is valid. */ -bool menu_thumbnail_get_label( - menu_thumbnail_path_data_t *path_data, const char **label) +bool gfx_thumbnail_get_label( + gfx_thumbnail_path_data_t *path_data, const char **label) { if (!path_data) return false; @@ -759,8 +762,8 @@ bool menu_thumbnail_get_label( /* Fetches current thumbnail core name. * Returns true if core name is valid. */ -bool menu_thumbnail_get_core_name( - menu_thumbnail_path_data_t *path_data, const char **core_name) +bool gfx_thumbnail_get_core_name( + gfx_thumbnail_path_data_t *path_data, const char **core_name) { if (!path_data) return false; @@ -778,8 +781,8 @@ bool menu_thumbnail_get_core_name( /* Fetches current database name. * Returns true if database name is valid. */ -bool menu_thumbnail_get_db_name( - menu_thumbnail_path_data_t *path_data, const char **db_name) +bool gfx_thumbnail_get_db_name( + gfx_thumbnail_path_data_t *path_data, const char **db_name) { if (!path_data) return false; @@ -798,8 +801,8 @@ bool menu_thumbnail_get_db_name( /* Fetches current thumbnail image name * (name is the same for all thumbnail types). * Returns true if image name is valid. */ -bool menu_thumbnail_get_img_name( - menu_thumbnail_path_data_t *path_data, const char **img_name) +bool gfx_thumbnail_get_img_name( + gfx_thumbnail_path_data_t *path_data, const char **img_name) { if (!path_data) return false; @@ -817,8 +820,8 @@ bool menu_thumbnail_get_img_name( /* Fetches current content directory. * Returns true if content directory is valid. */ -bool menu_thumbnail_get_content_dir( - menu_thumbnail_path_data_t *path_data, char *content_dir, size_t len) +bool gfx_thumbnail_get_content_dir( + gfx_thumbnail_path_data_t *path_data, char *content_dir, size_t len) { const char *last_slash = NULL; char tmp_buf[PATH_MAX_LENGTH] = {0}; diff --git a/menu/menu_thumbnail_path.h b/gfx/gfx_thumbnail_path.h similarity index 64% rename from menu/menu_thumbnail_path.h rename to gfx/gfx_thumbnail_path.h index cbfb385d09..905f81dcd6 100644 --- a/menu/menu_thumbnail_path.h +++ b/gfx/gfx_thumbnail_path.h @@ -1,7 +1,7 @@ /* Copyright (C) 2010-2019 The RetroArch team * * --------------------------------------------------------------------------------------- - * The following license statement only applies to this file (menu_thumbnail_path.c). + * The following license statement only applies to this file (gfx_thumbnail_path.c). * --------------------------------------------------------------------------------------- * * Permission is hereby granted, free of charge, @@ -20,8 +20,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef __MENU_THUMBNAIL_PATH_H -#define __MENU_THUMBNAIL_PATH_H +#ifndef __GFX_THUMBNAIL_PATH_H +#define __GFX_THUMBNAIL_PATH_H #include #include @@ -41,26 +41,26 @@ RETRO_BEGIN_DECLS * but I have no interest in rewriting the existing * menu code... */ -enum menu_thumbnail_id +enum gfx_thumbnail_id { - MENU_THUMBNAIL_RIGHT = 0, - MENU_THUMBNAIL_LEFT + GFX_THUMBNAIL_RIGHT = 0, + GFX_THUMBNAIL_LEFT }; -/* Prevent direct access to menu_thumbnail_path_data_t members */ -typedef struct menu_thumbnail_path_data menu_thumbnail_path_data_t; +/* Prevent direct access to gfx_thumbnail_path_data_t members */ +typedef struct gfx_thumbnail_path_data gfx_thumbnail_path_data_t; /* Initialisation */ /* Creates new thumbnail path data container. - * Returns handle to new menu_thumbnail_path_data_t object. + * Returns handle to new gfx_thumbnail_path_data_t object. * on success, otherwise NULL. * Note: Returned object must be free()d */ -menu_thumbnail_path_data_t *menu_thumbnail_path_init(void); +gfx_thumbnail_path_data_t *gfx_thumbnail_path_init(void); /* Resets thumbnail path data * (blanks all internal string containers) */ -void menu_thumbnail_path_reset(menu_thumbnail_path_data_t *path_data); +void gfx_thumbnail_path_reset(gfx_thumbnail_path_data_t *path_data); /* Utility Functions */ @@ -68,16 +68,16 @@ void menu_thumbnail_path_reset(menu_thumbnail_path_data_t *path_data); * Named_Titles, Named_Boxarts) corresponding to the * specified 'type index' (1, 2, 3). * Returns true if 'type index' is valid */ -bool menu_thumbnail_get_sub_directory(unsigned type_idx, const char **sub_directory); +bool gfx_thumbnail_get_sub_directory(unsigned type_idx, const char **sub_directory); /* Returns currently set thumbnail 'type' (Named_Snaps, * Named_Titles, Named_Boxarts) for specified thumbnail * identifier (right, left) */ -const char *menu_thumbnail_get_type(menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id); +const char *gfx_thumbnail_get_type(gfx_thumbnail_path_data_t *path_data, enum gfx_thumbnail_id thumbnail_id); /* Returns true if specified thumbnail is enabled * (i.e. if 'type' is not equal to MENU_ENUM_LABEL_VALUE_OFF) */ -bool menu_thumbnail_is_enabled(menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id); +bool gfx_thumbnail_is_enabled(gfx_thumbnail_path_data_t *path_data, enum gfx_thumbnail_id thumbnail_id); /* Setters */ @@ -85,18 +85,18 @@ bool menu_thumbnail_is_enabled(menu_thumbnail_path_data_t *path_data, enum menu_ * Returns true if 'system' is valid. * If playlist is provided, extracts system-specific * thumbnail assignment metadata (required for accurate - * usage of menu_thumbnail_is_enabled()) + * usage of gfx_thumbnail_is_enabled()) * > Used as a fallback when individual content lacks an * associated database name */ -bool menu_thumbnail_set_system(menu_thumbnail_path_data_t *path_data, const char *system, playlist_t *playlist); +bool gfx_thumbnail_set_system(gfx_thumbnail_path_data_t *path_data, const char *system, playlist_t *playlist); /* Sets current thumbnail content according to the specified label. * Returns true if content is valid */ -bool menu_thumbnail_set_content(menu_thumbnail_path_data_t *path_data, const char *label); +bool gfx_thumbnail_set_content(gfx_thumbnail_path_data_t *path_data, const char *label); /* Sets current thumbnail content to the specified image. * Returns true if content is valid */ -bool menu_thumbnail_set_content_image(menu_thumbnail_path_data_t *path_data, const char *img_dir, const char *img_name); +bool gfx_thumbnail_set_content_image(gfx_thumbnail_path_data_t *path_data, const char *img_dir, const char *img_name); /* Sets current thumbnail content to the specified playlist entry. * Returns true if content is valid. @@ -105,54 +105,54 @@ bool menu_thumbnail_set_content_image(menu_thumbnail_path_data_t *path_data, con * corresponding menu entry label will contain a useful * identifier (it may be 'tainted', e.g. with the current * core name). 'Real' labels should be extracted from source */ -bool menu_thumbnail_set_content_playlist(menu_thumbnail_path_data_t *path_data, playlist_t *playlist, size_t idx); +bool gfx_thumbnail_set_content_playlist(gfx_thumbnail_path_data_t *path_data, playlist_t *playlist, size_t idx); /* Updaters */ /* Updates path for specified thumbnail identifier (right, left). * Must be called after: - * - menu_thumbnail_set_system() - * - menu_thumbnail_set_content*() + * - gfx_thumbnail_set_system() + * - gfx_thumbnail_set_content*() * ...and before: - * - menu_thumbnail_get_path() + * - gfx_thumbnail_get_path() * Returns true if generated path is valid */ -bool menu_thumbnail_update_path(menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id); +bool gfx_thumbnail_update_path(gfx_thumbnail_path_data_t *path_data, enum gfx_thumbnail_id thumbnail_id); /* Getters */ /* Fetches the current thumbnail file path of the * specified thumbnail 'type'. * Returns true if path is valid. */ -bool menu_thumbnail_get_path(menu_thumbnail_path_data_t *path_data, enum menu_thumbnail_id thumbnail_id, const char **path); +bool gfx_thumbnail_get_path(gfx_thumbnail_path_data_t *path_data, enum gfx_thumbnail_id thumbnail_id, const char **path); /* Fetches current 'system' (default database name). * Returns true if 'system' is valid. */ -bool menu_thumbnail_get_system(menu_thumbnail_path_data_t *path_data, const char **system); +bool gfx_thumbnail_get_system(gfx_thumbnail_path_data_t *path_data, const char **system); /* Fetches current content path. * Returns true if content path is valid. */ -bool menu_thumbnail_get_content_path(menu_thumbnail_path_data_t *path_data, const char **content_path); +bool gfx_thumbnail_get_content_path(gfx_thumbnail_path_data_t *path_data, const char **content_path); /* Fetches current thumbnail label. * Returns true if label is valid. */ -bool menu_thumbnail_get_label(menu_thumbnail_path_data_t *path_data, const char **label); +bool gfx_thumbnail_get_label(gfx_thumbnail_path_data_t *path_data, const char **label); /* Fetches current thumbnail core name. * Returns true if core name is valid. */ -bool menu_thumbnail_get_core_name(menu_thumbnail_path_data_t *path_data, const char **core_name); +bool gfx_thumbnail_get_core_name(gfx_thumbnail_path_data_t *path_data, const char **core_name); /* Fetches current database name. * Returns true if database name is valid. */ -bool menu_thumbnail_get_db_name(menu_thumbnail_path_data_t *path_data, const char **db_name); +bool gfx_thumbnail_get_db_name(gfx_thumbnail_path_data_t *path_data, const char **db_name); /* Fetches current thumbnail image name * (name is the same for all thumbnail types). * Returns true if image name is valid. */ -bool menu_thumbnail_get_img_name(menu_thumbnail_path_data_t *path_data, const char **img_name); +bool gfx_thumbnail_get_img_name(gfx_thumbnail_path_data_t *path_data, const char **img_name); /* Fetches current content directory. * Returns true if content directory is valid. */ -bool menu_thumbnail_get_content_dir(menu_thumbnail_path_data_t *path_data, char *content_dir, size_t len); +bool gfx_thumbnail_get_content_dir(gfx_thumbnail_path_data_t *path_data, char *content_dir, size_t len); RETRO_END_DECLS diff --git a/griffin/griffin.c b/griffin/griffin.c index cabeea0995..e337fb6336 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -918,6 +918,8 @@ DRIVERS #include "../gfx/video_crt_switch.c" #include "../gfx/gfx_animation.c" #include "../gfx/gfx_display.c" +#include "../gfx/gfx_thumbnail_path.c" +#include "../gfx/gfx_thumbnail.c" #include "../gfx/video_display_server.c" #include "../gfx/video_coord_array.c" #ifdef HAVE_AUDIOMIXER @@ -1293,8 +1295,6 @@ MENU #include "../menu/cbs/menu_cbs_down.c" #include "../menu/cbs/menu_cbs_contentlist_switch.c" #include "../menu/menu_displaylist.c" -#include "../menu/menu_thumbnail_path.c" -#include "../menu/menu_thumbnail.c" #include "../menu/drivers/menu_generic.c" #endif diff --git a/menu/cbs/menu_cbs_scan.c b/menu/cbs/menu_cbs_scan.c index 415e3c4f46..007b914540 100644 --- a/menu/cbs/menu_cbs_scan.c +++ b/menu/cbs/menu_cbs_scan.c @@ -105,7 +105,7 @@ int action_switch_thumbnail(const char *path, if (!settings) return -1; - if (settings->uints.menu_thumbnails == 0) + if (settings->uints.gfx_thumbnails == 0) { /* RGUI is a special case where thumbnail 'switch' corresponds to * toggling thumbnail view on/off. @@ -134,9 +134,9 @@ int action_switch_thumbnail(const char *path, if (!string_is_equal(settings->arrays.menu_driver, "rgui") && !string_is_equal(settings->arrays.menu_driver, "glui")) { - settings->uints.menu_thumbnails++; - if (settings->uints.menu_thumbnails > 3) - settings->uints.menu_thumbnails = 1; + settings->uints.gfx_thumbnails++; + if (settings->uints.gfx_thumbnails > 3) + settings->uints.gfx_thumbnails = 1; } menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_PATH, NULL); menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE, NULL); diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index bc17ccdcb4..798b5f1539 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -44,8 +44,8 @@ #include "../menu_driver.h" #include "../../gfx/gfx_animation.h" #include "../menu_input.h" -#include "../menu_thumbnail_path.h" -#include "../menu_thumbnail.h" +#include "../gfx_thumbnail_path.h" +#include "../gfx_thumbnail.h" #include "../widgets/menu_osk.h" #include "../widgets/menu_filebrowser.h" @@ -1022,8 +1022,8 @@ typedef struct /* Thumbnail containers */ struct { - menu_thumbnail_t primary; - menu_thumbnail_t secondary; + gfx_thumbnail_t primary; + gfx_thumbnail_t secondary; } thumbnails; } materialui_node_t; @@ -1352,7 +1352,7 @@ typedef struct materialui_handle size_t last_stack_size; /* Thumbnail helpers */ - menu_thumbnail_path_data_t *thumbnail_path_data; + gfx_thumbnail_path_data_t *thumbnail_path_data; unsigned thumbnail_width_max; unsigned thumbnail_height_max; bool primary_thumbnail_available; @@ -1756,7 +1756,7 @@ static void materialui_draw_icon( static void materialui_draw_thumbnail( materialui_handle_t *mui, video_frame_info_t *video_info, - menu_thumbnail_t *thumbnail, + gfx_thumbnail_t *thumbnail, float x, float y, unsigned width, unsigned height, float scale_factor) @@ -1778,7 +1778,7 @@ static void materialui_draw_thumbnail( bg_y = y - (bg_height - (float)mui->thumbnail_height_max) / 2.0f; /* If thumbnail is missing, draw fallback image... */ - if (thumbnail->status == MENU_THUMBNAIL_STATUS_MISSING) + if (thumbnail->status == GFX_THUMBNAIL_STATUS_MISSING) { float icon_size; @@ -1819,7 +1819,7 @@ static void materialui_draw_thumbnail( * > Note that other conditions are ignored - i.e. we * we draw nothing if thumbnail status is unknown, * or we are waiting for a thumbnail to load) */ - else if (thumbnail->status == MENU_THUMBNAIL_STATUS_AVAILABLE) + else if (thumbnail->status == GFX_THUMBNAIL_STATUS_AVAILABLE) { settings_t *settings = config_get_ptr(); @@ -1858,10 +1858,10 @@ static void materialui_draw_thumbnail( } /* Thumbnail */ - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, thumbnail, x, y, mui->thumbnail_width_max, mui->thumbnail_height_max, - MENU_THUMBNAIL_ALIGN_CENTRE, + GFX_THUMBNAIL_ALIGN_CENTRE, mui->transition_alpha, scale_factor, NULL); } } @@ -2502,20 +2502,20 @@ static void materialui_render(void *data, bool on_screen = first_entry_found && !last_entry_found; unsigned thumbnail_upscale_threshold = - settings->uints.menu_thumbnail_upscale_threshold; + settings->uints.gfx_thumbnail_upscale_threshold; bool network_on_demand_thumbnails = settings->bools.network_on_demand_thumbnails; if (mui->secondary_thumbnail_enabled) - menu_thumbnail_process_streams( + gfx_thumbnail_process_streams( mui->thumbnail_path_data, mui->playlist, i, &node->thumbnails.primary, &node->thumbnails.secondary, on_screen, thumbnail_upscale_threshold, network_on_demand_thumbnails); else - menu_thumbnail_process_stream( - mui->thumbnail_path_data, MENU_THUMBNAIL_RIGHT, + gfx_thumbnail_process_stream( + mui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT, mui->playlist, i, &node->thumbnails.primary, on_screen, thumbnail_upscale_threshold, network_on_demand_thumbnails); @@ -4280,8 +4280,8 @@ static void materialui_render_nav_bar( * or node is unallocated */ static bool materialui_get_selected_thumbnails( materialui_handle_t *mui, size_t selection, - menu_thumbnail_t **primary_thumbnail, - menu_thumbnail_t **secondary_thumbnail) + gfx_thumbnail_t **primary_thumbnail, + gfx_thumbnail_t **secondary_thumbnail) { file_list_t *list = NULL; materialui_node_t *node = NULL; @@ -4324,7 +4324,7 @@ static void materialui_hide_fullscreen_thumbnails( /* Configure fade out animation */ animation_entry.easing_enum = EASING_OUT_QUAD; animation_entry.tag = alpha_tag; - animation_entry.duration = menu_thumbnail_get_fade_duration(); + animation_entry.duration = gfx_thumbnail_get_fade_duration(); animation_entry.target_value = 0.0f; animation_entry.subject = &mui->fullscreen_thumbnail_alpha; animation_entry.cb = NULL; @@ -4348,8 +4348,8 @@ static void materialui_show_fullscreen_thumbnails( { menu_entry_t selected_entry; gfx_animation_ctx_entry_t animation_entry; - menu_thumbnail_t *primary_thumbnail = NULL; - menu_thumbnail_t *secondary_thumbnail = NULL; + gfx_thumbnail_t *primary_thumbnail = NULL; + gfx_thumbnail_t *secondary_thumbnail = NULL; gfx_animation_ctx_tag scroll_tag = (uintptr_t)&mui->scroll_y; gfx_animation_ctx_tag alpha_tag = (uintptr_t)&mui->fullscreen_thumbnail_alpha; const char *thumbnail_label = NULL; @@ -4374,15 +4374,15 @@ static void materialui_show_fullscreen_thumbnails( * current selection has at least one valid thumbnail * and all thumbnails for current selection are already * loaded/available */ - if ((primary_thumbnail->status == MENU_THUMBNAIL_STATUS_AVAILABLE) && + if ((primary_thumbnail->status == GFX_THUMBNAIL_STATUS_AVAILABLE) && (mui->secondary_thumbnail_enabled && - ((secondary_thumbnail->status != MENU_THUMBNAIL_STATUS_MISSING) && - (secondary_thumbnail->status != MENU_THUMBNAIL_STATUS_AVAILABLE)))) + ((secondary_thumbnail->status != GFX_THUMBNAIL_STATUS_MISSING) && + (secondary_thumbnail->status != GFX_THUMBNAIL_STATUS_AVAILABLE)))) return; - if ((primary_thumbnail->status == MENU_THUMBNAIL_STATUS_MISSING) && + if ((primary_thumbnail->status == GFX_THUMBNAIL_STATUS_MISSING) && (!mui->secondary_thumbnail_enabled || - (secondary_thumbnail->status != MENU_THUMBNAIL_STATUS_AVAILABLE))) + (secondary_thumbnail->status != GFX_THUMBNAIL_STATUS_AVAILABLE))) return; /* Menu list must be stationary while fullscreen @@ -4417,7 +4417,7 @@ static void materialui_show_fullscreen_thumbnails( /* Configure fade in animation */ animation_entry.easing_enum = EASING_OUT_QUAD; animation_entry.tag = alpha_tag; - animation_entry.duration = menu_thumbnail_get_fade_duration(); + animation_entry.duration = gfx_thumbnail_get_fade_duration(); animation_entry.target_value = 1.0f; animation_entry.subject = &mui->fullscreen_thumbnail_alpha; animation_entry.cb = NULL; @@ -4439,8 +4439,8 @@ static void materialui_render_fullscreen_thumbnails( /* Check whether fullscreen thumbnails are visible */ if (mui->fullscreen_thumbnail_alpha > 0.0f) { - menu_thumbnail_t *primary_thumbnail = NULL; - menu_thumbnail_t *secondary_thumbnail = NULL; + gfx_thumbnail_t *primary_thumbnail = NULL; + gfx_thumbnail_t *secondary_thumbnail = NULL; bool show_primary_thumbnail = false; bool show_secondary_thumbnail = false; unsigned num_thumbnails = 0; @@ -4481,10 +4481,10 @@ static void materialui_render_fullscreen_thumbnails( /* Get number of 'active' thumbnails */ show_primary_thumbnail = - (primary_thumbnail->status != MENU_THUMBNAIL_STATUS_MISSING); + (primary_thumbnail->status != GFX_THUMBNAIL_STATUS_MISSING); show_secondary_thumbnail = mui->secondary_thumbnail_enabled && - (secondary_thumbnail->status != MENU_THUMBNAIL_STATUS_MISSING); + (secondary_thumbnail->status != GFX_THUMBNAIL_STATUS_MISSING); if (show_primary_thumbnail) num_thumbnails++; @@ -4572,7 +4572,7 @@ static void materialui_render_fullscreen_thumbnails( * the bounding box dimensions... */ if (show_primary_thumbnail) { - menu_thumbnail_get_draw_dimensions( + gfx_thumbnail_get_draw_dimensions( primary_thumbnail, thumbnail_box_width, thumbnail_box_height, 1.0f, &primary_thumbnail_draw_width, &primary_thumbnail_draw_height); @@ -4585,7 +4585,7 @@ static void materialui_render_fullscreen_thumbnails( if (show_secondary_thumbnail) { - menu_thumbnail_get_draw_dimensions( + gfx_thumbnail_get_draw_dimensions( secondary_thumbnail, thumbnail_box_width, thumbnail_box_height, 1.0f, &secondary_thumbnail_draw_width, &secondary_thumbnail_draw_height); @@ -4662,14 +4662,14 @@ static void materialui_render_fullscreen_thumbnails( mui->colors.surface_background); /* Thumbnail */ - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, primary_thumbnail, primary_thumbnail_x, primary_thumbnail_y, (unsigned)thumbnail_box_width, (unsigned)thumbnail_box_height, - MENU_THUMBNAIL_ALIGN_CENTRE, + GFX_THUMBNAIL_ALIGN_CENTRE, mui->fullscreen_thumbnail_alpha, 1.0f, NULL); @@ -4692,14 +4692,14 @@ static void materialui_render_fullscreen_thumbnails( mui->colors.surface_background); /* Thumbnail */ - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, secondary_thumbnail, secondary_thumbnail_x, secondary_thumbnail_y, (unsigned)thumbnail_box_width, (unsigned)thumbnail_box_height, - MENU_THUMBNAIL_ALIGN_CENTRE, + GFX_THUMBNAIL_ALIGN_CENTRE, mui->fullscreen_thumbnail_alpha, 1.0f, NULL); @@ -5046,7 +5046,7 @@ static void materialui_set_list_view_type( /* Check whether primary thumbnail is enabled */ mui->primary_thumbnail_available = - menu_thumbnail_is_enabled(mui->thumbnail_path_data, MENU_THUMBNAIL_RIGHT); + gfx_thumbnail_is_enabled(mui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT); if (mui->primary_thumbnail_available) { @@ -5283,8 +5283,8 @@ static bool materialui_force_enable_secondary_thumbnail( { /* If secondary thumbnail is already enabled, * do nothing */ - if (menu_thumbnail_is_enabled( - mui->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) + if (gfx_thumbnail_is_enabled( + mui->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) return true; /* Secondary thumbnail is disabled @@ -5297,7 +5297,7 @@ static bool materialui_force_enable_secondary_thumbnail( * MUI_DEFAULT_SECONDARY_THUMBNAIL_TYPE, use * MUI_DEFAULT_SECONDARY_THUMBNAIL_FALLBACK_TYPE * instead */ - if (settings->uints.menu_thumbnails == + if (settings->uints.gfx_thumbnails == MUI_DEFAULT_SECONDARY_THUMBNAIL_TYPE) settings->uints.menu_left_thumbnails = MUI_DEFAULT_SECONDARY_THUMBNAIL_FALLBACK_TYPE; @@ -5308,8 +5308,8 @@ static bool materialui_force_enable_secondary_thumbnail( /* Final check - this will return true unless a * per-playlist override is in place */ - return menu_thumbnail_is_enabled( - mui->thumbnail_path_data, MENU_THUMBNAIL_LEFT); + return gfx_thumbnail_is_enabled( + mui->thumbnail_path_data, GFX_THUMBNAIL_LEFT); } /* Determines whether dual thumbnails should be enabled @@ -5617,7 +5617,7 @@ static void *materialui_init(void **userdata, bool video_is_threaded) *userdata = mui; /* Initialise thumbnail path data */ - mui->thumbnail_path_data = menu_thumbnail_path_init(); + mui->thumbnail_path_data = gfx_thumbnail_path_init(); if (!mui->thumbnail_path_data) goto error; @@ -5669,7 +5669,7 @@ static void *materialui_init(void **userdata, bool video_is_threaded) materialui_init_nav_bar(mui); /* Set initial thumbnail stream delay */ - menu_thumbnail_set_stream_delay(MUI_THUMBNAIL_STREAM_DELAY_DEFAULT); + gfx_thumbnail_set_stream_delay(MUI_THUMBNAIL_STREAM_DELAY_DEFAULT); /* Ensure that fullscreen thumbnails are inactive */ mui->show_fullscreen_thumbnails = false; @@ -5731,8 +5731,8 @@ static void materialui_reset_thumbnails(void) if (!node) continue; - menu_thumbnail_reset(&node->thumbnails.primary); - menu_thumbnail_reset(&node->thumbnails.secondary); + gfx_thumbnail_reset(&node->thumbnails.primary); + gfx_thumbnail_reset(&node->thumbnails.secondary); } } @@ -6896,7 +6896,7 @@ static int materialui_pointer_down(void *userdata, /* Increase thumbnail stream delay * (prevents overloading the system with * hundreds of image requests...) */ - menu_thumbnail_set_stream_delay(MUI_THUMBNAIL_STREAM_DELAY_SCROLLBAR_DRAG); + gfx_thumbnail_set_stream_delay(MUI_THUMBNAIL_STREAM_DELAY_SCROLLBAR_DRAG); } return 0; @@ -7129,7 +7129,7 @@ static int materialui_pointer_up(void *userdata, menu_input_set_pointer_y_accel(0.0f); /* Reset thumbnail stream delay to default */ - menu_thumbnail_set_stream_delay(MUI_THUMBNAIL_STREAM_DELAY_DEFAULT); + gfx_thumbnail_set_stream_delay(MUI_THUMBNAIL_STREAM_DELAY_DEFAULT); mui->scrollbar.dragged = false; return 0; @@ -7323,8 +7323,8 @@ static void materialui_list_insert( { /* If node already exists, must free any * existing thumbnail */ - menu_thumbnail_reset(&node->thumbnails.primary); - menu_thumbnail_reset(&node->thumbnails.secondary); + gfx_thumbnail_reset(&node->thumbnails.primary); + gfx_thumbnail_reset(&node->thumbnails.secondary); thumbnail_reset = true; } @@ -7342,8 +7342,8 @@ static void materialui_list_insert( if (!thumbnail_reset) { - menu_thumbnail_reset(&node->thumbnails.primary); - menu_thumbnail_reset(&node->thumbnails.secondary); + gfx_thumbnail_reset(&node->thumbnails.primary); + gfx_thumbnail_reset(&node->thumbnails.secondary); } if (settings->bools.menu_materialui_icons_enable) @@ -7830,7 +7830,7 @@ static void materialui_list_clear(file_list_t *list) /* Must cancel pending thumbnail requests before * freeing node->thumbnails objects */ - menu_thumbnail_cancel_pending_requests(); + gfx_thumbnail_cancel_pending_requests(); for (i = 0; i < size; i++) { @@ -7840,8 +7840,8 @@ static void materialui_list_clear(file_list_t *list) if (!node) continue; - menu_thumbnail_reset(&node->thumbnails.primary); - menu_thumbnail_reset(&node->thumbnails.secondary); + gfx_thumbnail_reset(&node->thumbnails.primary); + gfx_thumbnail_reset(&node->thumbnails.secondary); file_list_free_userdata(list, i); } } @@ -7851,7 +7851,7 @@ static void materialui_set_thumbnail_system(void *userdata, char *s, size_t len) materialui_handle_t *mui = (materialui_handle_t*)userdata; if (!mui) return; - menu_thumbnail_set_system( + gfx_thumbnail_set_system( mui->thumbnail_path_data, s, playlist_get_cached()); } @@ -7861,7 +7861,7 @@ static void materialui_get_thumbnail_system(void *userdata, char *s, size_t len) const char *system = NULL; if (!mui) return; - if (menu_thumbnail_get_system(mui->thumbnail_path_data, &system)) + if (gfx_thumbnail_get_system(mui->thumbnail_path_data, &system)) strlcpy(s, system, len); } @@ -7884,7 +7884,7 @@ static void materialui_refresh_thumbnail_image(void *userdata, unsigned i) { file_list_t *list = menu_entries_get_selection_buf_ptr(0); materialui_node_t *node = NULL; - float stream_delay = menu_thumbnail_get_stream_delay(); + float stream_delay = gfx_thumbnail_get_stream_delay(); if (!list) return; @@ -7895,8 +7895,8 @@ static void materialui_refresh_thumbnail_image(void *userdata, unsigned i) return; /* Reset existing thumbnails */ - menu_thumbnail_reset(&node->thumbnails.primary); - menu_thumbnail_reset(&node->thumbnails.secondary); + gfx_thumbnail_reset(&node->thumbnails.primary); + gfx_thumbnail_reset(&node->thumbnails.secondary); /* No need to actually request thumbnails here * > Just set delay timer to the current maximum diff --git a/menu/drivers/ozone/ozone.c b/menu/drivers/ozone/ozone.c index 73509b3c9e..20fb1d83e2 100644 --- a/menu/drivers/ozone/ozone.c +++ b/menu/drivers/ozone/ozone.c @@ -183,7 +183,7 @@ static void *ozone_init(void **userdata, bool video_is_threaded) ozone->show_thumbnail_bar = false; ozone->dimensions.sidebar_width = 0.0f; - ozone->thumbnail_path_data = menu_thumbnail_path_init(); + ozone->thumbnail_path_data = gfx_thumbnail_path_init(); if (!ozone->thumbnail_path_data) goto error; @@ -401,46 +401,46 @@ static void ozone_update_thumbnail_image(void *data) if (!ozone) return; - menu_thumbnail_cancel_pending_requests(); + gfx_thumbnail_cancel_pending_requests(); /* Image (and video/music) content requires special * treatment... */ if (ozone->selection_core_is_viewer) { /* Only right thumbnail is loaded */ - menu_thumbnail_request( + gfx_thumbnail_request( ozone->thumbnail_path_data, - MENU_THUMBNAIL_RIGHT, + GFX_THUMBNAIL_RIGHT, playlist, selection, &ozone->thumbnails.right, - settings->uints.menu_thumbnail_upscale_threshold, + settings->uints.gfx_thumbnail_upscale_threshold, settings->bools. network_on_demand_thumbnails ); /* Left thumbnail is simply reset */ - menu_thumbnail_reset(&ozone->thumbnails.left); + gfx_thumbnail_reset(&ozone->thumbnails.left); } else { /* Right thumbnail */ - menu_thumbnail_request( + gfx_thumbnail_request( ozone->thumbnail_path_data, - MENU_THUMBNAIL_RIGHT, + GFX_THUMBNAIL_RIGHT, playlist, selection, &ozone->thumbnails.right, - settings->uints.menu_thumbnail_upscale_threshold, + settings->uints.gfx_thumbnail_upscale_threshold, settings->bools. network_on_demand_thumbnails); /* Left thumbnail */ - menu_thumbnail_request( + gfx_thumbnail_request( ozone->thumbnail_path_data, - MENU_THUMBNAIL_LEFT, + GFX_THUMBNAIL_LEFT, playlist, selection, &ozone->thumbnails.left, - settings->uints.menu_thumbnail_upscale_threshold, + settings->uints.gfx_thumbnail_upscale_threshold, settings->bools. network_on_demand_thumbnails); } } @@ -454,8 +454,8 @@ static void ozone_refresh_thumbnail_image(void *data, unsigned i) /* Only refresh thumbnails if thumbnails are enabled * and we are currently viewing a playlist */ - if ((menu_thumbnail_is_enabled(ozone->thumbnail_path_data, MENU_THUMBNAIL_RIGHT) || - menu_thumbnail_is_enabled(ozone->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) && + if ((gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) && (ozone->is_playlist && ozone->depth == 1)) ozone_update_thumbnail_image(ozone); } @@ -765,9 +765,9 @@ static void ozone_unload_thumbnail_textures(void *data) if (!ozone) return; - menu_thumbnail_cancel_pending_requests(); - menu_thumbnail_reset(&ozone->thumbnails.right); - menu_thumbnail_reset(&ozone->thumbnails.left); + gfx_thumbnail_cancel_pending_requests(); + gfx_thumbnail_reset(&ozone->thumbnails.right); + gfx_thumbnail_reset(&ozone->thumbnails.left); } static void ozone_context_destroy(void *data) @@ -1382,7 +1382,7 @@ void ozone_update_content_metadata(ozone_handle_t *ozone) /* Must check whether core corresponds to 'viewer' * content even when not using a playlist, otherwise * file browser image updates are mishandled */ - if (menu_thumbnail_get_core_name(ozone->thumbnail_path_data, &core_name)) + if (gfx_thumbnail_get_core_name(ozone->thumbnail_path_data, &core_name)) ozone->selection_core_is_viewer = string_is_equal(core_name, "imageviewer") || string_is_equal(core_name, "musicplayer") || string_is_equal(core_name, "movieplayer"); @@ -1469,7 +1469,7 @@ static void ozone_set_thumbnail_content(void *data, const char *s) { /* Playlist content */ if (string_is_empty(s)) - menu_thumbnail_set_content_playlist(ozone->thumbnail_path_data, + gfx_thumbnail_set_content_playlist(ozone->thumbnail_path_data, playlist_get_cached(), selection); } else if (ozone->is_db_manager_list) @@ -1487,7 +1487,7 @@ static void ozone_set_thumbnail_content(void *data, const char *s) menu_entry_get(&entry, 0, selection, NULL, true); if (!string_is_empty(entry.path)) - menu_thumbnail_set_content(ozone->thumbnail_path_data, entry.path); + gfx_thumbnail_set_content(ozone->thumbnail_path_data, entry.path); } } else if (string_is_equal(s, "imageviewer")) @@ -1506,7 +1506,7 @@ static void ozone_set_thumbnail_content(void *data, const char *s) if (node) if (!string_is_empty(entry.path) && !string_is_empty(node->fullpath)) - menu_thumbnail_set_content_image(ozone->thumbnail_path_data, node->fullpath, entry.path); + gfx_thumbnail_set_content_image(ozone->thumbnail_path_data, node->fullpath, entry.path); } else if (!string_is_empty(s)) { @@ -1516,7 +1516,7 @@ static void ozone_set_thumbnail_content(void *data, const char *s) * the sublevels of database manager lists. * Showing thumbnails on database entries is a * pointless nuisance and a waste of CPU cycles, IMHO... */ - menu_thumbnail_set_content(ozone->thumbnail_path_data, s); + gfx_thumbnail_set_content(ozone->thumbnail_path_data, s); } ozone_update_content_metadata(ozone); @@ -1528,7 +1528,7 @@ static void ozone_set_thumbnail_system(void *data, char*s, size_t len) if (!ozone) return; - menu_thumbnail_set_system( + gfx_thumbnail_set_system( ozone->thumbnail_path_data, s, playlist_get_cached()); } @@ -1539,7 +1539,7 @@ static void ozone_get_thumbnail_system(void *data, char*s, size_t len) if (!ozone) return; - if (menu_thumbnail_get_system(ozone->thumbnail_path_data, &system)) + if (gfx_thumbnail_get_system(ozone->thumbnail_path_data, &system)) strlcpy(s, system, len); } @@ -1578,8 +1578,8 @@ static void ozone_selection_changed(ozone_handle_t *ozone, bool allow_animation) ozone_update_scroll(ozone, allow_animation, node); /* Update thumbnail */ - if (menu_thumbnail_is_enabled(ozone->thumbnail_path_data, MENU_THUMBNAIL_RIGHT) || - menu_thumbnail_is_enabled(ozone->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) + if (gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) { bool update_thumbnails = false; @@ -1612,7 +1612,7 @@ static void ozone_selection_changed(ozone_handle_t *ozone, bool allow_animation) * content + right/left thumbnails * (otherwise last loaded thumbnail will * persist, and be shown on the wrong entry) */ - menu_thumbnail_set_content(ozone->thumbnail_path_data, NULL); + gfx_thumbnail_set_content(ozone->thumbnail_path_data, NULL); ozone_unload_thumbnail_textures(ozone); } } @@ -2002,8 +2002,8 @@ static void ozone_populate_entries(void *data, const char *path, const char *lab { ozone_unload_thumbnail_textures(ozone); - if (menu_thumbnail_is_enabled(ozone->thumbnail_path_data, MENU_THUMBNAIL_RIGHT) || - menu_thumbnail_is_enabled(ozone->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) + if (gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) { /* Only auto-load thumbnails if we are viewing * a playlist or a database manager list @@ -2360,7 +2360,7 @@ void ozone_hide_fullscreen_thumbnails(ozone_handle_t *ozone, bool animate) /* Configure fade out animation */ animation_entry.easing_enum = EASING_OUT_QUAD; animation_entry.tag = alpha_tag; - animation_entry.duration = menu_thumbnail_get_fade_duration(); + animation_entry.duration = gfx_thumbnail_get_fade_duration(); animation_entry.target_value = 0.0f; animation_entry.subject = &ozone->animations.fullscreen_thumbnail_alpha; animation_entry.cb = NULL; @@ -2404,26 +2404,26 @@ void ozone_show_fullscreen_thumbnails(ozone_handle_t *ozone) { /* imageviewer content requires special treatment, * since only the right thumbnail is ever loaded */ - if (!menu_thumbnail_is_enabled(ozone->thumbnail_path_data, MENU_THUMBNAIL_RIGHT)) + if (!gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_RIGHT)) return; - if (ozone->thumbnails.right.status != MENU_THUMBNAIL_STATUS_AVAILABLE) + if (ozone->thumbnails.right.status != GFX_THUMBNAIL_STATUS_AVAILABLE) return; } else { - bool left_thumbnail_enabled = menu_thumbnail_is_enabled( - ozone->thumbnail_path_data, MENU_THUMBNAIL_LEFT); + bool left_thumbnail_enabled = gfx_thumbnail_is_enabled( + ozone->thumbnail_path_data, GFX_THUMBNAIL_LEFT); - if ((ozone->thumbnails.right.status == MENU_THUMBNAIL_STATUS_AVAILABLE) && + if ((ozone->thumbnails.right.status == GFX_THUMBNAIL_STATUS_AVAILABLE) && (left_thumbnail_enabled && - ((ozone->thumbnails.left.status != MENU_THUMBNAIL_STATUS_MISSING) && - (ozone->thumbnails.left.status != MENU_THUMBNAIL_STATUS_AVAILABLE)))) + ((ozone->thumbnails.left.status != GFX_THUMBNAIL_STATUS_MISSING) && + (ozone->thumbnails.left.status != GFX_THUMBNAIL_STATUS_AVAILABLE)))) return; - if ((ozone->thumbnails.right.status == MENU_THUMBNAIL_STATUS_MISSING) && + if ((ozone->thumbnails.right.status == GFX_THUMBNAIL_STATUS_MISSING) && (!left_thumbnail_enabled || - (ozone->thumbnails.left.status != MENU_THUMBNAIL_STATUS_AVAILABLE))) + (ozone->thumbnails.left.status != GFX_THUMBNAIL_STATUS_AVAILABLE))) return; } @@ -2452,7 +2452,7 @@ void ozone_show_fullscreen_thumbnails(ozone_handle_t *ozone) /* Configure fade in animation */ animation_entry.easing_enum = EASING_OUT_QUAD; animation_entry.tag = alpha_tag; - animation_entry.duration = menu_thumbnail_get_fade_duration(); + animation_entry.duration = gfx_thumbnail_get_fade_duration(); animation_entry.target_value = 1.0f; animation_entry.subject = &ozone->animations.fullscreen_thumbnail_alpha; animation_entry.cb = NULL; diff --git a/menu/drivers/ozone/ozone.h b/menu/drivers/ozone/ozone.h index b1955ad843..c88faddbbf 100644 --- a/menu/drivers/ozone/ozone.h +++ b/menu/drivers/ozone/ozone.h @@ -24,8 +24,8 @@ typedef struct ozone_handle ozone_handle_t; #include -#include "../../menu_thumbnail_path.h" -#include "../../menu_thumbnail.h" +#include "../../gfx/gfx_thumbnail_path.h" +#include "../../gfx/gfx_thumbnail.h" #include "../../menu_driver.h" #include "../../../retroarch.h" @@ -252,11 +252,11 @@ struct ozone_handle /* Thumbnails data */ bool show_thumbnail_bar; - menu_thumbnail_path_data_t *thumbnail_path_data; + gfx_thumbnail_path_data_t *thumbnail_path_data; struct { - menu_thumbnail_t right; - menu_thumbnail_t left; + gfx_thumbnail_t right; + gfx_thumbnail_t left; } thumbnails; bool fullscreen_thumbnails_available; diff --git a/menu/drivers/ozone/ozone_display.c b/menu/drivers/ozone/ozone_display.c index fd124e6c48..57a807c595 100644 --- a/menu/drivers/ozone/ozone_display.c +++ b/menu/drivers/ozone/ozone_display.c @@ -440,8 +440,8 @@ void ozone_draw_fullscreen_thumbnails( /* Note: right thumbnail is drawn at the top * in the sidebar, so it becomes the *left* * thumbnail when viewed fullscreen */ - menu_thumbnail_t *right_thumbnail = &ozone->thumbnails.left; - menu_thumbnail_t *left_thumbnail = &ozone->thumbnails.right; + gfx_thumbnail_t *right_thumbnail = &ozone->thumbnails.left; + gfx_thumbnail_t *left_thumbnail = &ozone->thumbnails.right; unsigned width = video_info->width; unsigned height = video_info->height; int view_width = (int)width; @@ -497,8 +497,8 @@ void ozone_draw_fullscreen_thumbnails( goto error; /* Get number of 'active' thumbnails */ - show_right_thumbnail = (right_thumbnail->status == MENU_THUMBNAIL_STATUS_AVAILABLE); - show_left_thumbnail = (left_thumbnail->status == MENU_THUMBNAIL_STATUS_AVAILABLE); + show_right_thumbnail = (right_thumbnail->status == GFX_THUMBNAIL_STATUS_AVAILABLE); + show_left_thumbnail = (left_thumbnail->status == GFX_THUMBNAIL_STATUS_AVAILABLE); if (show_right_thumbnail) num_thumbnails++; @@ -548,7 +548,7 @@ void ozone_draw_fullscreen_thumbnails( * the bounding box dimensions... */ if (show_right_thumbnail) { - menu_thumbnail_get_draw_dimensions( + gfx_thumbnail_get_draw_dimensions( right_thumbnail, thumbnail_box_width, thumbnail_box_height, 1.0f, &right_thumbnail_draw_width, &right_thumbnail_draw_height); @@ -561,7 +561,7 @@ void ozone_draw_fullscreen_thumbnails( if (show_left_thumbnail) { - menu_thumbnail_get_draw_dimensions( + gfx_thumbnail_get_draw_dimensions( left_thumbnail, thumbnail_box_width, thumbnail_box_height, 1.0f, &left_thumbnail_draw_width, &left_thumbnail_draw_height); @@ -655,14 +655,14 @@ void ozone_draw_fullscreen_thumbnails( frame_color); /* Thumbnail */ - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, right_thumbnail, right_thumbnail_x, thumbnail_y, (unsigned)thumbnail_box_width, (unsigned)thumbnail_box_height, - MENU_THUMBNAIL_ALIGN_CENTRE, + GFX_THUMBNAIL_ALIGN_CENTRE, ozone->animations.fullscreen_thumbnail_alpha, 1.0f, NULL); @@ -685,14 +685,14 @@ void ozone_draw_fullscreen_thumbnails( frame_color); /* Thumbnail */ - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, left_thumbnail, left_thumbnail_x, thumbnail_y, (unsigned)thumbnail_box_width, (unsigned)thumbnail_box_height, - MENU_THUMBNAIL_ALIGN_CENTRE, + GFX_THUMBNAIL_ALIGN_CENTRE, ozone->animations.fullscreen_thumbnail_alpha, 1.0f, NULL); diff --git a/menu/drivers/ozone/ozone_entries.c b/menu/drivers/ozone/ozone_entries.c index f3655a80ad..fa28582ce8 100644 --- a/menu/drivers/ozone/ozone_entries.c +++ b/menu/drivers/ozone/ozone_entries.c @@ -751,17 +751,17 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i /* Thumbnails */ show_right_thumbnail = - (ozone->thumbnails.right.status != MENU_THUMBNAIL_STATUS_MISSING) && - menu_thumbnail_is_enabled(ozone->thumbnail_path_data, MENU_THUMBNAIL_RIGHT); + (ozone->thumbnails.right.status != GFX_THUMBNAIL_STATUS_MISSING) && + gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_RIGHT); show_left_thumbnail = - (ozone->thumbnails.left.status != MENU_THUMBNAIL_STATUS_MISSING) && - menu_thumbnail_is_enabled(ozone->thumbnail_path_data, MENU_THUMBNAIL_LEFT) && + (ozone->thumbnails.left.status != GFX_THUMBNAIL_STATUS_MISSING) && + gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_LEFT) && !ozone->selection_core_is_viewer; /* If user requested "left" thumbnail instead of content metadata * and no thumbnails are available, show a centred message and * return immediately */ - if (!show_right_thumbnail && !show_left_thumbnail && menu_thumbnail_is_enabled(ozone->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) + if (!show_right_thumbnail && !show_left_thumbnail && gfx_thumbnail_is_enabled(ozone->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) { ozone_draw_no_thumbnail_available(ozone, video_info, x_position, sidebar_width, 0); return; @@ -770,7 +770,7 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i /* Top row : thumbnail or no thumbnail available message */ if (show_right_thumbnail) { - enum menu_thumbnail_alignment alignment = MENU_THUMBNAIL_ALIGN_BOTTOM; + enum gfx_thumbnail_alignment alignment = GFX_THUMBNAIL_ALIGN_BOTTOM; /* If this entry is associated with the image viewer * core, there can be only one thumbnail and no @@ -783,14 +783,14 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i ((thumbnail_height / 2) + (int)(1.5f * (float)ozone->dimensions.sidebar_entry_icon_padding)); - alignment = MENU_THUMBNAIL_ALIGN_CENTRE; + alignment = GFX_THUMBNAIL_ALIGN_CENTRE; } else right_thumbnail_y_position = ozone->dimensions.header_height + ozone->dimensions.spacer_1px + ozone->dimensions.sidebar_entry_icon_padding; - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, &ozone->thumbnails.right, (float)thumbnail_x_position, @@ -818,14 +818,14 @@ void ozone_draw_thumbnail_bar(ozone_handle_t *ozone, video_frame_info_t *video_i if (show_right_thumbnail && show_left_thumbnail) { - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, &ozone->thumbnails.left, (float)thumbnail_x_position, (float)left_thumbnail_y_position, thumbnail_width, thumbnail_height, - MENU_THUMBNAIL_ALIGN_TOP, + GFX_THUMBNAIL_ALIGN_TOP, 1.0f, 1.0f, NULL); } else if (!ozone->selection_core_is_viewer) diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 5d3f3acbd1..319133585c 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -59,7 +59,7 @@ #include /* Thumbnail additions */ -#include "../menu_thumbnail_path.h" +#include "../gfx_thumbnail_path.h" #include "../../tasks/tasks_internal.h" #include #include @@ -553,7 +553,7 @@ typedef struct bool entry_has_thumbnail; bool entry_has_left_thumbnail; bool show_fs_thumbnail; - menu_thumbnail_path_data_t *thumbnail_path_data; + gfx_thumbnail_path_data_t *thumbnail_path_data; uint32_t thumbnail_queue_size; uint32_t left_thumbnail_queue_size; bool thumbnail_load_pending; @@ -1652,7 +1652,7 @@ static void process_wallpaper(rgui_t *rgui, struct texture_image *image) static bool request_thumbnail( thumbnail_t *thumbnail, - enum menu_thumbnail_id thumbnail_id, + enum gfx_thumbnail_id thumbnail_id, uint32_t *queue_size, const char *path, bool *file_missing) @@ -1678,7 +1678,7 @@ static bool request_thumbnail( * here, but can't see how to do it... */ if (task_push_image_load(thumbnail->path, video_driver_supports_rgba(), 0, - (thumbnail_id == MENU_THUMBNAIL_LEFT) ? + (thumbnail_id == GFX_THUMBNAIL_LEFT) ? menu_display_handle_left_thumbnail_upload : menu_display_handle_thumbnail_upload, NULL)) { @@ -2035,7 +2035,7 @@ static unsigned INLINE rgui_get_mini_thumbnail_fullwidth(void) return width >= left_width ? width : left_width; } -static void rgui_render_mini_thumbnail(rgui_t *rgui, thumbnail_t *thumbnail, enum menu_thumbnail_id thumbnail_id) +static void rgui_render_mini_thumbnail(rgui_t *rgui, thumbnail_t *thumbnail, enum gfx_thumbnail_id thumbnail_id) { settings_t *settings = config_get_ptr(); @@ -2066,8 +2066,8 @@ static void rgui_render_mini_thumbnail(rgui_t *rgui, thumbnail_t *thumbnail, enu fb_x_offset = (rgui_term_layout.start_x + term_width) - (thumbnail->width + ((thumbnail_fullwidth - thumbnail->width) >> 1)); - if (((thumbnail_id == MENU_THUMBNAIL_RIGHT) && !settings->bools.menu_rgui_swap_thumbnails) || - ((thumbnail_id == MENU_THUMBNAIL_LEFT) && settings->bools.menu_rgui_swap_thumbnails)) + if (((thumbnail_id == GFX_THUMBNAIL_RIGHT) && !settings->bools.menu_rgui_swap_thumbnails) || + ((thumbnail_id == GFX_THUMBNAIL_LEFT) && settings->bools.menu_rgui_swap_thumbnails)) { fb_y_offset = rgui_term_layout.start_y + ((thumbnail->max_height - thumbnail->height) >> 1); } @@ -3395,7 +3395,7 @@ static void rgui_render(void *data, rgui_render_fs_thumbnail(rgui); /* Get thumbnail title */ - if (menu_thumbnail_get_label(rgui->thumbnail_path_data, &thumbnail_title)) + if (gfx_thumbnail_get_label(rgui->thumbnail_path_data, &thumbnail_title)) { /* Format thumbnail title */ if (use_smooth_ticker) @@ -3756,10 +3756,10 @@ static void rgui_render(void *data, if (show_mini_thumbnails) { if (show_thumbnail) - rgui_render_mini_thumbnail(rgui, &mini_thumbnail, MENU_THUMBNAIL_RIGHT); + rgui_render_mini_thumbnail(rgui, &mini_thumbnail, GFX_THUMBNAIL_RIGHT); if (show_left_thumbnail) - rgui_render_mini_thumbnail(rgui, &mini_left_thumbnail, MENU_THUMBNAIL_LEFT); + rgui_render_mini_thumbnail(rgui, &mini_left_thumbnail, GFX_THUMBNAIL_LEFT); } /* Print menu sublabel/core name (if required) */ @@ -4343,7 +4343,7 @@ static void *rgui_init(void **userdata, bool video_is_threaded) rgui_set_blit_functions( settings->bools.menu_rgui_shadows, settings->bools.menu_rgui_extended_ascii); - rgui->thumbnail_path_data = menu_thumbnail_path_init(); + rgui->thumbnail_path_data = gfx_thumbnail_path_init(); if (!rgui->thumbnail_path_data) goto error; @@ -4517,7 +4517,7 @@ static void rgui_set_thumbnail_system(void *userdata, char *s, size_t len) rgui_t *rgui = (rgui_t*)userdata; if (!rgui) return; - menu_thumbnail_set_system( + gfx_thumbnail_set_system( rgui->thumbnail_path_data, s, playlist_get_cached()); } @@ -4527,7 +4527,7 @@ static void rgui_get_thumbnail_system(void *userdata, char *s, size_t len) const char *system = NULL; if (!rgui) return; - if (menu_thumbnail_get_system(rgui->thumbnail_path_data, &system)) + if (gfx_thumbnail_get_system(rgui->thumbnail_path_data, &system)) strlcpy(s, system, len); } @@ -4538,12 +4538,12 @@ static void rgui_load_current_thumbnails(rgui_t *rgui, bool download_missing) bool thumbnails_missing = false; /* Right (or fullscreen) thumbnail */ - if (menu_thumbnail_get_path(rgui->thumbnail_path_data, - MENU_THUMBNAIL_RIGHT, &thumbnail_path)) + if (gfx_thumbnail_get_path(rgui->thumbnail_path_data, + GFX_THUMBNAIL_RIGHT, &thumbnail_path)) { rgui->entry_has_thumbnail = request_thumbnail( rgui->show_fs_thumbnail ? &fs_thumbnail : &mini_thumbnail, - MENU_THUMBNAIL_RIGHT, + GFX_THUMBNAIL_RIGHT, &rgui->thumbnail_queue_size, thumbnail_path, &thumbnails_missing); @@ -4554,12 +4554,12 @@ static void rgui_load_current_thumbnails(rgui_t *rgui, bool download_missing) * fullscreen thumbnails) */ if (!rgui->show_fs_thumbnail) { - if (menu_thumbnail_get_path(rgui->thumbnail_path_data, - MENU_THUMBNAIL_LEFT, &left_thumbnail_path)) + if (gfx_thumbnail_get_path(rgui->thumbnail_path_data, + GFX_THUMBNAIL_LEFT, &left_thumbnail_path)) { rgui->entry_has_left_thumbnail = request_thumbnail( &mini_left_thumbnail, - MENU_THUMBNAIL_LEFT, + GFX_THUMBNAIL_LEFT, &rgui->left_thumbnail_queue_size, left_thumbnail_path, &thumbnails_missing); @@ -4579,7 +4579,7 @@ static void rgui_load_current_thumbnails(rgui_t *rgui, bool download_missing) { const char *system = NULL; - if (menu_thumbnail_get_system(rgui->thumbnail_path_data, &system)) + if (gfx_thumbnail_get_system(rgui->thumbnail_path_data, &system)) task_push_pl_entry_thumbnail_download(system, playlist_get_cached(), (unsigned)menu_navigation_get_selection(), false, true); @@ -4602,15 +4602,15 @@ static void rgui_scan_selected_entry_thumbnail(rgui_t *rgui, bool force_load) /* Update thumbnail content/path */ if ((rgui->show_fs_thumbnail || settings->bools.menu_rgui_inline_thumbnails) && rgui->is_playlist) { - if (menu_thumbnail_set_content_playlist(rgui->thumbnail_path_data, + if (gfx_thumbnail_set_content_playlist(rgui->thumbnail_path_data, playlist_get_cached(), menu_navigation_get_selection())) { - if (menu_thumbnail_is_enabled(rgui->thumbnail_path_data, MENU_THUMBNAIL_RIGHT)) - has_thumbnail = menu_thumbnail_update_path(rgui->thumbnail_path_data, MENU_THUMBNAIL_RIGHT); + if (gfx_thumbnail_is_enabled(rgui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT)) + has_thumbnail = gfx_thumbnail_update_path(rgui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT); if (settings->bools.menu_rgui_inline_thumbnails && - menu_thumbnail_is_enabled(rgui->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) - has_thumbnail = menu_thumbnail_update_path(rgui->thumbnail_path_data, MENU_THUMBNAIL_LEFT) || + gfx_thumbnail_is_enabled(rgui->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) + has_thumbnail = gfx_thumbnail_update_path(rgui->thumbnail_path_data, GFX_THUMBNAIL_LEFT) || has_thumbnail; } } @@ -4678,8 +4678,8 @@ static void rgui_refresh_thumbnail_image(void *userdata, unsigned i) /* Only refresh thumbnails if thumbnails are enabled */ if ((rgui->show_fs_thumbnail || settings->bools.menu_rgui_inline_thumbnails) && - (menu_thumbnail_is_enabled(rgui->thumbnail_path_data, MENU_THUMBNAIL_RIGHT) || - menu_thumbnail_is_enabled(rgui->thumbnail_path_data, MENU_THUMBNAIL_LEFT))) + (gfx_thumbnail_is_enabled(rgui->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + gfx_thumbnail_is_enabled(rgui->thumbnail_path_data, GFX_THUMBNAIL_LEFT))) { /* In all cases, reset current thumbnails */ fs_thumbnail.width = 0; diff --git a/menu/drivers/stripes.c b/menu/drivers/stripes.c index 432af46f9d..9bd83a3edf 100644 --- a/menu/drivers/stripes.c +++ b/menu/drivers/stripes.c @@ -462,7 +462,7 @@ static const char *stripes_thumbnails_ident(char pos) settings_t *settings = config_get_ptr(); if (pos == 'R') - folder = settings->uints.menu_thumbnails; + folder = settings->uints.gfx_thumbnails; if (pos == 'L') folder = settings->uints.menu_left_thumbnails; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 436d4de788..221a6cd67e 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -45,8 +45,8 @@ #include "../../gfx/gfx_animation.h" #include "../menu_entries.h" #include "../menu_input.h" -#include "../menu_thumbnail_path.h" -#include "../menu_thumbnail.h" +#include "../gfx_thumbnail_path.h" +#include "../gfx_thumbnail.h" #include "../../core_info.h" #include "../../core.h" @@ -333,11 +333,11 @@ typedef struct xmb_handle video_font_raster_block_t raster_block; video_font_raster_block_t raster_block2; - menu_thumbnail_path_data_t *thumbnail_path_data; + gfx_thumbnail_path_data_t *thumbnail_path_data; struct { - menu_thumbnail_t right; - menu_thumbnail_t left; - menu_thumbnail_t savestate; + gfx_thumbnail_t right; + gfx_thumbnail_t left; + gfx_thumbnail_t savestate; } thumbnails; /* These have to be huge, because global->name.savestate * has a hard-coded size of 8192... @@ -971,56 +971,58 @@ static void xmb_update_thumbnail_image(void *data) if (!xmb) return; - menu_thumbnail_cancel_pending_requests(); + gfx_thumbnail_cancel_pending_requests(); /* imageviewer content requires special treatment... */ - menu_thumbnail_get_core_name(xmb->thumbnail_path_data, &core_name); + gfx_thumbnail_get_core_name(xmb->thumbnail_path_data, &core_name); if (string_is_equal(core_name, "imageviewer")) { - menu_thumbnail_reset(&xmb->thumbnails.right); - menu_thumbnail_reset(&xmb->thumbnails.left); + gfx_thumbnail_reset(&xmb->thumbnails.right); + gfx_thumbnail_reset(&xmb->thumbnails.left); /* Right thumbnail */ - if (menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT)) - menu_thumbnail_request( + if (gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, + GFX_THUMBNAIL_RIGHT)) + gfx_thumbnail_request( xmb->thumbnail_path_data, - MENU_THUMBNAIL_RIGHT, + GFX_THUMBNAIL_RIGHT, playlist, selection, &xmb->thumbnails.right, - settings->uints.menu_thumbnail_upscale_threshold, + settings->uints.gfx_thumbnail_upscale_threshold, settings->bools.network_on_demand_thumbnails); /* Left thumbnail */ - else if (menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) - menu_thumbnail_request( + else if (gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, + GFX_THUMBNAIL_LEFT)) + gfx_thumbnail_request( xmb->thumbnail_path_data, - MENU_THUMBNAIL_LEFT, + GFX_THUMBNAIL_LEFT, playlist, selection, &xmb->thumbnails.left, - settings->uints.menu_thumbnail_upscale_threshold, + settings->uints.gfx_thumbnail_upscale_threshold, settings->bools.network_on_demand_thumbnails); } else { /* Right thumbnail */ - menu_thumbnail_request( + gfx_thumbnail_request( xmb->thumbnail_path_data, - MENU_THUMBNAIL_RIGHT, + GFX_THUMBNAIL_RIGHT, playlist, selection, &xmb->thumbnails.right, - settings->uints.menu_thumbnail_upscale_threshold, + settings->uints.gfx_thumbnail_upscale_threshold, settings->bools.network_on_demand_thumbnails); /* Left thumbnail */ - menu_thumbnail_request( + gfx_thumbnail_request( xmb->thumbnail_path_data, - MENU_THUMBNAIL_LEFT, + GFX_THUMBNAIL_LEFT, playlist, selection, &xmb->thumbnails.left, - settings->uints.menu_thumbnail_upscale_threshold, + settings->uints.gfx_thumbnail_upscale_threshold, settings->bools.network_on_demand_thumbnails); } } @@ -1040,8 +1042,8 @@ static void xmb_refresh_thumbnail_image(void *data, unsigned i) return; /* Only refresh thumbnails if thumbnails are enabled */ - if ( menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT) || - menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) + if ( gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) { unsigned depth = (unsigned)xmb_list_get_size(xmb, MENU_LIST_PLAIN); unsigned xmb_system_tab = xmb_get_system_tab(xmb, (unsigned)xmb->categories_selection_ptr); @@ -1062,7 +1064,7 @@ static void xmb_set_thumbnail_system(void *data, char*s, size_t len) if (!xmb) return; - menu_thumbnail_set_system( + gfx_thumbnail_set_system( xmb->thumbnail_path_data, s, playlist_get_cached()); } @@ -1073,7 +1075,7 @@ static void xmb_get_thumbnail_system(void *data, char*s, size_t len) if (!xmb) return; - if (menu_thumbnail_get_system(xmb->thumbnail_path_data, &system)) + if (gfx_thumbnail_get_system(xmb->thumbnail_path_data, &system)) strlcpy(s, system, len); } @@ -1083,10 +1085,10 @@ static void xmb_unload_thumbnail_textures(void *data) if (!xmb) return; - menu_thumbnail_cancel_pending_requests(); - menu_thumbnail_reset(&xmb->thumbnails.right); - menu_thumbnail_reset(&xmb->thumbnails.left); - menu_thumbnail_reset(&xmb->thumbnails.savestate); + gfx_thumbnail_cancel_pending_requests(); + gfx_thumbnail_reset(&xmb->thumbnails.right); + gfx_thumbnail_reset(&xmb->thumbnails.left); + gfx_thumbnail_reset(&xmb->thumbnails.savestate); } static void xmb_set_thumbnail_content(void *data, const char *s) @@ -1109,7 +1111,7 @@ static void xmb_set_thumbnail_content(void *data, const char *s) /* Playlist content */ if (string_is_empty(s)) { - menu_thumbnail_set_content_playlist(xmb->thumbnail_path_data, + gfx_thumbnail_set_content_playlist(xmb->thumbnail_path_data, playlist_get_cached(), selection); xmb->fullscreen_thumbnails_available = true; } @@ -1130,7 +1132,7 @@ static void xmb_set_thumbnail_content(void *data, const char *s) if (!string_is_empty(entry.path)) { - menu_thumbnail_set_content(xmb->thumbnail_path_data, entry.path); + gfx_thumbnail_set_content(xmb->thumbnail_path_data, entry.path); xmb->fullscreen_thumbnails_available = true; } } @@ -1154,7 +1156,7 @@ static void xmb_set_thumbnail_content(void *data, const char *s) if ( !string_is_empty(entry.path) && !string_is_empty(node->fullpath)) { - menu_thumbnail_set_content_image(xmb->thumbnail_path_data, node->fullpath, entry.path); + gfx_thumbnail_set_content_image(xmb->thumbnail_path_data, node->fullpath, entry.path); xmb->fullscreen_thumbnails_available = true; } } @@ -1167,7 +1169,7 @@ static void xmb_set_thumbnail_content(void *data, const char *s) * the sublevels of database manager lists. * Showing thumbnails on database entries is a * pointless nuisance and a waste of CPU cycles, IMHO... */ - menu_thumbnail_set_content(xmb->thumbnail_path_data, s); + gfx_thumbnail_set_content(xmb->thumbnail_path_data, s); xmb->fullscreen_thumbnails_available = true; } } @@ -1186,18 +1188,18 @@ static void xmb_update_savestate_thumbnail_image(void *data) /* If path is empty, just reset thumbnail */ if (string_is_empty(xmb->savestate_thumbnail_file_path)) - menu_thumbnail_reset(&xmb->thumbnails.savestate); + gfx_thumbnail_reset(&xmb->thumbnails.savestate); else { /* Only request thumbnail if: * > Thumbnail has never been loaded *OR* * > Thumbnail path has changed */ - if ((xmb->thumbnails.savestate.status == MENU_THUMBNAIL_STATUS_UNKNOWN) || + if ((xmb->thumbnails.savestate.status == GFX_THUMBNAIL_STATUS_UNKNOWN) || !string_is_equal(xmb->savestate_thumbnail_file_path, xmb->prev_savestate_thumbnail_file_path)) - menu_thumbnail_request_file( + gfx_thumbnail_request_file( xmb->savestate_thumbnail_file_path, &xmb->thumbnails.savestate, - settings->uints.menu_thumbnail_upscale_threshold); + settings->uints.gfx_thumbnail_upscale_threshold); } } @@ -1259,8 +1261,8 @@ static void xmb_selection_pointer_changed( ia = xmb->items_active_alpha; iz = xmb->items_active_zoom; if ( - menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT) || - menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_LEFT) + gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT) ) { bool update_thumbnails = false; @@ -1296,10 +1298,10 @@ static void xmb_selection_pointer_changed( * content + right/left thumbnails * (otherwise last loaded thumbnail will * persist, and be shown on the wrong entry) */ - menu_thumbnail_set_content(xmb->thumbnail_path_data, NULL); - menu_thumbnail_cancel_pending_requests(); - menu_thumbnail_reset(&xmb->thumbnails.right); - menu_thumbnail_reset(&xmb->thumbnails.left); + gfx_thumbnail_set_content(xmb->thumbnail_path_data, NULL); + gfx_thumbnail_cancel_pending_requests(); + gfx_thumbnail_reset(&xmb->thumbnails.right); + gfx_thumbnail_reset(&xmb->thumbnails.left); } } @@ -1506,8 +1508,8 @@ static void xmb_list_open_new(xmb_handle_t *xmb, if (xmb_system_tab <= XMB_SYSTEM_TAB_SETTINGS) { - if ( menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT) || - menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) + if ( gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) { /* This code is horrible, full of hacks... * This hack ensures that thumbnails are not cleared @@ -1849,8 +1851,8 @@ static void xmb_list_switch(xmb_handle_t *xmb) xmb_list_switch_new(xmb, selection_buf, dir, selection); xmb->categories_active_idx_old = (unsigned)xmb->categories_selection_ptr; - if (menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT) || - menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) + if (gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) { xmb_unload_thumbnail_textures(xmb); @@ -2287,10 +2289,10 @@ static void xmb_populate_entries(void *data, * file list is populated... */ if (xmb->is_file_list) { - menu_thumbnail_set_content(xmb->thumbnail_path_data, NULL); - menu_thumbnail_cancel_pending_requests(); - menu_thumbnail_reset(&xmb->thumbnails.right); - menu_thumbnail_reset(&xmb->thumbnails.left); + gfx_thumbnail_set_content(xmb->thumbnail_path_data, NULL); + gfx_thumbnail_cancel_pending_requests(); + gfx_thumbnail_reset(&xmb->thumbnails.right); + gfx_thumbnail_reset(&xmb->thumbnails.left); } } @@ -2966,14 +2968,14 @@ static int xmb_draw_item( if (string_is_empty(entry->value)) { - if ((xmb->thumbnails.savestate.status == MENU_THUMBNAIL_STATUS_AVAILABLE) || + if ((xmb->thumbnails.savestate.status == GFX_THUMBNAIL_STATUS_AVAILABLE) || !xmb->use_ps3_layout || - (menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT) - && ((xmb->thumbnails.right.status == MENU_THUMBNAIL_STATUS_AVAILABLE) - || (xmb->thumbnails.right.status == MENU_THUMBNAIL_STATUS_PENDING))) || - (menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_LEFT) - && ((xmb->thumbnails.left.status == MENU_THUMBNAIL_STATUS_AVAILABLE) - || (xmb->thumbnails.left.status == MENU_THUMBNAIL_STATUS_PENDING)) + (gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) + && ((xmb->thumbnails.right.status == GFX_THUMBNAIL_STATUS_AVAILABLE) + || (xmb->thumbnails.right.status == GFX_THUMBNAIL_STATUS_PENDING))) || + (gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT) + && ((xmb->thumbnails.left.status == GFX_THUMBNAIL_STATUS_AVAILABLE) + || (xmb->thumbnails.left.status == GFX_THUMBNAIL_STATUS_PENDING)) && settings->bools.menu_xmb_vertical_thumbnails) ) { @@ -3629,7 +3631,7 @@ static void xmb_hide_fullscreen_thumbnails( /* Configure fade out animation */ animation_entry.easing_enum = EASING_OUT_QUAD; animation_entry.tag = alpha_tag; - animation_entry.duration = menu_thumbnail_get_fade_duration(); + animation_entry.duration = gfx_thumbnail_get_fade_duration(); animation_entry.target_value = 0.0f; animation_entry.subject = &xmb->fullscreen_thumbnail_alpha; animation_entry.cb = NULL; @@ -3671,20 +3673,20 @@ static void xmb_show_fullscreen_thumbnails( * current selection has at least one valid thumbnail * and all thumbnails for current selection are already * loaded/available */ - menu_thumbnail_get_core_name(xmb->thumbnail_path_data, &core_name); + gfx_thumbnail_get_core_name(xmb->thumbnail_path_data, &core_name); if (string_is_equal(core_name, "imageviewer")) { /* imageviewer content requires special treatment, * since only one thumbnail can ever be loaded * at a time */ - if (menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT)) + if (gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT)) { - if (xmb->thumbnails.right.status != MENU_THUMBNAIL_STATUS_AVAILABLE) + if (xmb->thumbnails.right.status != GFX_THUMBNAIL_STATUS_AVAILABLE) return; } - else if (menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) + else if (gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) { - if (xmb->thumbnails.left.status != MENU_THUMBNAIL_STATUS_AVAILABLE) + if (xmb->thumbnails.left.status != GFX_THUMBNAIL_STATUS_AVAILABLE) return; } else @@ -3692,18 +3694,18 @@ static void xmb_show_fullscreen_thumbnails( } else { - bool left_thumbnail_enabled = menu_thumbnail_is_enabled( - xmb->thumbnail_path_data, MENU_THUMBNAIL_LEFT); + bool left_thumbnail_enabled = gfx_thumbnail_is_enabled( + xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT); - if ((xmb->thumbnails.right.status == MENU_THUMBNAIL_STATUS_AVAILABLE) && + if ((xmb->thumbnails.right.status == GFX_THUMBNAIL_STATUS_AVAILABLE) && (left_thumbnail_enabled && - ((xmb->thumbnails.left.status != MENU_THUMBNAIL_STATUS_MISSING) && - (xmb->thumbnails.left.status != MENU_THUMBNAIL_STATUS_AVAILABLE)))) + ((xmb->thumbnails.left.status != GFX_THUMBNAIL_STATUS_MISSING) && + (xmb->thumbnails.left.status != GFX_THUMBNAIL_STATUS_AVAILABLE)))) return; - if ((xmb->thumbnails.right.status == MENU_THUMBNAIL_STATUS_MISSING) && + if ((xmb->thumbnails.right.status == GFX_THUMBNAIL_STATUS_MISSING) && (!left_thumbnail_enabled || - (xmb->thumbnails.left.status != MENU_THUMBNAIL_STATUS_AVAILABLE))) + (xmb->thumbnails.left.status != GFX_THUMBNAIL_STATUS_AVAILABLE))) return; } @@ -3732,7 +3734,7 @@ static void xmb_show_fullscreen_thumbnails( /* Configure fade in animation */ animation_entry.easing_enum = EASING_OUT_QUAD; animation_entry.tag = alpha_tag; - animation_entry.duration = menu_thumbnail_get_fade_duration(); + animation_entry.duration = gfx_thumbnail_get_fade_duration(); animation_entry.target_value = 1.0f; animation_entry.subject = &xmb->fullscreen_thumbnail_alpha; animation_entry.cb = NULL; @@ -3753,8 +3755,8 @@ static void xmb_draw_fullscreen_thumbnails( /* Check whether fullscreen thumbnails are visible */ if (xmb->fullscreen_thumbnail_alpha > 0.0f) { - menu_thumbnail_t *right_thumbnail = NULL; - menu_thumbnail_t *left_thumbnail = NULL; + gfx_thumbnail_t *right_thumbnail = NULL; + gfx_thumbnail_t *left_thumbnail = NULL; int view_width = (int)video_info->width; int view_height = (int)video_info->height; int thumbnail_margin = (int)(xmb->icon_size / 2.0f); @@ -3798,7 +3800,7 @@ static void xmb_draw_fullscreen_thumbnails( int right_thumbnail_x; int left_thumbnail_x; int thumbnail_y; - menu_thumbnail_shadow_t thumbnail_shadow; + gfx_thumbnail_shadow_t thumbnail_shadow; /* Sanity check: Return immediately if this is * a menu without thumbnails and we are not currently @@ -3835,8 +3837,8 @@ static void xmb_draw_fullscreen_thumbnails( } /* Get number of 'active' thumbnails */ - show_right_thumbnail = (right_thumbnail->status == MENU_THUMBNAIL_STATUS_AVAILABLE); - show_left_thumbnail = (left_thumbnail->status == MENU_THUMBNAIL_STATUS_AVAILABLE); + show_right_thumbnail = (right_thumbnail->status == GFX_THUMBNAIL_STATUS_AVAILABLE); + show_left_thumbnail = (left_thumbnail->status == GFX_THUMBNAIL_STATUS_AVAILABLE); if (show_right_thumbnail) num_thumbnails++; @@ -3888,7 +3890,7 @@ static void xmb_draw_fullscreen_thumbnails( * the bounding box dimensions... */ if (show_right_thumbnail) { - menu_thumbnail_get_draw_dimensions( + gfx_thumbnail_get_draw_dimensions( right_thumbnail, thumbnail_box_width, thumbnail_box_height, 1.0f, &right_thumbnail_draw_width, &right_thumbnail_draw_height); @@ -3901,7 +3903,7 @@ static void xmb_draw_fullscreen_thumbnails( if (show_left_thumbnail) { - menu_thumbnail_get_draw_dimensions( + gfx_thumbnail_get_draw_dimensions( left_thumbnail, thumbnail_box_width, thumbnail_box_height, 1.0f, &left_thumbnail_draw_width, &left_thumbnail_draw_height); @@ -4053,13 +4055,13 @@ static void xmb_draw_fullscreen_thumbnails( { float shadow_offset = xmb->icon_size / 24.0f; - thumbnail_shadow.type = MENU_THUMBNAIL_SHADOW_DROP; + thumbnail_shadow.type = GFX_THUMBNAIL_SHADOW_DROP; thumbnail_shadow.alpha = 0.35f; thumbnail_shadow.drop.x_offset = shadow_offset; thumbnail_shadow.drop.y_offset = shadow_offset; } else - thumbnail_shadow.type = MENU_THUMBNAIL_SHADOW_NONE; + thumbnail_shadow.type = GFX_THUMBNAIL_SHADOW_NONE; /* > Right */ if (show_right_thumbnail) @@ -4078,14 +4080,14 @@ static void xmb_draw_fullscreen_thumbnails( frame_color); /* Thumbnail */ - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, right_thumbnail, right_thumbnail_x, thumbnail_y, (unsigned)thumbnail_box_width, (unsigned)thumbnail_box_height, - MENU_THUMBNAIL_ALIGN_CENTRE, + GFX_THUMBNAIL_ALIGN_CENTRE, xmb->fullscreen_thumbnail_alpha, 1.0f, &thumbnail_shadow); @@ -4108,14 +4110,14 @@ static void xmb_draw_fullscreen_thumbnails( frame_color); /* Thumbnail */ - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, left_thumbnail, left_thumbnail_x, thumbnail_y, (unsigned)thumbnail_box_width, (unsigned)thumbnail_box_height, - MENU_THUMBNAIL_ALIGN_CENTRE, + GFX_THUMBNAIL_ALIGN_CENTRE, xmb->fullscreen_thumbnail_alpha, 1.0f, &thumbnail_shadow); @@ -4139,7 +4141,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info) char msg[1024]; char title_msg[255]; char title_truncated[255]; - menu_thumbnail_shadow_t thumbnail_shadow; + gfx_thumbnail_shadow_t thumbnail_shadow; size_t selection = 0; size_t percent_width = 0; bool render_background = false; @@ -4189,13 +4191,13 @@ static void xmb_frame(void *data, video_frame_info_t *video_info) float shadow_offset = xmb->shadow_offset * 1.5f * (settings->floats.menu_scale_factor * (float)width) / 1920.0f; shadow_offset = (shadow_offset > xmb->shadow_offset) ? shadow_offset : xmb->shadow_offset; - thumbnail_shadow.type = MENU_THUMBNAIL_SHADOW_DROP; + thumbnail_shadow.type = GFX_THUMBNAIL_SHADOW_DROP; thumbnail_shadow.alpha = 0.35f; thumbnail_shadow.drop.x_offset = shadow_offset; thumbnail_shadow.drop.y_offset = shadow_offset; } else - thumbnail_shadow.type = MENU_THUMBNAIL_SHADOW_NONE; + thumbnail_shadow.type = GFX_THUMBNAIL_SHADOW_NONE; font_driver_bind_block(xmb->font, &xmb->raster_block); font_driver_bind_block(xmb->font2, &xmb->raster_block2); @@ -4271,8 +4273,8 @@ static void xmb_frame(void *data, video_frame_info_t *video_info) /* Save state thumbnail, right side */ if (xmb->is_quick_menu && - ((xmb->thumbnails.savestate.status == MENU_THUMBNAIL_STATUS_AVAILABLE) || - (xmb->thumbnails.savestate.status == MENU_THUMBNAIL_STATUS_PENDING))) + ((xmb->thumbnails.savestate.status == GFX_THUMBNAIL_STATUS_AVAILABLE) || + (xmb->thumbnails.savestate.status == GFX_THUMBNAIL_STATUS_PENDING))) { float thumb_width = right_thumbnail_margin_width; float thumb_height = thumbnail_margin_height_full; @@ -4281,14 +4283,14 @@ static void xmb_frame(void *data, video_frame_info_t *video_info) float thumb_x = right_thumbnail_margin_x + ((thumb_width - scaled_thumb_width) / 2.0f); float thumb_y = xmb->margins_title_top + (xmb->icon_size / 4.0f) + ((thumb_height - scaled_thumb_height) / 2.0f); - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, &xmb->thumbnails.savestate, thumb_x, thumb_y, scaled_thumb_width > 0.0f ? (unsigned)scaled_thumb_width : 0, scaled_thumb_height > 0.0f ? (unsigned)scaled_thumb_height : 0, - MENU_THUMBNAIL_ALIGN_CENTRE, + GFX_THUMBNAIL_ALIGN_CENTRE, 1.0f, 1.0f, &thumbnail_shadow); } /* This is used for hiding thumbnails when going into sub-levels in the @@ -4298,11 +4300,11 @@ static void xmb_frame(void *data, video_frame_info_t *video_info) else if (!((xmb_system_tab > XMB_SYSTEM_TAB_SETTINGS) && (xmb->depth > 2))) { bool show_right_thumbnail = - (xmb->thumbnails.right.status == MENU_THUMBNAIL_STATUS_AVAILABLE) || - (xmb->thumbnails.right.status == MENU_THUMBNAIL_STATUS_PENDING); + (xmb->thumbnails.right.status == GFX_THUMBNAIL_STATUS_AVAILABLE) || + (xmb->thumbnails.right.status == GFX_THUMBNAIL_STATUS_PENDING); bool show_left_thumbnail = - (xmb->thumbnails.left.status == MENU_THUMBNAIL_STATUS_AVAILABLE) || - (xmb->thumbnails.left.status == MENU_THUMBNAIL_STATUS_PENDING); + (xmb->thumbnails.left.status == GFX_THUMBNAIL_STATUS_AVAILABLE) || + (xmb->thumbnails.left.status == GFX_THUMBNAIL_STATUS_PENDING); /* Check if we are using the proper PS3 layout, * or the aborted PSP layout */ @@ -4325,24 +4327,24 @@ static void xmb_frame(void *data, video_frame_info_t *video_info) float right_thumb_y = thumb_y_base + thumb_y_offset; float left_thumb_y = thumb_y_base + thumb_height + (xmb->icon_size / 4) + thumb_y_offset; - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, &xmb->thumbnails.right, thumb_x, right_thumb_y, scaled_thumb_width > 0.0f ? (unsigned)scaled_thumb_width : 0, scaled_thumb_height > 0.0f ? (unsigned)scaled_thumb_height : 0, - MENU_THUMBNAIL_ALIGN_CENTRE, + GFX_THUMBNAIL_ALIGN_CENTRE, 1.0f, 1.0f, &thumbnail_shadow); - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, &xmb->thumbnails.left, thumb_x, left_thumb_y, scaled_thumb_width > 0.0f ? (unsigned)scaled_thumb_width : 0, scaled_thumb_height > 0.0f ? (unsigned)scaled_thumb_height : 0, - MENU_THUMBNAIL_ALIGN_CENTRE, + GFX_THUMBNAIL_ALIGN_CENTRE, 1.0f, 1.0f, &thumbnail_shadow); /* Horizontal tab icons overlapping the top @@ -4360,14 +4362,14 @@ static void xmb_frame(void *data, video_frame_info_t *video_info) float thumb_x = right_thumbnail_margin_x + ((thumb_width - scaled_thumb_width) / 2.0f); float thumb_y = xmb->margins_screen_top + xmb->icon_size; - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, show_right_thumbnail ? &xmb->thumbnails.right : &xmb->thumbnails.left, thumb_x, thumb_y, scaled_thumb_width > 0.0f ? (unsigned)scaled_thumb_width : 0, scaled_thumb_height > 0.0f ? (unsigned)scaled_thumb_height : 0, - MENU_THUMBNAIL_ALIGN_TOP, + GFX_THUMBNAIL_ALIGN_TOP, 1.0f, 1.0f, &thumbnail_shadow); } } @@ -4383,14 +4385,14 @@ static void xmb_frame(void *data, video_frame_info_t *video_info) float thumb_x = right_thumbnail_margin_x + ((thumb_width - scaled_thumb_width) / 2.0f); float thumb_y = xmb->margins_screen_top + xmb->icon_size; - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, &xmb->thumbnails.right, thumb_x, thumb_y, scaled_thumb_width > 0.0f ? (unsigned)scaled_thumb_width : 0, scaled_thumb_height > 0.0f ? (unsigned)scaled_thumb_height : 0, - MENU_THUMBNAIL_ALIGN_TOP, + GFX_THUMBNAIL_ALIGN_TOP, 1.0f, 1.0f, &thumbnail_shadow); } @@ -4405,14 +4407,14 @@ static void xmb_frame(void *data, video_frame_info_t *video_info) float thumb_x = left_thumbnail_margin_x + ((thumb_width - scaled_thumb_width) / 2.0f); float thumb_y = xmb->margins_screen_top + xmb->icon_size + y_offset; - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, &xmb->thumbnails.left, thumb_x, thumb_y, scaled_thumb_width > 0.0f ? (unsigned)scaled_thumb_width : 0, scaled_thumb_height > 0.0f ? (unsigned)scaled_thumb_height : 0, - MENU_THUMBNAIL_ALIGN_TOP, + GFX_THUMBNAIL_ALIGN_TOP, 1.0f, 1.0f, &thumbnail_shadow); } } @@ -4435,14 +4437,14 @@ static void xmb_frame(void *data, video_frame_info_t *video_info) /* Very small thumbnails look ridiculous * > Impose a minimum size limit */ if (thumb_height > xmb->icon_size) - menu_thumbnail_draw( + gfx_thumbnail_draw( video_info, show_left_thumbnail ? &xmb->thumbnails.left : &xmb->thumbnails.right, thumb_x, thumb_y, scaled_thumb_width > 0.0f ? (unsigned)scaled_thumb_width : 0, scaled_thumb_height > 0.0f ? (unsigned)scaled_thumb_height : 0, - MENU_THUMBNAIL_ALIGN_TOP, + GFX_THUMBNAIL_ALIGN_TOP, 1.0f, 1.0f, &thumbnail_shadow); } } @@ -5114,7 +5116,7 @@ static void *xmb_init(void **userdata, bool video_is_threaded) xmb_init_ribbon(xmb); /* Thumbnail initialisation */ - xmb->thumbnail_path_data = menu_thumbnail_path_init(); + xmb->thumbnail_path_data = gfx_thumbnail_path_init(); if (!xmb->thumbnail_path_data) goto error; @@ -5679,8 +5681,8 @@ static void xmb_context_reset_internal(xmb_handle_t *xmb, * > Thumbnails are enabled * > This is a playlist, a database list, a file list * or the quick menu */ - if (menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT) || - menu_thumbnail_is_enabled(xmb->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) + if (gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT) || + gfx_thumbnail_is_enabled(xmb->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) { unsigned depth = (unsigned)xmb_list_get_size(xmb, MENU_LIST_PLAIN); unsigned xmb_system_tab = xmb_get_system_tab(xmb, (unsigned)xmb->categories_selection_ptr); @@ -6036,7 +6038,7 @@ static void xmb_toggle(void *userdata, bool menu_on) /* Have to reset this, otherwise savestate * thumbnail won't update after selecting * 'save state' option */ - menu_thumbnail_reset(&xmb->thumbnails.savestate); + gfx_thumbnail_reset(&xmb->thumbnails.savestate); entry.duration = XMB_DELAY * 2; entry.target_value = 1.0f; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 09dcf50af0..53165293cc 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -13850,10 +13850,10 @@ static bool setting_append_list( CONFIG_UINT( list, list_info, - &settings->uints.menu_thumbnails, + &settings->uints.gfx_thumbnails, MENU_ENUM_LABEL_THUMBNAILS, thumbnails_label_value, - menu_thumbnails_default, + gfx_thumbnails_default, &group_info, &subgroup_info, parent_group, @@ -13922,10 +13922,10 @@ static bool setting_append_list( { CONFIG_UINT( list, list_info, - &settings->uints.menu_thumbnail_upscale_threshold, + &settings->uints.gfx_thumbnail_upscale_threshold, MENU_ENUM_LABEL_MENU_THUMBNAIL_UPSCALE_THRESHOLD, MENU_ENUM_LABEL_VALUE_MENU_THUMBNAIL_UPSCALE_THRESHOLD, - menu_thumbnail_upscale_threshold, + gfx_thumbnail_upscale_threshold, &group_info, &subgroup_info, parent_group, diff --git a/playlist.h b/playlist.h index d724e73f73..ebfc70795a 100644 --- a/playlist.h +++ b/playlist.h @@ -64,8 +64,12 @@ enum playlist_thumbnail_mode PLAYLIST_THUMBNAIL_MODE_BOXARTS }; +/* TODO/FIXME - since gfx_thumbnail_path.h has now + * been divorced from the menu code, perhaps jdgleaver + * can refactor this? */ + /* Note: We already have a left/right enum defined - * in menu_thumbnail_path.h - but we can't include + * in gfx_thumbnail_path.h - but we can't include * menu code here, so have to make a 'duplicate'... */ enum playlist_thumbnail_id { diff --git a/tasks/task_pl_thumbnail_download.c b/tasks/task_pl_thumbnail_download.c index c6b3541535..62d977ac61 100644 --- a/tasks/task_pl_thumbnail_download.c +++ b/tasks/task_pl_thumbnail_download.c @@ -34,8 +34,8 @@ #include "../verbosity.h" #ifdef RARCH_INTERNAL +#include "../gfx/gfx_thumbnail_path.h" #ifdef HAVE_MENU -#include "../menu/menu_thumbnail_path.h" #include "../menu/menu_cbs.h" #include "../menu/menu_driver.h" #endif @@ -55,7 +55,7 @@ typedef struct pl_thumb_handle char *playlist_path; char *dir_thumbnails; playlist_t *playlist; - menu_thumbnail_path_data_t *thumbnail_path_data; + gfx_thumbnail_path_data_t *thumbnail_path_data; retro_task_t *http_task; bool http_task_complete; size_t list_size; @@ -104,11 +104,11 @@ static bool get_thumbnail_paths( return false; /* Extract required strings */ - menu_thumbnail_get_system(pl_thumb->thumbnail_path_data, &system); - menu_thumbnail_get_db_name(pl_thumb->thumbnail_path_data, &db_name); - if (!menu_thumbnail_get_img_name(pl_thumb->thumbnail_path_data, &img_name)) + gfx_thumbnail_get_system(pl_thumb->thumbnail_path_data, &system); + gfx_thumbnail_get_db_name(pl_thumb->thumbnail_path_data, &db_name); + if (!gfx_thumbnail_get_img_name(pl_thumb->thumbnail_path_data, &img_name)) return false; - if (!menu_thumbnail_get_sub_directory(pl_thumb->type_idx, &sub_dir)) + if (!gfx_thumbnail_get_sub_directory(pl_thumb->type_idx, &sub_dir)) return false; /* Dermine system name */ @@ -124,7 +124,7 @@ static bool get_thumbnail_paths( if (string_is_equal(system, "history") || string_is_equal(system, "favorites")) { - if (!menu_thumbnail_get_content_dir( + if (!gfx_thumbnail_get_content_dir( pl_thumb->thumbnail_path_data, content_dir, sizeof(content_dir))) return false; @@ -357,12 +357,12 @@ static void task_pl_thumbnail_download_handler(retro_task_t *task) goto task_finished; /* Initialise thumbnail path data */ - pl_thumb->thumbnail_path_data = menu_thumbnail_path_init(); + pl_thumb->thumbnail_path_data = gfx_thumbnail_path_init(); if (!pl_thumb->thumbnail_path_data) goto task_finished; - if (!menu_thumbnail_set_system( + if (!gfx_thumbnail_set_system( pl_thumb->thumbnail_path_data, pl_thumb->system, pl_thumb->playlist)) goto task_finished; @@ -373,14 +373,14 @@ static void task_pl_thumbnail_download_handler(retro_task_t *task) case PL_THUMB_ITERATE_ENTRY: { /* Set current thumbnail content */ - if (menu_thumbnail_set_content_playlist( + if (gfx_thumbnail_set_content_playlist( pl_thumb->thumbnail_path_data, pl_thumb->playlist, pl_thumb->list_index)) { const char *label = NULL; /* Update progress display */ task_free_title(task); - if (menu_thumbnail_get_label(pl_thumb->thumbnail_path_data, &label)) + if (gfx_thumbnail_get_label(pl_thumb->thumbnail_path_data, &label)) task_set_title(task, strdup(label)); else task_set_title(task, strdup("")); @@ -614,14 +614,14 @@ static void cb_task_pl_entry_thumbnail_refresh_menu( * files have been overwritten) */ if (!pl_thumb->right_thumbnail_exists || pl_thumb->overwrite) - if (menu_thumbnail_update_path(pl_thumb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT)) - if (menu_thumbnail_get_path(pl_thumb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT, &thumbnail_path)) + if (gfx_thumbnail_update_path(pl_thumb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT)) + if (gfx_thumbnail_get_path(pl_thumb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT, &thumbnail_path)) do_refresh = path_is_valid(thumbnail_path); if (!do_refresh) if (!pl_thumb->left_thumbnail_exists || pl_thumb->overwrite) - if (menu_thumbnail_update_path(pl_thumb->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) - if (menu_thumbnail_get_path(pl_thumb->thumbnail_path_data, MENU_THUMBNAIL_LEFT, &left_thumbnail_path)) + if (gfx_thumbnail_update_path(pl_thumb->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) + if (gfx_thumbnail_get_path(pl_thumb->thumbnail_path_data, GFX_THUMBNAIL_LEFT, &left_thumbnail_path)) do_refresh = path_is_valid(left_thumbnail_path); if (do_refresh) @@ -680,34 +680,34 @@ static void task_pl_entry_thumbnail_download_handler(retro_task_t *task) goto task_finished; /* Initialise thumbnail path data */ - pl_thumb->thumbnail_path_data = menu_thumbnail_path_init(); + pl_thumb->thumbnail_path_data = gfx_thumbnail_path_init(); if (!pl_thumb->thumbnail_path_data) goto task_finished; - if (!menu_thumbnail_set_system( + if (!gfx_thumbnail_set_system( pl_thumb->thumbnail_path_data, pl_thumb->system, pl_thumb->playlist)) goto task_finished; - if (!menu_thumbnail_set_content_playlist( + if (!gfx_thumbnail_set_content_playlist( pl_thumb->thumbnail_path_data, pl_thumb->playlist, pl_thumb->list_index)) goto task_finished; /* Check whether current right/left thumbnails * already exist (required for menu refresh callback) */ pl_thumb->right_thumbnail_exists = false; - if (menu_thumbnail_update_path(pl_thumb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT)) - if (menu_thumbnail_get_path(pl_thumb->thumbnail_path_data, MENU_THUMBNAIL_RIGHT, &right_thumbnail_path)) + if (gfx_thumbnail_update_path(pl_thumb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT)) + if (gfx_thumbnail_get_path(pl_thumb->thumbnail_path_data, GFX_THUMBNAIL_RIGHT, &right_thumbnail_path)) pl_thumb->right_thumbnail_exists = path_is_valid(right_thumbnail_path); pl_thumb->left_thumbnail_exists = false; - if (menu_thumbnail_update_path(pl_thumb->thumbnail_path_data, MENU_THUMBNAIL_LEFT)) - if (menu_thumbnail_get_path(pl_thumb->thumbnail_path_data, MENU_THUMBNAIL_LEFT, &left_thumbnail_path)) + if (gfx_thumbnail_update_path(pl_thumb->thumbnail_path_data, GFX_THUMBNAIL_LEFT)) + if (gfx_thumbnail_get_path(pl_thumb->thumbnail_path_data, GFX_THUMBNAIL_LEFT, &left_thumbnail_path)) pl_thumb->left_thumbnail_exists = path_is_valid(left_thumbnail_path); /* Set task title */ task_free_title(task); - if (menu_thumbnail_get_label(pl_thumb->thumbnail_path_data, &label)) + if (gfx_thumbnail_get_label(pl_thumb->thumbnail_path_data, &label)) task_set_title(task, strdup(label)); else task_set_title(task, strdup(""));