diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2017-03-09 21:06:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-09 21:06:50 +0100 |
| commit | ef74c5eabd52a75eb42ecf9b36701dca11d3061f (patch) | |
| tree | 2cc71d56b6b97b05e29666d169824aacffc0258b /Source/Core/VideoCommon/FramebufferManagerBase.cpp | |
| parent | cf848b7c42071104c2ade3b1b8230e2233a40f11 (diff) | |
| parent | 2cd240af0d261d4600e273badd912570a5a09a19 (diff) | |
Merge pull request #5051 from stenzek/renderer-fixes
VideoBackends: Fix crashes introduced by #4999
Diffstat (limited to 'Source/Core/VideoCommon/FramebufferManagerBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/FramebufferManagerBase.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/FramebufferManagerBase.cpp b/Source/Core/VideoCommon/FramebufferManagerBase.cpp index 0fc65a5443..dd2cc88735 100644 --- a/Source/Core/VideoCommon/FramebufferManagerBase.cpp +++ b/Source/Core/VideoCommon/FramebufferManagerBase.cpp @@ -248,20 +248,18 @@ void FramebufferManagerBase::ReplaceVirtualXFB() } } -int FramebufferManagerBase::ScaleToVirtualXfbWidth(int x) +int FramebufferManagerBase::ScaleToVirtualXfbWidth(int x, const TargetRectangle& target_rectangle) { if (g_ActiveConfig.RealXFBEnabled()) return x; - return x * static_cast<int>(g_renderer->GetTargetRectangle().GetWidth()) / - static_cast<int>(FramebufferManagerBase::LastXfbWidth()); + return x * target_rectangle.GetWidth() / s_last_xfb_width; } -int FramebufferManagerBase::ScaleToVirtualXfbHeight(int y) +int FramebufferManagerBase::ScaleToVirtualXfbHeight(int y, const TargetRectangle& target_rectangle) { if (g_ActiveConfig.RealXFBEnabled()) return y; - return y * static_cast<int>(g_renderer->GetTargetRectangle().GetHeight()) / - static_cast<int>(FramebufferManagerBase::LastXfbHeight()); + return y * target_rectangle.GetHeight() / s_last_xfb_height; } |
