Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #690 from Armada651/d3dfullscreen_fixes
Exclusive fullscreen fixes
  • Loading branch information
delroth committed Jul 30, 2014
2 parents 5516b03 + 3b5625c commit 83838a6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions Source/Core/DolphinWX/Frame.cpp
Expand Up @@ -450,7 +450,7 @@ bool CFrame::RendererIsFullscreen()

if (Core::GetState() == Core::CORE_RUN || Core::GetState() == Core::CORE_PAUSE)
{
fullscreen = m_RenderFrame->IsFullScreen() && g_Config.bFullscreen;
fullscreen = m_RenderFrame->IsFullScreen();
}

#if defined(__APPLE__)
Expand Down Expand Up @@ -1189,7 +1189,7 @@ void CFrame::OnMouse(wxMouseEvent& event)

void CFrame::DoFullscreen(bool enable_fullscreen)
{
if (!g_Config.bBorderlessFullscreen &&
if (!g_Config.BorderlessFullscreenEnabled() &&
!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain &&
Core::GetState() == Core::CORE_PAUSE)
{
Expand All @@ -1216,7 +1216,7 @@ void CFrame::DoFullscreen(bool enable_fullscreen)
{
m_RenderFrame->ShowFullScreen(true, wxFULLSCREEN_ALL);
}
else if (g_Config.bBorderlessFullscreen ||
else if (g_Config.BorderlessFullscreenEnabled() ||
SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
{
// Exiting exclusive fullscreen should be done from a Renderer callback.
Expand Down Expand Up @@ -1244,7 +1244,8 @@ void CFrame::DoFullscreen(bool enable_fullscreen)
m_RenderFrame->Raise();
}

g_Config.bFullscreen = enable_fullscreen;
g_Config.bFullscreen = (g_Config.BorderlessFullscreenEnabled() ||
SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain) ? false : enable_fullscreen;
}

const CGameListCtrl *CFrame::GetGameListCtrl() const
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/FrameTools.cpp
Expand Up @@ -1104,7 +1104,7 @@ void CFrame::DoStop()

// If exclusive fullscreen is not enabled then we can pause the emulation
// before we've exited fullscreen. If not then we need to exit fullscreen first.
if (!RendererIsFullscreen() || g_Config.bBorderlessFullscreen ||
if (!RendererIsFullscreen() || g_Config.BorderlessFullscreenEnabled() ||
SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
{
Core::SetState(Core::CORE_PAUSE);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/D3D/Render.cpp
Expand Up @@ -939,7 +939,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangl
SetWindowSize(fbWidth, fbHeight);

const bool windowResized = CheckForResize();
const bool fullscreen = g_ActiveConfig.ExclusiveFullscreenEnabled() &&
const bool fullscreen = g_ActiveConfig.bFullscreen &&
!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain;

bool fullscreen_changed = s_last_fullscreen_mode != fullscreen;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoCommon/VideoConfig.cpp
Expand Up @@ -209,7 +209,7 @@ void VideoConfig::VerifyValidity()
// TODO: Check iMaxAnisotropy value
if (iAdapter < 0 || iAdapter > ((int)backend_info.Adapters.size() - 1)) iAdapter = 0;
if (iMultisampleMode < 0 || iMultisampleMode >= (int)backend_info.AAModes.size()) iMultisampleMode = 0;
if (!backend_info.bSupportsExclusiveFullscreen) bBorderlessFullscreen = true;
if (!backend_info.bSupportsExclusiveFullscreen) bBorderlessFullscreen = false;
}

void VideoConfig::Save(const std::string& ini_file)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoCommon/VideoConfig.h
Expand Up @@ -152,7 +152,7 @@ struct VideoConfig final
bool VirtualXFBEnabled() const { return bUseXFB && !bUseRealXFB; }
bool EFBCopiesToTextureEnabled() const { return bEFBCopyEnable && bCopyEFBToTexture; }
bool EFBCopiesToRamEnabled() const { return bEFBCopyEnable && !bCopyEFBToTexture; }
bool ExclusiveFullscreenEnabled() const { return bFullscreen && !bBorderlessFullscreen; }
bool BorderlessFullscreenEnabled() const { return !backend_info.bSupportsExclusiveFullscreen || bBorderlessFullscreen; }
};

extern VideoConfig g_Config;
Expand Down

0 comments on commit 83838a6

Please sign in to comment.