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:
NeoBrainX
2011-05-31 20:16:59 +00:00
parent 39cbd73e02
commit 84906edf61
5 changed files with 37 additions and 44 deletions

View File

@ -88,6 +88,8 @@ std::string VideoBackend::GetName()
void InitBackendInfo()
{
DX9::D3D::Init();
g_Config.backend_info.APIType = API_D3D9;
g_Config.backend_info.bUseRGBATextures = false;
g_Config.backend_info.bSupports3DVision = true;
@ -95,15 +97,8 @@ void InitBackendInfo()
g_Config.backend_info.bSupportsFormatReinterpretation = true;
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;
}
void VideoBackend::ShowConfig(void* parent)
{
#if defined(HAVE_WX) && HAVE_WX
DX9::D3D::Init();
InitBackendInfo();
// adapters
g_Config.backend_info.Adapters.clear();
@ -122,12 +117,16 @@ void VideoBackend::ShowConfig(void* parent)
// Clear ppshaders string vector
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");
diag.ShowModal();
g_Config.backend_info.Adapters.clear();
DX9::D3D::Shutdown();
#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.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str());
UpdateProjectionHack(g_Config.iPhackvalue, g_Config.sPhackvalue);
g_Config.UpdateProjectionHack();
g_Config.VerifyValidity();
UpdateActiveConfig();
window_handle = (void*)EmuWindow::Create((HWND)window_handle, GetModuleHandle(0), _T("Loading - Please wait."));