mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-26 14:28:34 +00:00
VideoCommon: Fix crash at startup with virtual XFB enabled
This commit is contained in:
parent
883bec873f
commit
4012166085
4 changed files with 12 additions and 14 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue