From 524f202231b6b67ff4923115bf154d33f6fd3912 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 12 Aug 2019 13:04:08 +0200 Subject: [PATCH] Turn two functions static --- retroarch.c | 118 ++++++++++++++++++++++++++-------------------------- retroarch.h | 4 -- 2 files changed, 59 insertions(+), 63 deletions(-) diff --git a/retroarch.c b/retroarch.c index a1637370b1..79da380607 100644 --- a/retroarch.c +++ b/retroarch.c @@ -16749,6 +16749,65 @@ error: return false; } +static void video_driver_set_viewport_config(void) +{ + settings_t *settings = configuration_settings; + + if (settings->floats.video_aspect_ratio < 0.0f) + { + struct retro_game_geometry *geom = &video_driver_av_info.geometry; + + if (geom->aspect_ratio > 0.0f && + settings->bools.video_aspect_ratio_auto) + aspectratio_lut[ASPECT_RATIO_CONFIG].value = geom->aspect_ratio; + else + { + unsigned base_width = geom->base_width; + unsigned base_height = geom->base_height; + + /* Get around division by zero errors */ + if (base_width == 0) + base_width = 1; + if (base_height == 0) + base_height = 1; + aspectratio_lut[ASPECT_RATIO_CONFIG].value = + (float)base_width / base_height; /* 1:1 PAR. */ + } + } + else + aspectratio_lut[ASPECT_RATIO_CONFIG].value = + settings->floats.video_aspect_ratio; +} + +static void video_driver_set_viewport_square_pixel(void) +{ + unsigned len, highest, i, aspect_x, aspect_y; + struct retro_game_geometry *geom = &video_driver_av_info.geometry; + unsigned width = geom->base_width; + unsigned height = geom->base_height; + + if (width == 0 || height == 0) + return; + + len = MIN(width, height); + highest = 1; + + for (i = 1; i < len; i++) + { + if ((width % i) == 0 && (height % i) == 0) + highest = i; + } + + aspect_x = width / highest; + aspect_y = height / highest; + + snprintf(aspectratio_lut[ASPECT_RATIO_SQUARE].name, + sizeof(aspectratio_lut[ASPECT_RATIO_SQUARE].name), + "1:1 PAR (%u:%u DAR)", aspect_x, aspect_y); + + aspectratio_lut[ASPECT_RATIO_SQUARE].value = (float)aspect_x / aspect_y; +} + static bool video_driver_init_internal(bool *video_is_threaded) { video_info_t video; @@ -17332,65 +17391,6 @@ bool video_driver_supports_read_frame_raw(void) return false; } -void video_driver_set_viewport_config(void) -{ - settings_t *settings = configuration_settings; - - if (settings->floats.video_aspect_ratio < 0.0f) - { - struct retro_game_geometry *geom = &video_driver_av_info.geometry; - - if (geom->aspect_ratio > 0.0f && - settings->bools.video_aspect_ratio_auto) - aspectratio_lut[ASPECT_RATIO_CONFIG].value = geom->aspect_ratio; - else - { - unsigned base_width = geom->base_width; - unsigned base_height = geom->base_height; - - /* Get around division by zero errors */ - if (base_width == 0) - base_width = 1; - if (base_height == 0) - base_height = 1; - aspectratio_lut[ASPECT_RATIO_CONFIG].value = - (float)base_width / base_height; /* 1:1 PAR. */ - } - } - else - aspectratio_lut[ASPECT_RATIO_CONFIG].value = - settings->floats.video_aspect_ratio; -} - -void video_driver_set_viewport_square_pixel(void) -{ - unsigned len, highest, i, aspect_x, aspect_y; - struct retro_game_geometry *geom = &video_driver_av_info.geometry; - unsigned width = geom->base_width; - unsigned height = geom->base_height; - - if (width == 0 || height == 0) - return; - - len = MIN(width, height); - highest = 1; - - for (i = 1; i < len; i++) - { - if ((width % i) == 0 && (height % i) == 0) - highest = i; - } - - aspect_x = width / highest; - aspect_y = height / highest; - - snprintf(aspectratio_lut[ASPECT_RATIO_SQUARE].name, - sizeof(aspectratio_lut[ASPECT_RATIO_SQUARE].name), - "1:1 PAR (%u:%u DAR)", aspect_x, aspect_y); - - aspectratio_lut[ASPECT_RATIO_SQUARE].value = (float)aspect_x / aspect_y; -} - void video_driver_set_viewport_core(void) { struct retro_game_geometry *geom = &video_driver_av_info.geometry; diff --git a/retroarch.h b/retroarch.h index 9fbcb8dbee..5275e68d9b 100644 --- a/retroarch.h +++ b/retroarch.h @@ -1553,10 +1553,6 @@ bool video_driver_prefer_viewport_read(void); bool video_driver_supports_read_frame_raw(void); -void video_driver_set_viewport_config(void); - -void video_driver_set_viewport_square_pixel(void); - void video_driver_set_viewport_core(void); void video_driver_reset_custom_viewport(void);