mirror of
https://github.com/libretro/RetroArch
synced 2025-04-11 00:44:20 +00:00
ozone: fix crash
This commit is contained in:
parent
35be34eb32
commit
53268540f8
@ -1403,8 +1403,6 @@ static void ozone_selection_changed(ozone_handle_t *ozone, bool allow_animation)
|
|||||||
|
|
||||||
if (ozone->selection != new_selection)
|
if (ozone->selection != new_selection)
|
||||||
{
|
{
|
||||||
ozone_node_t *node = NULL;
|
|
||||||
|
|
||||||
ozone->selection_old = ozone->selection;
|
ozone->selection_old = ozone->selection;
|
||||||
ozone->selection = new_selection;
|
ozone->selection = new_selection;
|
||||||
|
|
||||||
@ -1414,79 +1412,73 @@ static void ozone_selection_changed(ozone_handle_t *ozone, bool allow_animation)
|
|||||||
ozone_update_scroll(ozone, allow_animation, node);
|
ozone_update_scroll(ozone, allow_animation, node);
|
||||||
|
|
||||||
/* Update thumbnail */
|
/* Update thumbnail */
|
||||||
node = (ozone_node_t*)
|
if (!string_is_equal(thumb_ident,
|
||||||
file_list_get_userdata_at_offset(selection_buf, ozone->selection);
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)) || !string_is_equal(left_thumb_ident,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
||||||
if (node)
|
|
||||||
{
|
{
|
||||||
if (!string_is_equal(thumb_ident,
|
menu_entry_t entry;
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)) || !string_is_equal(left_thumb_ident,
|
unsigned entry_type;
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
unsigned i = ozone->selection;
|
||||||
|
|
||||||
|
menu_entry_init(&entry);
|
||||||
|
menu_entry_get(&entry, 0, (unsigned)i, NULL, true);
|
||||||
|
entry_type = menu_entry_get_type_new(&entry);
|
||||||
|
|
||||||
|
if (ozone->is_playlist && ozone->depth == 1)
|
||||||
{
|
{
|
||||||
menu_entry_t entry;
|
if (!string_is_empty(entry.path))
|
||||||
unsigned entry_type;
|
ozone_set_thumbnail_content(ozone, entry.path);
|
||||||
unsigned i = ozone->selection;
|
if (!string_is_equal(thumb_ident,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
||||||
menu_entry_init(&entry);
|
|
||||||
menu_entry_get(&entry, 0, (unsigned)i, NULL, true);
|
|
||||||
entry_type = menu_entry_get_type_new(&entry);
|
|
||||||
|
|
||||||
if (ozone->is_playlist && ozone->depth == 1)
|
|
||||||
{
|
{
|
||||||
if (!string_is_empty(entry.path))
|
ozone_update_thumbnail_path(ozone, i, 'R');
|
||||||
ozone_set_thumbnail_content(ozone, entry.path);
|
ozone_update_thumbnail_image(ozone);
|
||||||
if (!string_is_equal(thumb_ident,
|
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
||||||
{
|
|
||||||
ozone_update_thumbnail_path(ozone, i, 'R');
|
|
||||||
ozone_update_thumbnail_image(ozone);
|
|
||||||
}
|
|
||||||
if (!string_is_equal(left_thumb_ident,
|
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
||||||
{
|
|
||||||
ozone_update_thumbnail_path(ozone, i, 'L');
|
|
||||||
ozone_update_thumbnail_image(ozone);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (((entry_type == FILE_TYPE_IMAGE || entry_type == FILE_TYPE_IMAGEVIEWER ||
|
if (!string_is_equal(left_thumb_ident,
|
||||||
entry_type == FILE_TYPE_RDB || entry_type == FILE_TYPE_RDB_ENTRY)
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
||||||
&& ozone->tabs[ozone->categories_selection_ptr] <= OZONE_SYSTEM_TAB_SETTINGS))
|
|
||||||
{
|
{
|
||||||
if (!string_is_empty(entry.path))
|
ozone_update_thumbnail_path(ozone, i, 'L');
|
||||||
ozone_set_thumbnail_content(ozone, entry.path);
|
ozone_update_thumbnail_image(ozone);
|
||||||
if (!string_is_equal(thumb_ident,
|
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
||||||
{
|
|
||||||
ozone_update_thumbnail_path(ozone, i, 'R');
|
|
||||||
ozone_update_thumbnail_image(ozone);
|
|
||||||
}
|
|
||||||
else if (!string_is_equal(left_thumb_ident,
|
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
||||||
{
|
|
||||||
ozone_update_thumbnail_path(ozone, i, 'L');
|
|
||||||
ozone_update_thumbnail_image(ozone);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (filebrowser_get_type() != FILEBROWSER_NONE)
|
|
||||||
{
|
|
||||||
ozone_reset_thumbnail_content(ozone);
|
|
||||||
if (!string_is_equal(thumb_ident,
|
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
||||||
{
|
|
||||||
ozone_update_thumbnail_path(ozone, i, 'R');
|
|
||||||
ozone_update_thumbnail_image(ozone);
|
|
||||||
}
|
|
||||||
else if (!string_is_equal(left_thumb_ident,
|
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
|
||||||
{
|
|
||||||
ozone_update_thumbnail_path(ozone, i, 'L');
|
|
||||||
ozone_update_thumbnail_image(ozone);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
menu_entry_free(&entry);
|
|
||||||
}
|
}
|
||||||
/* TODO: Update savestate thumbnail */
|
else if (((entry_type == FILE_TYPE_IMAGE || entry_type == FILE_TYPE_IMAGEVIEWER ||
|
||||||
|
entry_type == FILE_TYPE_RDB || entry_type == FILE_TYPE_RDB_ENTRY)
|
||||||
|
&& ozone->tabs[ozone->categories_selection_ptr] <= OZONE_SYSTEM_TAB_SETTINGS))
|
||||||
|
{
|
||||||
|
if (!string_is_empty(entry.path))
|
||||||
|
ozone_set_thumbnail_content(ozone, entry.path);
|
||||||
|
if (!string_is_equal(thumb_ident,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
||||||
|
{
|
||||||
|
ozone_update_thumbnail_path(ozone, i, 'R');
|
||||||
|
ozone_update_thumbnail_image(ozone);
|
||||||
|
}
|
||||||
|
else if (!string_is_equal(left_thumb_ident,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
||||||
|
{
|
||||||
|
ozone_update_thumbnail_path(ozone, i, 'L');
|
||||||
|
ozone_update_thumbnail_image(ozone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (filebrowser_get_type() != FILEBROWSER_NONE)
|
||||||
|
{
|
||||||
|
ozone_reset_thumbnail_content(ozone);
|
||||||
|
if (!string_is_equal(thumb_ident,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
||||||
|
{
|
||||||
|
ozone_update_thumbnail_path(ozone, i, 'R');
|
||||||
|
ozone_update_thumbnail_image(ozone);
|
||||||
|
}
|
||||||
|
else if (!string_is_equal(left_thumb_ident,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF)))
|
||||||
|
{
|
||||||
|
ozone_update_thumbnail_path(ozone, i, 'L');
|
||||||
|
ozone_update_thumbnail_image(ozone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
menu_entry_free(&entry);
|
||||||
}
|
}
|
||||||
|
/* TODO: Update savestate thumbnail */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user