- pull most recent video scale changes from gzdoom

This commit is contained in:
Rachael Alexanderson 2020-01-01 23:42:09 -05:00
parent 6a17e3910b
commit 21ba23f36d
6 changed files with 91 additions and 62 deletions

View file

@ -254,16 +254,8 @@ void DFrameBuffer::SetViewportRects(IntRect *bounds)
int screenWidth = GetWidth();
int screenHeight = GetHeight();
float scaleX, scaleY;
if (ViewportIsScaled43())
{
scaleX = std::min(clientWidth / (float)screenWidth, clientHeight / (screenHeight * 1.2f));
scaleY = scaleX * 1.2f;
}
else
{
scaleX = std::min(clientWidth / (float)screenWidth, clientHeight / (float)screenHeight);
scaleY = scaleX;
}
scaleX = std::min(clientWidth / (float)screenWidth, clientHeight / ((float)screenHeight * ViewportPixelAspect()));
scaleY = scaleX * ViewportPixelAspect();
mOutputLetterbox.width = (int)round(screenWidth * scaleX);
mOutputLetterbox.height = (int)round(screenHeight * scaleY);
mOutputLetterbox.left = (clientWidth - mOutputLetterbox.width) / 2;
@ -284,7 +276,7 @@ void DFrameBuffer::SetViewportRects(IntRect *bounds)
// Scale viewports to fit letterbox
bool notScaled = ((mScreenViewport.width == ViewportScaledWidth(mScreenViewport.width, mScreenViewport.height)) &&
(mScreenViewport.width == ViewportScaledHeight(mScreenViewport.width, mScreenViewport.height)) &&
!ViewportIsScaled43());
(ViewportPixelAspect() == 1.0));
if (gl_scale_viewport && !IsFullscreen() && notScaled)
{
mScreenViewport.width = mOutputLetterbox.width;