mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
(VC Context driver) Style nits/cleanups
This commit is contained in:
parent
ff398fe6c8
commit
644d52b6ab
@ -136,25 +136,26 @@ static void gfx_ctx_vc_get_video_size(void *data,
|
|||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
(void)data;
|
(void)data;
|
||||||
// Use dispmanx upscaling if fullscreen_x and fullscreen_y are set.
|
/* Use dispmanx upscaling if
|
||||||
|
* fullscreen_x and fullscreen_y are set. */
|
||||||
|
|
||||||
if (settings->video.fullscreen_x != 0 &&
|
if (settings->video.fullscreen_x != 0 &&
|
||||||
settings->video.fullscreen_y != 0)
|
settings->video.fullscreen_y != 0)
|
||||||
{
|
{
|
||||||
// Keep input and output aspect ratio equal.
|
/* Keep input and output aspect ratio equal.
|
||||||
// There are other aspect ratio settings which can be used to stretch video output.
|
* There are other aspect ratio settings
|
||||||
// --------------------------------------------------------------------------------
|
* which can be used to stretch video output. */
|
||||||
// Calculate source and destination aspect ratios.
|
|
||||||
|
/* Calculate source and destination aspect ratios. */
|
||||||
|
|
||||||
float srcAspect = (float)settings->video.fullscreen_x / (float)settings->video.fullscreen_y;
|
float srcAspect = (float)settings->video.fullscreen_x / (float)settings->video.fullscreen_y;
|
||||||
float dstAspect = (float)g_fb_width / (float)g_fb_height;
|
float dstAspect = (float)g_fb_width / (float)g_fb_height;
|
||||||
// If source and destination aspect ratios are not equal correct source width.
|
|
||||||
|
/* If source and destination aspect ratios are not equal correct source width. */
|
||||||
if (srcAspect != dstAspect)
|
if (srcAspect != dstAspect)
|
||||||
{
|
|
||||||
*width = (unsigned)(settings->video.fullscreen_y * dstAspect);
|
*width = (unsigned)(settings->video.fullscreen_y * dstAspect);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
*width = settings->video.fullscreen_x;
|
*width = settings->video.fullscreen_x;
|
||||||
}
|
|
||||||
*height = settings->video.fullscreen_y;
|
*height = settings->video.fullscreen_y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -246,17 +247,18 @@ static bool gfx_ctx_vc_init(void *data)
|
|||||||
src_rect.x = 0;
|
src_rect.x = 0;
|
||||||
src_rect.y = 0;
|
src_rect.y = 0;
|
||||||
|
|
||||||
// Use dispmanx upscaling if fullscreen_x and fullscreen_y are set.
|
/* Use dispmanx upscaling if fullscreen_x
|
||||||
|
* and fullscreen_y are set. */
|
||||||
if (settings->video.fullscreen_x != 0 &&
|
if (settings->video.fullscreen_x != 0 &&
|
||||||
settings->video.fullscreen_y != 0)
|
settings->video.fullscreen_y != 0)
|
||||||
{
|
{
|
||||||
// Keep input and output aspect ratio equal.
|
/* Keep input and output aspect ratio equal.
|
||||||
// There are other aspect ratio settings which can be used to stretch video output.
|
* There are other aspect ratio settings which can be used to stretch video output. */
|
||||||
// --------------------------------------------------------------------------------
|
|
||||||
// Calculate source and destination aspect ratios.
|
/* Calculate source and destination aspect ratios. */
|
||||||
float srcAspect = (float)settings->video.fullscreen_x / (float)settings->video.fullscreen_y;
|
float srcAspect = (float)settings->video.fullscreen_x / (float)settings->video.fullscreen_y;
|
||||||
float dstAspect = (float)g_fb_width / (float)g_fb_height;
|
float dstAspect = (float)g_fb_width / (float)g_fb_height;
|
||||||
// If source and destination aspect ratios are not equal correct source width.
|
/* If source and destination aspect ratios are not equal correct source width. */
|
||||||
if (srcAspect != dstAspect)
|
if (srcAspect != dstAspect)
|
||||||
src_rect.width = (unsigned)(settings->video.fullscreen_y * dstAspect) << 16;
|
src_rect.width = (unsigned)(settings->video.fullscreen_y * dstAspect) << 16;
|
||||||
else
|
else
|
||||||
@ -283,17 +285,21 @@ static bool gfx_ctx_vc_init(void *data)
|
|||||||
&src_rect, DISPMANX_PROTECTION_NONE, &alpha, 0 /*clamp*/, DISPMANX_NO_ROTATE);
|
&src_rect, DISPMANX_PROTECTION_NONE, &alpha, 0 /*clamp*/, DISPMANX_NO_ROTATE);
|
||||||
|
|
||||||
nativewindow.element = dispman_element;
|
nativewindow.element = dispman_element;
|
||||||
// Use dispmanx upscaling if fullscreen_x and fullscreen_y are set.
|
|
||||||
|
/* Use dispmanx upscaling if fullscreen_x and fullscreen_y are set. */
|
||||||
|
|
||||||
if (settings->video.fullscreen_x != 0 &&
|
if (settings->video.fullscreen_x != 0 &&
|
||||||
settings->video.fullscreen_y != 0)
|
settings->video.fullscreen_y != 0)
|
||||||
{
|
{
|
||||||
// Keep input and output aspect ratio equal.
|
/* Keep input and output aspect ratio equal.
|
||||||
// There are other aspect ratio settings which can be used to stretch video output.
|
* There are other aspect ratio settings which
|
||||||
// --------------------------------------------------------------------------------
|
* can be used to stretch video output. */
|
||||||
// Calculate source and destination aspect ratios.
|
|
||||||
|
/* Calculate source and destination aspect ratios. */
|
||||||
float srcAspect = (float)settings->video.fullscreen_x / (float)settings->video.fullscreen_y;
|
float srcAspect = (float)settings->video.fullscreen_x / (float)settings->video.fullscreen_y;
|
||||||
float dstAspect = (float)g_fb_width / (float)g_fb_height;
|
float dstAspect = (float)g_fb_width / (float)g_fb_height;
|
||||||
// If source and destination aspect ratios are not equal correct source width.
|
|
||||||
|
/* If source and destination aspect ratios are not equal correct source width. */
|
||||||
if (srcAspect != dstAspect)
|
if (srcAspect != dstAspect)
|
||||||
nativewindow.width = (unsigned)(settings->video.fullscreen_y * dstAspect);
|
nativewindow.width = (unsigned)(settings->video.fullscreen_y * dstAspect);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user