mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +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,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
float gfx_display_get_adjusted_scale(
|
static float gfx_display_get_adjusted_scale(
|
||||||
gfx_display_t *p_disp,
|
gfx_display_t *p_disp,
|
||||||
float base_scale, float scale_factor, unsigned width)
|
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,
|
int gfx_display_osk_ptr_at_pos(void *data, int x, int y,
|
||||||
unsigned width, unsigned height);
|
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(
|
float gfx_display_get_dpi_scale(
|
||||||
gfx_display_t *p_disp,
|
gfx_display_t *p_disp,
|
||||||
void *settings_data,
|
void *settings_data,
|
||||||
|
@ -139,9 +139,9 @@ static float gfx_display_get_widget_pixel_scale(
|
|||||||
* to optimise). We therefore cache the pixel scale,
|
* to optimise). We therefore cache the pixel scale,
|
||||||
* and only update on first run or when the video
|
* and only update on first run or when the video
|
||||||
* size changes */
|
* size changes */
|
||||||
if (!scale_cached ||
|
if ( !scale_cached
|
||||||
(width != last_width) ||
|
|| (width != last_width)
|
||||||
(height != last_height))
|
|| (height != last_height))
|
||||||
{
|
{
|
||||||
/* Baseline reference is a 1080p display */
|
/* Baseline reference is a 1080p display */
|
||||||
scale = (float)(
|
scale = (float)(
|
||||||
@ -156,13 +156,12 @@ static float gfx_display_get_widget_pixel_scale(
|
|||||||
|
|
||||||
/* Adjusted scale calculation may also be slow, so
|
/* Adjusted scale calculation may also be slow, so
|
||||||
* only update if something changes */
|
* only update if something changes */
|
||||||
if (scale_updated ||
|
if ( scale_updated
|
||||||
(menu_scale_factor != last_menu_scale_factor) ||
|
|| (menu_scale_factor != last_menu_scale_factor)
|
||||||
(p_disp->menu_driver_id != last_menu_driver_id))
|
|| (p_disp->menu_driver_id != last_menu_driver_id))
|
||||||
{
|
{
|
||||||
adjusted_scale = gfx_display_get_adjusted_scale(
|
adjusted_scale = scale * menu_scale_factor;
|
||||||
p_disp,
|
adjusted_scale = (adjusted_scale > 0.0001f) ? adjusted_scale : 1.0f;
|
||||||
scale, menu_scale_factor, width);
|
|
||||||
last_menu_scale_factor = menu_scale_factor;
|
last_menu_scale_factor = menu_scale_factor;
|
||||||
last_menu_driver_id = p_disp->menu_driver_id;
|
last_menu_driver_id = p_disp->menu_driver_id;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user