Permalink
Browse files

GPU: Correct 1080p/720p crop for ultrawide/similar.

If the display is 1280x1080 or 2560x1080, we don't want to stretch width.
  • Loading branch information...
unknownbrackets committed Jul 30, 2017
1 parent 626102e commit d6affac72d74e3250c817a19510dcc755b6978ae
Showing with 4 additions and 3 deletions.
  1. +4 −3 GPU/Common/FramebufferCommon.cpp
@@ -72,12 +72,13 @@ void CenterDisplayOutputRect(float *x, float *y, float *w, float *h, float origW
return;
}
} else if (g_Config.iSmallDisplayZoomType == 2) { // Auto Scaling
// Stretch to 1080 for 272*4. But don't distort if not widescreen (i.e. ultrawide of halfwide.)
float pixelCrop = frameH / 270.0f;
float resCommonWidescreen = pixelCrop - floor(pixelCrop);
if (!rotated && resCommonWidescreen == 0.0f) {
*x = 0;
if (!rotated && resCommonWidescreen == 0.0f && frameW >= pixelCrop * 480.0f) {
*x = floorf((frameW - pixelCrop * 480.0f) * 0.5f);
*y = floorf(-pixelCrop);
*w = floorf(frameW);
*w = floorf(pixelCrop * 480.0f);
*h = floorf(pixelCrop * 272.0f);
return;
}

0 comments on commit d6affac

Please sign in to comment.