diff options
| author | Jules Blok <jules.blok@gmail.com> | 2014-10-31 15:24:04 +0100 |
|---|---|---|
| committer | Jules Blok <jules.blok@gmail.com> | 2014-11-23 14:27:39 +0100 |
| commit | 0eb0c47eba57366bf80d7c69b3a07b5924102c1c (patch) | |
| tree | 8bcf897673f880ae7e4a87cea7848584efd85974 /Source/Core | |
| parent | d7804a4d3e9a5cbc5347148a0e37aa669e9e9e2b (diff) | |
Render: Improve SBS presentation.
New calculation properly takes pillar boxing into account.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/Render.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 58d3fd0ee3..bba030f209 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -1516,10 +1516,17 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co if (g_ActiveConfig.iStereoMode == 1) { + // Resize target to half its original size + int width = drawRc.GetWidth(); + drawRc.left += width / 4; + drawRc.right -= width / 4; + + // Create two target rectangle offset to the sides of the backbuffer TargetRectangle leftRc = drawRc, rightRc = drawRc; - int width = drawRc.right - drawRc.left; - leftRc.right -= width / 2; - rightRc.left += width / 2; + leftRc.left -= s_backbuffer_width / 4; + leftRc.right -= s_backbuffer_width / 4; + rightRc.left += s_backbuffer_width / 4; + rightRc.right += s_backbuffer_width / 4; m_post_processor->BlitFromTexture(sourceRc, leftRc, xfbSource->texture, xfbSource->texWidth, xfbSource->texHeight, 0); m_post_processor->BlitFromTexture(sourceRc, rightRc, xfbSource->texture, xfbSource->texWidth, xfbSource->texHeight, 1); @@ -1539,10 +1546,17 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co if (g_ActiveConfig.iStereoMode == 1) { + // Resize target to half its original size + int width = flipped_trc.GetWidth(); + flipped_trc.left += width / 4; + flipped_trc.right -= width / 4; + + // Create two target rectangle offset to the sides of the backbuffer TargetRectangle leftRc = flipped_trc, rightRc = flipped_trc; - int width = flipped_trc.right - flipped_trc.left; - leftRc.right -= width / 2; - rightRc.left += width / 2; + leftRc.left -= s_backbuffer_width / 4; + leftRc.right -= s_backbuffer_width / 4; + rightRc.left += s_backbuffer_width / 4; + rightRc.right += s_backbuffer_width / 4; m_post_processor->BlitFromTexture(targetRc, leftRc, tex, s_target_width, s_target_height, 0); m_post_processor->BlitFromTexture(targetRc, rightRc, tex, s_target_width, s_target_height, 1); |
