This commit is contained in:
libretroadmin 2023-05-08 00:08:44 +02:00
parent ced83c41e6
commit baba57c10a
3 changed files with 56 additions and 64 deletions

View File

@ -192,9 +192,9 @@ float gfx_display_get_dpi_scale_internal(
static bool scale_cached = false;
gfx_ctx_metrics_t metrics;
if (scale_cached &&
(width == last_width) &&
(height == last_height))
if ( scale_cached
&& (width == last_width)
&& (height == last_height))
return scale;
/* Determine the diagonal 'size' of the display
@ -371,8 +371,7 @@ float gfx_display_get_dpi_scale(
else
#endif
{
float _menu_scale_factor =
settings->floats.menu_scale_factor;
float _menu_scale_factor = settings->floats.menu_scale_factor;
menu_scale_factor = _menu_scale_factor;
}
}
@ -383,9 +382,9 @@ float gfx_display_get_dpi_scale(
* hardware property. To minimise performance overheads
* we therefore only call video_context_driver_get_metrics()
* on first run, or when the current video resolution changes */
if (!scale_cached ||
(width != last_width) ||
(height != last_height))
if ( !scale_cached
|| (width != last_width)
|| (height != last_height))
{
scale = gfx_display_get_dpi_scale_internal(width, height);
scale_cached = true;
@ -396,9 +395,9 @@ float gfx_display_get_dpi_scale(
/* Adjusted scale calculation may also be slow, so
* only update if something changes */
if (scale_updated ||
(menu_scale_factor != last_menu_scale_factor) ||
(p_disp->menu_driver_id != last_menu_driver_id))
if ( scale_updated
|| (menu_scale_factor != last_menu_scale_factor)
|| (p_disp->menu_driver_id != last_menu_driver_id))
{
adjusted_scale = gfx_display_get_adjusted_scale(
p_disp,
@ -496,8 +495,8 @@ void gfx_display_draw_text(
return;
/* Don't draw outside of the screen */
if (!draw_outside &&
((x < -64 || x > width + 64)
if ( !draw_outside
&& ((x < -64 || x > width + 64)
|| (y < -64 || y > height + 64))
)
return;

View File

@ -271,23 +271,18 @@ bool gfx_thumbnail_set_system(gfx_thumbnail_path_data_t *path_data,
if (playlist)
{
const char *playlist_path = playlist_get_conf_path(playlist);
const char *playlist_file = NULL;
bool playlist_valid = false;
/* Note: This is not considered an error
* (just means that input playlist is ignored) */
if (string_is_empty(playlist_path))
return true;
playlist_file = path_basename_nocompression(playlist_path);
if (!string_is_empty(playlist_path))
{
const char *playlist_file = path_basename_nocompression(playlist_path);
/* Note: This is not considered an error
* (just means that input playlist is ignored) */
if (string_is_empty(playlist_file))
return true;
if (!string_is_empty(playlist_file))
{
/* Check for history/favourites playlists */
playlist_valid =
bool playlist_valid =
(string_is_equal(system, "history") &&
string_is_equal(playlist_file,
FILE_PATH_CONTENT_HISTORY)) ||
@ -316,6 +311,8 @@ bool gfx_thumbnail_set_system(gfx_thumbnail_path_data_t *path_data,
playlist_get_thumbnail_mode(playlist, PLAYLIST_THUMBNAIL_LEFT);
}
}
}
}
return true;
}

View File

@ -424,8 +424,8 @@ static void gfx_widgets_move_end(void *userdata)
gfx_animation_push(&entry);
unfold->flags |= DISPWIDG_FLAG_UNFOLDED;
unfold->flags |= DISPWIDG_FLAG_UNFOLDING;
unfold->flags |= DISPWIDG_FLAG_UNFOLDED
| DISPWIDG_FLAG_UNFOLDING;
}
else
p_dispwidget->flags &= ~DISPGFX_WIDGET_FLAG_MOVING;
@ -1185,7 +1185,7 @@ static void gfx_widgets_draw_task_msg(
if (msg->flags & DISPWIDG_FLAG_TASK_FINISHED)
{
if (msg->flags & DISPWIDG_FLAG_TASK_ERROR)
if (msg->flags & DISPWIDG_FLAG_TASK_ERROR) /* TODO/FIXME - localize */
strlcpy(task_percentage, "Task failed", sizeof(task_percentage));
else
{
@ -1266,11 +1266,7 @@ static void gfx_widgets_draw_task_msg(
float cosine = 1.0f; /* cos(rad) = cos(0) = 1.0f */
float sine = 0.0f; /* sine(rad) = sine(0) = 0.0f */
if (!(msg->flags & DISPWIDG_FLAG_TASK_FINISHED))
{
radians = msg->hourglass_rotation;
cosine = cosf(radians);
sine = sinf(radians);
}
gfx_widgets_draw_icon(
userdata,
p_disp,