diff options
| author | Stenzek <stenzek@users.noreply.github.com> | 2018-01-29 17:28:44 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-29 17:28:44 +1000 |
| commit | fe5150cc3195f6350c6726c46573ef3406d093eb (patch) | |
| tree | 71a8d183cce92d6b96806b3ef498975cbd24a5c1 /Source/Core/VideoCommon/RenderBase.cpp | |
| parent | f3826b4e9224b61119c72efcda808f7c07e58a72 (diff) | |
| parent | ab6f9323471d75b9d0cca191e7199b1a3b1ae137 (diff) | |
Merge pull request #6303 from TraceBullet/auto-adjust-window-size
Fix Auto-Adjust Window Size option making the window too large
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/RenderBase.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.cpp b/Source/Core/VideoCommon/RenderBase.cpp index 410330709f..2f60e7d61c 100644 --- a/Source/Core/VideoCommon/RenderBase.cpp +++ b/Source/Core/VideoCommon/RenderBase.cpp @@ -523,10 +523,6 @@ void Renderer::UpdateDrawRectangle() void Renderer::SetWindowSize(int width, int height) { - // Scale the window size by the EFB scale. - if (g_ActiveConfig.iEFBScale != EFB_SCALE_AUTO_INTEGRAL) - std::tie(width, height) = CalculateTargetScale(width, height); - std::tie(width, height) = CalculateOutputDimensions(width, height); // Track the last values of width/height to avoid sending a window resize event every frame. @@ -643,11 +639,12 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const if (xfb_entry && xfb_entry->id != m_last_xfb_id) { + const TextureConfig& texture_config = xfb_entry->texture->GetConfig(); m_last_xfb_texture = xfb_entry->texture.get(); m_last_xfb_id = xfb_entry->id; m_last_xfb_ticks = ticks; - auto xfb_rect = xfb_entry->texture->GetConfig().GetRect(); + auto xfb_rect = texture_config.GetRect(); xfb_rect.right -= EFBToScaledX(fbStride - fbWidth); m_last_xfb_region = xfb_rect; @@ -655,6 +652,10 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, const // TODO: merge more generic parts into VideoCommon g_renderer->SwapImpl(xfb_entry->texture.get(), xfb_rect, ticks, xfb_entry->gamma); + // Update the window size based on the frame that was just rendered. + // Due to depending on guest state, we need to call this every frame. + SetWindowSize(texture_config.width, texture_config.height); + m_fps_counter.Update(); if (IsFrameDumping()) |
