mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
Fix applying anti-aliasing without having to open the gfx config. Thanks to skid for pointing out the VerifyValidity problem to me ;)
Fixes issue 4498. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7574 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
39cbd73e02
commit
84906edf61
@ -113,8 +113,6 @@ void VideoConfig::Load(const char *ini_file)
|
|||||||
|
|
||||||
iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
|
iniFile.Get("Hardware", "Adapter", &iAdapter, 0);
|
||||||
|
|
||||||
VerifyValidity();
|
|
||||||
|
|
||||||
// Load common settings
|
// Load common settings
|
||||||
iniFile.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
iniFile.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||||
bool bTmp;
|
bool bTmp;
|
||||||
@ -173,8 +171,6 @@ void VideoConfig::GameIniLoad(const char *ini_file)
|
|||||||
iniFile.GetIfExists("Video", "PH_ZNear", &sPhackvalue[0]);
|
iniFile.GetIfExists("Video", "PH_ZNear", &sPhackvalue[0]);
|
||||||
iniFile.GetIfExists("Video", "PH_ZFar", &sPhackvalue[1]);
|
iniFile.GetIfExists("Video", "PH_ZFar", &sPhackvalue[1]);
|
||||||
iniFile.GetIfExists("Video", "ZTPSpeedupHack", &bZTPSpeedHack);
|
iniFile.GetIfExists("Video", "ZTPSpeedupHack", &bZTPSpeedHack);
|
||||||
|
|
||||||
VerifyValidity();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoConfig::VerifyValidity()
|
void VideoConfig::VerifyValidity()
|
||||||
|
@ -149,6 +149,7 @@ struct VideoConfig
|
|||||||
int iAdapter;
|
int iAdapter;
|
||||||
|
|
||||||
// Static config per API
|
// Static config per API
|
||||||
|
// TODO: Move this out of VideoConfig
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
API_TYPE APIType;
|
API_TYPE APIType;
|
||||||
|
@ -80,19 +80,6 @@ std::string VideoBackend::GetName()
|
|||||||
|
|
||||||
void InitBackendInfo()
|
void InitBackendInfo()
|
||||||
{
|
{
|
||||||
g_Config.backend_info.APIType = API_D3D11;
|
|
||||||
g_Config.backend_info.bUseRGBATextures = true; // the GX formats barely match any D3D11 formats
|
|
||||||
g_Config.backend_info.bSupports3DVision = false;
|
|
||||||
g_Config.backend_info.bSupportsDualSourceBlend = true;
|
|
||||||
g_Config.backend_info.bSupportsFormatReinterpretation = true;
|
|
||||||
g_Config.backend_info.bSupportsPixelLighting = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VideoBackend::ShowConfig(void *_hParent)
|
|
||||||
{
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
|
||||||
InitBackendInfo();
|
|
||||||
|
|
||||||
HRESULT hr = DX11::D3D::LoadDXGI();
|
HRESULT hr = DX11::D3D::LoadDXGI();
|
||||||
if (SUCCEEDED(hr)) hr = DX11::D3D::LoadD3D();
|
if (SUCCEEDED(hr)) hr = DX11::D3D::LoadD3D();
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
@ -101,6 +88,13 @@ void VideoBackend::ShowConfig(void *_hParent)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_Config.backend_info.APIType = API_D3D11;
|
||||||
|
g_Config.backend_info.bUseRGBATextures = true; // the GX formats barely match any D3D11 formats
|
||||||
|
g_Config.backend_info.bSupports3DVision = false;
|
||||||
|
g_Config.backend_info.bSupportsDualSourceBlend = true;
|
||||||
|
g_Config.backend_info.bSupportsFormatReinterpretation = true;
|
||||||
|
g_Config.backend_info.bSupportsPixelLighting = true;
|
||||||
|
|
||||||
IDXGIFactory* factory;
|
IDXGIFactory* factory;
|
||||||
IDXGIAdapter* ad;
|
IDXGIAdapter* ad;
|
||||||
hr = DX11::PCreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&factory);
|
hr = DX11::PCreateDXGIFactory(__uuidof(IDXGIFactory), (void**)&factory);
|
||||||
@ -140,12 +134,16 @@ void VideoBackend::ShowConfig(void *_hParent)
|
|||||||
// Clear ppshaders string vector
|
// Clear ppshaders string vector
|
||||||
g_Config.backend_info.PPShaders.clear();
|
g_Config.backend_info.PPShaders.clear();
|
||||||
|
|
||||||
VideoConfigDiag diag((wxWindow*)_hParent, _trans("Direct3D11"), "gfx_dx11");
|
|
||||||
diag.ShowModal();
|
|
||||||
|
|
||||||
g_Config.backend_info.Adapters.clear();
|
|
||||||
DX11::D3D::UnloadDXGI();
|
DX11::D3D::UnloadDXGI();
|
||||||
DX11::D3D::UnloadD3D();
|
DX11::D3D::UnloadD3D();
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideoBackend::ShowConfig(void *_hParent)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
|
InitBackendInfo();
|
||||||
|
VideoConfigDiag diag((wxWindow*)_hParent, _trans("Direct3D11"), "gfx_dx11");
|
||||||
|
diag.ShowModal();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +155,8 @@ bool VideoBackend::Initialize(void *&window_handle)
|
|||||||
|
|
||||||
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx11.ini").c_str());
|
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx11.ini").c_str());
|
||||||
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
|
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
|
||||||
UpdateProjectionHack(g_Config.iPhackvalue, g_Config.sPhackvalue);
|
g_Config.UpdateProjectionHack();
|
||||||
|
g_Config.VerifyValidity();
|
||||||
UpdateActiveConfig();
|
UpdateActiveConfig();
|
||||||
|
|
||||||
window_handle = (void*)EmuWindow::Create((HWND)window_handle, GetModuleHandle(0), _T("Loading - Please wait."));
|
window_handle = (void*)EmuWindow::Create((HWND)window_handle, GetModuleHandle(0), _T("Loading - Please wait."));
|
||||||
|
@ -88,6 +88,8 @@ std::string VideoBackend::GetName()
|
|||||||
|
|
||||||
void InitBackendInfo()
|
void InitBackendInfo()
|
||||||
{
|
{
|
||||||
|
DX9::D3D::Init();
|
||||||
|
|
||||||
g_Config.backend_info.APIType = API_D3D9;
|
g_Config.backend_info.APIType = API_D3D9;
|
||||||
g_Config.backend_info.bUseRGBATextures = false;
|
g_Config.backend_info.bUseRGBATextures = false;
|
||||||
g_Config.backend_info.bSupports3DVision = true;
|
g_Config.backend_info.bSupports3DVision = true;
|
||||||
@ -97,13 +99,6 @@ void InitBackendInfo()
|
|||||||
const int shaderModel = ((DX9::D3D::GetCaps().PixelShaderVersion >> 8) & 0xFF);
|
const int shaderModel = ((DX9::D3D::GetCaps().PixelShaderVersion >> 8) & 0xFF);
|
||||||
const int maxConstants = (shaderModel < 3) ? 32 : ((shaderModel < 4) ? 224 : 65536);
|
const int maxConstants = (shaderModel < 3) ? 32 : ((shaderModel < 4) ? 224 : 65536);
|
||||||
g_Config.backend_info.bSupportsPixelLighting = C_PLIGHTS + 40 <= maxConstants && C_PMATERIALS + 4 <= maxConstants;
|
g_Config.backend_info.bSupportsPixelLighting = C_PLIGHTS + 40 <= maxConstants && C_PMATERIALS + 4 <= maxConstants;
|
||||||
}
|
|
||||||
|
|
||||||
void VideoBackend::ShowConfig(void* parent)
|
|
||||||
{
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
|
||||||
DX9::D3D::Init();
|
|
||||||
InitBackendInfo();
|
|
||||||
|
|
||||||
// adapters
|
// adapters
|
||||||
g_Config.backend_info.Adapters.clear();
|
g_Config.backend_info.Adapters.clear();
|
||||||
@ -123,11 +118,15 @@ void VideoBackend::ShowConfig(void* parent)
|
|||||||
// Clear ppshaders string vector
|
// Clear ppshaders string vector
|
||||||
g_Config.backend_info.PPShaders.clear();
|
g_Config.backend_info.PPShaders.clear();
|
||||||
|
|
||||||
|
DX9::D3D::Shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideoBackend::ShowConfig(void* parent)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
|
InitBackendInfo();
|
||||||
VideoConfigDiag diag((wxWindow*)parent, _trans("Direct3D9"), "gfx_dx9");
|
VideoConfigDiag diag((wxWindow*)parent, _trans("Direct3D9"), "gfx_dx9");
|
||||||
diag.ShowModal();
|
diag.ShowModal();
|
||||||
|
|
||||||
g_Config.backend_info.Adapters.clear();
|
|
||||||
DX9::D3D::Shutdown();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,8 +138,8 @@ bool VideoBackend::Initialize(void *&window_handle)
|
|||||||
|
|
||||||
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx9.ini").c_str());
|
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_dx9.ini").c_str());
|
||||||
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
|
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
|
||||||
|
g_Config.UpdateProjectionHack();
|
||||||
UpdateProjectionHack(g_Config.iPhackvalue, g_Config.sPhackvalue);
|
g_Config.VerifyValidity();
|
||||||
UpdateActiveConfig();
|
UpdateActiveConfig();
|
||||||
|
|
||||||
window_handle = (void*)EmuWindow::Create((HWND)window_handle, GetModuleHandle(0), _T("Loading - Please wait."));
|
window_handle = (void*)EmuWindow::Create((HWND)window_handle, GetModuleHandle(0), _T("Loading - Please wait."));
|
||||||
|
@ -135,12 +135,6 @@ void InitBackendInfo()
|
|||||||
g_Config.backend_info.bSupportsDualSourceBlend = false; // supported, but broken
|
g_Config.backend_info.bSupportsDualSourceBlend = false; // supported, but broken
|
||||||
g_Config.backend_info.bSupportsFormatReinterpretation = false;
|
g_Config.backend_info.bSupportsFormatReinterpretation = false;
|
||||||
g_Config.backend_info.bSupportsPixelLighting = true;
|
g_Config.backend_info.bSupportsPixelLighting = true;
|
||||||
}
|
|
||||||
|
|
||||||
void VideoBackend::ShowConfig(void *_hParent)
|
|
||||||
{
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
|
||||||
InitBackendInfo();
|
|
||||||
|
|
||||||
// aamodes
|
// aamodes
|
||||||
const char* caamodes[] = {"None", "2x", "4x", "8x", "8x CSAA", "8xQ CSAA", "16x CSAA", "16xQ CSAA"};
|
const char* caamodes[] = {"None", "2x", "4x", "8x", "8x CSAA", "8xQ CSAA", "16x CSAA", "16xQ CSAA"};
|
||||||
@ -148,7 +142,12 @@ void VideoBackend::ShowConfig(void *_hParent)
|
|||||||
|
|
||||||
// pp shaders
|
// pp shaders
|
||||||
GetShaders(g_Config.backend_info.PPShaders);
|
GetShaders(g_Config.backend_info.PPShaders);
|
||||||
|
}
|
||||||
|
|
||||||
|
void VideoBackend::ShowConfig(void *_hParent)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
|
InitBackendInfo();
|
||||||
VideoConfigDiag diag((wxWindow*)_hParent, "OpenGL", "gfx_opengl");
|
VideoConfigDiag diag((wxWindow*)_hParent, "OpenGL", "gfx_opengl");
|
||||||
diag.ShowModal();
|
diag.ShowModal();
|
||||||
#endif
|
#endif
|
||||||
@ -162,9 +161,8 @@ bool VideoBackend::Initialize(void *&window_handle)
|
|||||||
|
|
||||||
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_opengl.ini").c_str());
|
g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_opengl.ini").c_str());
|
||||||
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
|
g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
|
||||||
|
|
||||||
g_Config.UpdateProjectionHack();
|
g_Config.UpdateProjectionHack();
|
||||||
|
g_Config.VerifyValidity();
|
||||||
UpdateActiveConfig();
|
UpdateActiveConfig();
|
||||||
|
|
||||||
if (!OpenGL_Create(window_handle))
|
if (!OpenGL_Create(window_handle))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user