From 8d5d91a5a48a463b09e6f4e5122001347df038e7 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 5 Mar 2020 20:32:58 +0100 Subject: [PATCH] (GL1/GLCore) Only video_info dependency now is 'height' --- gfx/drivers/gl1.c | 14 ++++++++------ gfx/drivers/gl_core.c | 5 +++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/gfx/drivers/gl1.c b/gfx/drivers/gl1.c index 60eb6e4ee6..18e394a55d 100644 --- a/gfx/drivers/gl1.c +++ b/gfx/drivers/gl1.c @@ -472,6 +472,7 @@ void gl1_gfx_set_viewport(gl1_t *gl1, bool force_full, bool allow_rotate) { gfx_ctx_aspect_t aspect_data; + settings_t *settings = config_get_ptr(); int x = 0; int y = 0; float device_aspect = (float)viewport_width / viewport_height; @@ -483,7 +484,7 @@ void gl1_gfx_set_viewport(gl1_t *gl1, video_context_driver_translate_aspect(&aspect_data); - if (video_info->scale_integer && !force_full) + if (settings->bools.video_scale_integer && !force_full) { video_viewport_get_scaled_integer(&gl1->vp, viewport_width, viewport_height, @@ -496,13 +497,14 @@ void gl1_gfx_set_viewport(gl1_t *gl1, float desired_aspect = video_driver_get_aspect_ratio(); #if defined(HAVE_MENU) - if (video_info->aspect_ratio_idx == ASPECT_RATIO_CUSTOM) + if (settings->uints.video_aspect_ratio_idx == ASPECT_RATIO_CUSTOM) { + const struct video_viewport *custom = video_viewport_get_custom(); /* GL has bottom-left origin viewport. */ - x = video_info->custom_vp_x; - y = height - video_info->custom_vp_y - video_info->custom_vp_height; - viewport_width = video_info->custom_vp_width; - viewport_height = video_info->custom_vp_height; + x = custom->x; + y = height - custom->y - custom->height; + viewport_width = custom->width; + viewport_height = custom->height; } else #endif diff --git a/gfx/drivers/gl_core.c b/gfx/drivers/gl_core.c index 48e07f9d98..db0ab15ade 100644 --- a/gfx/drivers/gl_core.c +++ b/gfx/drivers/gl_core.c @@ -770,6 +770,7 @@ static void gl_core_set_viewport(gl_core_t *gl, gfx_ctx_aspect_t aspect_data; int x = 0; int y = 0; + settings_t *settings = config_get_ptr(); float device_aspect = (float)viewport_width / viewport_height; unsigned height = video_info->height; @@ -779,7 +780,7 @@ static void gl_core_set_viewport(gl_core_t *gl, video_context_driver_translate_aspect(&aspect_data); - if (video_info->scale_integer && !force_full) + if (settings->bools.video_scale_integer && !force_full) { video_viewport_get_scaled_integer(&gl->vp, viewport_width, viewport_height, @@ -792,7 +793,7 @@ static void gl_core_set_viewport(gl_core_t *gl, float desired_aspect = video_driver_get_aspect_ratio(); #if defined(HAVE_MENU) - if (video_info->aspect_ratio_idx == ASPECT_RATIO_CUSTOM) + if (settings->uints.video_aspect_ratio_idx == ASPECT_RATIO_CUSTOM) { const struct video_viewport *custom = video_viewport_get_custom(); /* GL has bottom-left origin viewport. */