From debbd9f15bb6da91f13c77d7e11c499bfca0d430 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 3 Feb 2020 22:47:26 +0100 Subject: [PATCH] Remove unused menu_display_pixel_get_scale --- menu/menu_driver.c | 39 --------------------------------------- menu/menu_driver.h | 1 - 2 files changed, 40 deletions(-) diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 86b7930786..505573c10a 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -2044,45 +2044,6 @@ void menu_display_unset_framebuffer_dirty_flag(void) menu_display_framebuf_dirty = false; } -float menu_display_get_pixel_scale(unsigned width, unsigned height) -{ - static unsigned last_width = 0; - static unsigned last_height = 0; - static float scale = 0.0f; - static bool scale_cached = false; - settings_t *settings = config_get_ptr(); - - /* We need to perform a square root here, which - * can be slow on some platforms (not *slow*, but - * it involves enough work that it's worth trying - * 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)) - { - /* Baseline reference is a 1080p display */ - scale = (float)( - sqrt((double)((width * width) + (height * height))) / - DIAGONAL_PIXELS_1080P); - - scale_cached = true; - last_width = width; - last_height = height; - } - - /* Apply user scaling factor */ - if (settings) - { - float menu_scale_factor = settings->floats.menu_scale_factor; - return scale * ((menu_scale_factor > 0.0001f) ? - menu_scale_factor : 1.0f); - } - - return scale; -} - float menu_display_get_dpi_scale(unsigned width, unsigned height) { static unsigned last_width = 0; diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 1537ecf636..b25593343c 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -594,7 +594,6 @@ void menu_display_unset_viewport(unsigned width, unsigned height); bool menu_display_get_framebuffer_dirty_flag(void); void menu_display_set_framebuffer_dirty_flag(void); void menu_display_unset_framebuffer_dirty_flag(void); -float menu_display_get_pixel_scale(unsigned width, unsigned height); float menu_display_get_dpi_scale(unsigned width, unsigned height); bool menu_display_init_first_driver(bool video_is_threaded); bool menu_display_restore_clear_color(void);