mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-02 02:01:31 +00:00
- pull most recent video scale changes from gzdoom
This commit is contained in:
parent
6a17e3910b
commit
21ba23f36d
6 changed files with 91 additions and 62 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue