Merge pull request #506 from Armada651/d3dfullscreen

D3D: Add exclusive fullscreen support.
This commit is contained in:
Pierre Bourdon
2014-07-26 13:22:11 +02:00
18 changed files with 209 additions and 135 deletions

View File

@ -236,15 +236,7 @@ int FramebufferManagerBase::ScaleToVirtualXfbWidth(int x, unsigned int backbuffe
if (g_ActiveConfig.RealXFBEnabled())
return x;
if (g_ActiveConfig.b3DVision)
{
// This works, yet the version in the else doesn't. No idea why.
return x * (int)backbuffer_width / (int)FramebufferManagerBase::LastXfbWidth();
}
else
{
return x * (int)Renderer::GetTargetRectangle().GetWidth() / (int)FramebufferManagerBase::LastXfbWidth();
}
return x * (int)Renderer::GetTargetRectangle().GetWidth() / (int)FramebufferManagerBase::LastXfbWidth();
}
int FramebufferManagerBase::ScaleToVirtualXfbHeight(int y, unsigned int backbuffer_height)
@ -252,13 +244,5 @@ int FramebufferManagerBase::ScaleToVirtualXfbHeight(int y, unsigned int backbuff
if (g_ActiveConfig.RealXFBEnabled())
return y;
if (g_ActiveConfig.b3DVision)
{
// This works, yet the version in the else doesn't. No idea why.
return y * (int)backbuffer_height / (int)FramebufferManagerBase::LastXfbHeight();
}
else
{
return y * (int)Renderer::GetTargetRectangle().GetHeight() / (int)FramebufferManagerBase::LastXfbHeight();
}
return y * (int)Renderer::GetTargetRectangle().GetHeight() / (int)FramebufferManagerBase::LastXfbHeight();
}

View File

@ -28,6 +28,7 @@ void UpdateActiveConfig()
VideoConfig::VideoConfig()
{
bRunning = false;
bFullscreen = false;
// Needed for the first frame, I think
fAspectRatioHackW = 1;
@ -37,7 +38,7 @@ VideoConfig::VideoConfig()
backend_info.APIType = API_NONE;
backend_info.bUseRGBATextures = false;
backend_info.bUseMinimalMipCount = false;
backend_info.bSupports3DVision = false;
backend_info.bSupportsExclusiveFullscreen = false;
}
void VideoConfig::Load(const std::string& ini_file)
@ -82,12 +83,12 @@ void VideoConfig::Load(const std::string& ini_file)
settings->Get("DisableFog", &bDisableFog, 0);
settings->Get("OMPDecoder", &bOMPDecoder, false);
settings->Get("EnableShaderDebugging", &bEnableShaderDebugging, false);
settings->Get("BorderlessFullscreen", &bBorderlessFullscreen, false);
IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
enhancements->Get("ForceFiltering", &bForceFiltering, 0);
enhancements->Get("MaxAnisotropy", &iMaxAnisotropy, 0); // NOTE - this is x in (1 << x)
enhancements->Get("PostProcessingShader", &sPostProcessingShader, "");
enhancements->Get("Enable3dVision", &b3DVision, false);
IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks");
hacks->Get("EFBAccessEnable", &bEFBAccessEnable, true);
@ -183,7 +184,6 @@ void VideoConfig::GameIniLoad()
CHECK_SETTING("Video_Enhancements", "ForceFiltering", bForceFiltering);
CHECK_SETTING("Video_Enhancements", "MaxAnisotropy", iMaxAnisotropy); // NOTE - this is x in (1 << x)
CHECK_SETTING("Video_Enhancements", "PostProcessingShader", sPostProcessingShader);
CHECK_SETTING("Video_Enhancements", "Enable3dVision", b3DVision);
CHECK_SETTING("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable);
CHECK_SETTING("Video_Hacks", "EFBCopyEnable", bEFBCopyEnable);
@ -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.bSupports3DVision) b3DVision = false;
if (!backend_info.bSupportsExclusiveFullscreen) bBorderlessFullscreen = true;
}
void VideoConfig::Save(const std::string& ini_file)
@ -254,12 +254,12 @@ void VideoConfig::Save(const std::string& ini_file)
settings->Set("DisableFog", bDisableFog);
settings->Set("OMPDecoder", bOMPDecoder);
settings->Set("EnableShaderDebugging", bEnableShaderDebugging);
settings->Set("BorderlessFullscreen", bBorderlessFullscreen);
IniFile::Section* enhancements = iniFile.GetOrCreateSection("Enhancements");
enhancements->Set("ForceFiltering", bForceFiltering);
enhancements->Set("MaxAnisotropy", iMaxAnisotropy);
enhancements->Set("PostProcessingShader", sPostProcessingShader);
enhancements->Set("Enable3dVision", b3DVision);
IniFile::Section* hacks = iniFile.GetOrCreateSection("Hacks");
hacks->Set("EFBAccessEnable", bEFBAccessEnable);

View File

@ -57,7 +57,7 @@ struct VideoConfig final
// General
bool bVSync;
bool bFullscreen;
bool bRunning;
bool bWidescreenHack;
int iAspectRatio;
@ -100,7 +100,7 @@ struct VideoConfig final
bool bAnaglyphStereo;
int iAnaglyphStereoSeparation;
int iAnaglyphFocalAngle;
bool b3DVision;
bool bBorderlessFullscreen;
// Hacks
bool bEFBAccessEnable;
@ -139,7 +139,7 @@ struct VideoConfig final
bool bUseRGBATextures; // used for D3D in TextureCache
bool bUseMinimalMipCount;
bool bSupports3DVision;
bool bSupportsExclusiveFullscreen;
bool bSupportsDualSourceBlend;
bool bSupportsPrimitiveRestart;
bool bSupportsOversizedViewports;
@ -152,6 +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; }
};
extern VideoConfig g_Config;