mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Simplify some code in gfx_display.c
This commit is contained in:
parent
976d7b8067
commit
3b823d18d5
@ -123,7 +123,7 @@ static gfx_display_ctx_driver_t *gfx_display_ctx_drivers[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
float gfx_display_get_adjusted_scale(
|
||||
static float gfx_display_get_adjusted_scale(
|
||||
gfx_display_t *p_disp,
|
||||
float base_scale, float scale_factor, unsigned width)
|
||||
{
|
||||
|
@ -308,10 +308,6 @@ bool gfx_display_reset_textures_list_buffer(
|
||||
int gfx_display_osk_ptr_at_pos(void *data, int x, int y,
|
||||
unsigned width, unsigned height);
|
||||
|
||||
float gfx_display_get_adjusted_scale(
|
||||
gfx_display_t *p_disp,
|
||||
float base_scale, float scale_factor, unsigned width);
|
||||
|
||||
float gfx_display_get_dpi_scale(
|
||||
gfx_display_t *p_disp,
|
||||
void *settings_data,
|
||||
|
@ -139,9 +139,9 @@ static float gfx_display_get_widget_pixel_scale(
|
||||
* to optimise). We therefore cache the pixel scale,
|
||||
* and only update on first run or when the video
|
||||
* size changes */
|
||||
if (!scale_cached ||
|
||||
(width != last_width) ||
|
||||
(height != last_height))
|
||||
if ( !scale_cached
|
||||
|| (width != last_width)
|
||||
|| (height != last_height))
|
||||
{
|
||||
/* Baseline reference is a 1080p display */
|
||||
scale = (float)(
|
||||
@ -156,13 +156,12 @@ static float gfx_display_get_widget_pixel_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,
|
||||
scale, menu_scale_factor, width);
|
||||
adjusted_scale = scale * menu_scale_factor;
|
||||
adjusted_scale = (adjusted_scale > 0.0001f) ? adjusted_scale : 1.0f;
|
||||
last_menu_scale_factor = menu_scale_factor;
|
||||
last_menu_driver_id = p_disp->menu_driver_id;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user