Skip to content

Commit

Permalink
Savestate thumbnail fixes (#15869)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonninnos authored Nov 5, 2023
1 parent e35afdb commit 1a97b0e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 27 deletions.
15 changes: 7 additions & 8 deletions menu/drivers/ozone.c
Original file line number Diff line number Diff line change
Expand Up @@ -3612,8 +3612,8 @@ static void ozone_update_savestate_thumbnail_path(void *data, unsigned i)

/* Savestate thumbnails are only relevant
* when viewing the running quick menu or state slots */
if (!( (ozone->is_quick_menu && menu_is_running_quick_menu())
|| (ozone->flags & OZONE_FLAG_IS_STATE_SLOT)))
if (!( (ozone->is_quick_menu && menu_is_running_quick_menu())
|| (ozone->flags & OZONE_FLAG_IS_STATE_SLOT)))
return;

if (savestate_thumbnail)
Expand Down Expand Up @@ -3694,13 +3694,8 @@ static void ozone_update_savestate_thumbnail_image(void *data)
settings_t *settings = config_get_ptr();
unsigned thumbnail_upscale_threshold
= settings->uints.gfx_thumbnail_upscale_threshold;
if ((!ozone) || (ozone->flags & OZONE_FLAG_SKIP_THUMBNAIL_RESET))
return;

/* Savestate thumbnails are only relevant
* when viewing the running quick menu or state slots */
if (!((ozone->is_quick_menu && menu_is_running_quick_menu())
|| (ozone->flags & OZONE_FLAG_IS_STATE_SLOT)))
if ((!ozone) || (ozone->flags & OZONE_FLAG_SKIP_THUMBNAIL_RESET))
return;

/* If path is empty, just reset thumbnail */
Expand Down Expand Up @@ -11958,6 +11953,10 @@ static void ozone_populate_entries(
if (ozone->categories_selection_ptr == ozone->categories_active_idx_old)
ozone_list_open(ozone, ozone_collapse_sidebar, (!(ozone->flags & OZONE_FLAG_FIRST_FRAME)));

/* Reset savestate thumbnails always */
ozone_update_savestate_thumbnail_path(ozone, (unsigned)menu_st->selection_ptr);
ozone_update_savestate_thumbnail_image(ozone);

/* Thumbnails
* > Note: Leave current thumbnails loaded when
* opening the quick menu - allows proper fade
Expand Down
21 changes: 7 additions & 14 deletions menu/drivers/rgui.c
Original file line number Diff line number Diff line change
Expand Up @@ -6929,6 +6929,9 @@ static void rgui_reset_savestate_thumbnail(void *data)
{
rgui_t *rgui = (rgui_t*)data;

if (string_is_empty(rgui->savestate_thumbnail_file_path))
return;

rgui->mini_left_thumbnail.width = 0;
rgui->mini_left_thumbnail.height = 0;
rgui->mini_left_thumbnail.is_valid = false;
Expand All @@ -6941,12 +6944,6 @@ static void rgui_update_savestate_thumbnail_image(void *data)
if (!rgui)
return;

/* Savestate thumbnails are only relevant
* when viewing the running quick menu or state slots */
if (!( (rgui->is_quick_menu && menu_is_running_quick_menu())
|| (rgui->flags & RGUI_FLAG_IS_STATE_SLOT)))
return;

/* If path is empty, just reset thumbnail */
if (string_is_empty(rgui->savestate_thumbnail_file_path))
rgui_reset_savestate_thumbnail(rgui);
Expand Down Expand Up @@ -7041,15 +7038,11 @@ static void rgui_scan_selected_entry_thumbnail(rgui_t *rgui, bool force_load)
has_thumbnail = gfx_thumbnail_update_path(menu_st->thumbnail_path_data, GFX_THUMBNAIL_LEFT) || has_thumbnail;
}

/* Save state thumbnails */
if ( (rgui->is_quick_menu)
|| (rgui->flags & RGUI_FLAG_IS_STATE_SLOT))
/* Reset savestate thumbnails always */
if (selection < list_size)
{
if (selection < list_size)
{
rgui_update_savestate_thumbnail_path(rgui, (unsigned)selection);
rgui_update_savestate_thumbnail_image(rgui);
}
rgui_update_savestate_thumbnail_path(rgui, (unsigned)selection);
rgui_update_savestate_thumbnail_image(rgui);
}

/* Check whether thumbnails should be loaded */
Expand Down
5 changes: 0 additions & 5 deletions menu/drivers/xmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,11 +1480,6 @@ static void xmb_update_savestate_thumbnail_image(void *data)
if (!xmb || xmb->skip_thumbnail_reset)
return;

/* Savestate thumbnails are only relevant
* when viewing the running quick menu or state slots */
if (!((xmb->is_quick_menu && menu_is_running_quick_menu()) || xmb->is_state_slot))
return;

/* If path is empty, just reset thumbnail */
if (string_is_empty(xmb->savestate_thumbnail_file_path))
gfx_thumbnail_reset(&xmb->thumbnails.savestate);
Expand Down

0 comments on commit 1a97b0e

Please sign in to comment.