From e699f7e46e770307f15fd5bc01e19f7bc0643b86 Mon Sep 17 00:00:00 2001 From: gizmo98 Date: Sat, 3 Jan 2015 09:54:56 +0100 Subject: [PATCH] videocore: enable upscaling... ...if retroarch.cfg contains custom resolution. --- gfx/context/vc_egl_ctx.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/gfx/context/vc_egl_ctx.c b/gfx/context/vc_egl_ctx.c index 4ef19e288c..52d2b094c1 100644 --- a/gfx/context/vc_egl_ctx.c +++ b/gfx/context/vc_egl_ctx.c @@ -132,8 +132,15 @@ static void gfx_ctx_vc_get_video_size(void *data, unsigned *width, unsigned *height) { (void)data; - *width = g_fb_width; - *height = g_fb_height; + if (g_settings.video.fullscreen_x != 0 && + g_settings.video.fullscreen_y != 0) { + *width = g_settings.video.fullscreen_x; + *height = g_settings.video.fullscreen_y; + } + else { + *width = g_fb_width; + *height = g_fb_height; + } } static void gfx_ctx_vc_destroy(void *data); @@ -216,9 +223,15 @@ static bool gfx_ctx_vc_init(void *data) src_rect.x = 0; src_rect.y = 0; - src_rect.width = g_fb_width << 16; - src_rect.height = g_fb_height << 16; - + if (g_settings.video.fullscreen_x != 0 && + g_settings.video.fullscreen_y != 0) { + src_rect.width = g_settings.video.fullscreen_x << 16; + src_rect.height = g_settings.video.fullscreen_y << 16; + } + else { + src_rect.width = g_fb_width << 16; + src_rect.height = g_fb_height << 16; + } dispman_display = vc_dispmanx_display_open(0 /* LCD */); vc_dispmanx_display_get_info(dispman_display, &dispman_modeinfo); dispman_update = vc_dispmanx_update_start(0); @@ -233,8 +246,15 @@ static bool gfx_ctx_vc_init(void *data) &src_rect, DISPMANX_PROTECTION_NONE, &alpha, 0 /*clamp*/, DISPMANX_NO_ROTATE); nativewindow.element = dispman_element; - nativewindow.width = g_fb_width; - nativewindow.height = g_fb_height; + if (g_settings.video.fullscreen_x != 0 && + g_settings.video.fullscreen_y != 0) { + nativewindow.width = g_settings.video.fullscreen_x; + nativewindow.height = g_settings.video.fullscreen_y; + } + else { + nativewindow.width = g_fb_width; + nativewindow.height = g_fb_height; + } vc_dispmanx_update_submit_sync(dispman_update); g_egl_surf = eglCreateWindowSurface(g_egl_dpy, g_config, &nativewindow, NULL);