diff options
| author | NeoBrainX <NeoBrainX@gmail.com> | 2012-09-29 00:19:28 +0200 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@gmail.com> | 2012-11-16 14:29:09 +0100 |
| commit | a38bb488d205752dd3c3e59bae55924ae286c4ec (patch) | |
| tree | a28590246ad849e74484f9753013dac1e6178c0f /Source/Core/VideoCommon/Src/FramebufferManagerBase.cpp | |
| parent | 78031c2d54b4acbca14747c57572b34e2530e474 (diff) | |
Remove Renderer::xScale and Renderer::yScale.
Diffstat (limited to 'Source/Core/VideoCommon/Src/FramebufferManagerBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/FramebufferManagerBase.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/Src/FramebufferManagerBase.cpp b/Source/Core/VideoCommon/Src/FramebufferManagerBase.cpp index fbb042c227..be6109decf 100644 --- a/Source/Core/VideoCommon/Src/FramebufferManagerBase.cpp +++ b/Source/Core/VideoCommon/Src/FramebufferManagerBase.cpp @@ -229,3 +229,31 @@ void FramebufferManagerBase::ReplaceVirtualXFB() } } } + +unsigned int FramebufferManagerBase::ScaleToVirtualXfbWidth(unsigned int width, unsigned int backbuffer_width) +{ + if (g_ActiveConfig.RealXFBEnabled()) + return width; + + if (g_ActiveConfig.b3DVision) + { + // This works, yet the version in the else doesn't. No idea why. + return width * (backbuffer_width-1) / (FramebufferManagerBase::LastXfbWidth()-1); + } + else + return width * (Renderer::GetTargetRectangle().GetWidth() - 1) / (float)(FramebufferManagerBase::LastXfbWidth()-1); +} + +unsigned int FramebufferManagerBase::ScaleToVirtualXfbHeight(unsigned int height, unsigned int backbuffer_height) +{ + if (g_ActiveConfig.RealXFBEnabled()) + return height; + + if (g_ActiveConfig.b3DVision) + { + // This works, yet the version in the else doesn't. No idea why. + return height * (backbuffer_height-1) / (FramebufferManagerBase::LastXfbHeight()-1); + } + else + return height * (Renderer::GetTargetRectangle().GetHeight() - 1) / (float)(FramebufferManagerBase::LastXfbHeight()-1); +} |
