apply James333 patch to make dx9 plugin use wxwidgets.

some other minor warning fixes.
thanks to James333 nice patch :)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5679 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Rodolfo Osvaldo Bogado 2010-06-13 19:41:07 +00:00
parent a524cecfab
commit 20e3919033
8 changed files with 718 additions and 607 deletions

View File

@ -276,7 +276,7 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
if(color.enablelighting && alpha.enablelighting) if(color.enablelighting && alpha.enablelighting)
{ {
// both have lighting, test if they use the same ligths // both have lighting, test if they use the same lights
int mask = 0; int mask = 0;
if(color.lightparams == alpha.lightparams) if(color.lightparams == alpha.lightparams)
{ {

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?> <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="9.00" Version="9,00"
Name="Plugin_VideoDX9" Name="Plugin_VideoDX9"
ProjectGUID="{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}" ProjectGUID="{636FAD5F-02D1-4E9A-BE67-FB8EA99B9A18}"
RootNamespace="Plugin_VideoDX9" RootNamespace="Plugin_VideoDX9"
@ -99,12 +99,12 @@
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;" AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false" GenerateManifest="false"
DelayLoadDLLs="d3dx9_42.dll"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb" ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1" RandomizedBaseAddress="1"
DataExecutionPrevention="0" DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib" ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="1" TargetMachine="1"
DelayLoadDLLs="d3dx9_42.dll"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -210,6 +210,7 @@
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;" AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false" GenerateManifest="false"
DelayLoadDLLs="d3dx9_42.dll"
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb" ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
SubSystem="2" SubSystem="2"
@ -217,7 +218,6 @@
DataExecutionPrevention="0" DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib" ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="17" TargetMachine="17"
DelayLoadDLLs="d3dx9_42.dll"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -311,13 +311,13 @@
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;" AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false" GenerateManifest="false"
DelayLoadDLLs="d3dx9d_42.dll"
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb" ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1" RandomizedBaseAddress="1"
DataExecutionPrevention="0" DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib" ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="1" TargetMachine="1"
DelayLoadDLLs="d3dx9d_42.dll"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -410,13 +410,13 @@
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;" AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false" GenerateManifest="false"
DelayLoadDLLs="d3dx9d_42.dll"
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb" ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1" RandomizedBaseAddress="1"
DataExecutionPrevention="0" DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib" ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="17" TargetMachine="17"
DelayLoadDLLs="d3dx9d_42.dll"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -520,13 +520,13 @@
AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;" AdditionalLibraryDirectories="../../../Externals/Cg;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false" GenerateManifest="false"
IgnoreDefaultLibraryNames="" IgnoreDefaultLibraryNames=""
DelayLoadDLLs="d3dx9_42.dll"
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb" ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1" RandomizedBaseAddress="1"
DataExecutionPrevention="0" DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib" ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="1" TargetMachine="1"
DelayLoadDLLs="d3dx9_42.dll"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -631,13 +631,13 @@
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;" AdditionalLibraryDirectories="..\..\..\Externals\Cg64;&quot;..\..\..\Externals\wxWidgets\lib\vc_lib\$(PlatformName)&quot;"
GenerateManifest="false" GenerateManifest="false"
DelayLoadDLLs="d3dx9_42.dll"
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb" ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)\$(TargetName).pdb"
RandomizedBaseAddress="1" RandomizedBaseAddress="1"
DataExecutionPrevention="0" DataExecutionPrevention="0"
ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib" ImportLibrary="$(PlatformName)\$(ConfigurationName)\$(TargetName).lib"
TargetMachine="17" TargetMachine="17"
DelayLoadDLLs="d3dx9_42.dll"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@ -665,19 +665,6 @@
<References> <References>
</References> </References>
<Files> <Files>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
<File
RelativePath=".\Src\resource.h"
>
</File>
<File
RelativePath=".\Src\Resource.rc"
>
</File>
</Filter>
<Filter <Filter
Name="win32" Name="win32"
> >

View File

@ -15,10 +15,14 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include <windowsx.h> #include <wx/wx.h>
#include <Richedit.h> #include <wx/sizer.h>
#include <wx/filepicker.h>
#include <wx/gbsizer.h>
#include <wx/notebook.h>
#include <wx/mimetype.h>
#include "resource.h" #include "DlgSettings.h"
#include "W32Util/PropertySheet.h" #include "W32Util/PropertySheet.h"
#include "W32Util/ShellUtil.h" #include "W32Util/ShellUtil.h"
#include "FileUtil.h" #include "FileUtil.h"
@ -30,329 +34,501 @@
#include "TextureCache.h" #include "TextureCache.h"
const TCHAR *aspect_ratio_names[4] = { BEGIN_EVENT_TABLE(GFXConfigDialogDX,wxDialog)
_T("Auto"),
_T("Force 16:9 Widescreen"), EVT_CLOSE(GFXConfigDialogDX::OnClose)
_T("Force 4:3 Standard"), EVT_BUTTON(ID_CLOSE, GFXConfigDialogDX::CloseClick)
_T("Stretch to Window"),
}; //Direct3D Tab
EVT_CHECKBOX(ID_VSYNC, GFXConfigDialogDX::DirectXSettingsChanged)
struct TabDirect3D : public W32Util::Tab EVT_CHECKBOX(ID_WIDESCREEN_HACK, GFXConfigDialogDX::DirectXSettingsChanged)
EVT_CHOICE(ID_ASPECT, GFXConfigDialogDX::DirectXSettingsChanged)
EVT_CHOICE(ID_ANTIALIASMODE, GFXConfigDialogDX::DirectXSettingsChanged)
EVT_CHOICE(ID_EFBSCALEMODE, GFXConfigDialogDX::DirectXSettingsChanged)
EVT_CHECKBOX(ID_EFB_ACCESS_ENABLE, GFXConfigDialogDX::DirectXSettingsChanged)
EVT_CHECKBOX(ID_SAFETEXTURECACHE, GFXConfigDialogDX::DirectXSettingsChanged)
EVT_RADIOBUTTON(ID_RADIO_SAFETEXTURECACHE_SAFE, GFXConfigDialogDX::DirectXSettingsChanged)
EVT_RADIOBUTTON(ID_RADIO_SAFETEXTURECACHE_NORMAL, GFXConfigDialogDX::DirectXSettingsChanged)
EVT_RADIOBUTTON(ID_RADIO_SAFETEXTURECACHE_FAST, GFXConfigDialogDX::DirectXSettingsChanged)
//Enhancements tab
EVT_CHECKBOX(ID_FORCEFILTERING, GFXConfigDialogDX::EnhancementsSettingsChanged)
EVT_CHECKBOX(ID_FORCEANISOTROPY, GFXConfigDialogDX::EnhancementsSettingsChanged)
EVT_CHECKBOX(ID_LOADHIRESTEXTURES, GFXConfigDialogDX::EnhancementsSettingsChanged)
EVT_CHECKBOX(ID_EFBSCALEDCOPY, GFXConfigDialogDX::EnhancementsSettingsChanged)
//Advanced Tab
EVT_CHECKBOX(ID_DISABLEFOG, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_OVERLAYFPS, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_ENABLEEFBCOPY, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_RADIOBUTTON(ID_EFBTORAM, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_RADIOBUTTON(ID_EFBTOTEX, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_ENABLEHOTKEY, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_WIREFRAME, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_ENABLEXFB, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_ENABLEREALXFB, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_USENATIVEMIPS, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_TEXDUMP, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_DUMPFRAMES, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_OVERLAYSTATS, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_PROJSTATS, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_SHADERERRORS, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_TEXFMT_OVERLAY, GFXConfigDialogDX::AdvancedSettingsChanged)
EVT_CHECKBOX(ID_TEXFMT_CENTER, GFXConfigDialogDX::AdvancedSettingsChanged)
END_EVENT_TABLE()
GFXConfigDialogDX::GFXConfigDialogDX(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{ {
void Init(HWND hDlg) }
{ // Close and unload the window
TCHAR tempstr[2000]; // ---------------
GFXConfigDialogDX::~GFXConfigDialogDX()
for (int i = 0; i < D3D::GetNumAdapters(); i++) {
{ INFO_LOG(CONSOLE, "GFXConfigDialogDX Closed");
const D3D::Adapter &adapter = D3D::GetAdapter(i); }
swprintf_s( tempstr, _T("%hs"), adapter.ident.Description ); void GFXConfigDialogDX::OnClose(wxCloseEvent& event)
ComboBox_AddString(GetDlgItem(hDlg, IDC_ADAPTER), tempstr); {
} //INFO_LOG(CONSOLE, "OnClose");
CloseWindow();
const D3D::Adapter &adapter = D3D::GetAdapter(g_Config.iAdapter); }
ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_ADAPTER), g_Config.iAdapter); void GFXConfigDialogDX::CloseClick(wxCommandEvent& WXUNUSED (event))
{
for (int i = 0; i < (int)adapter.aa_levels.size(); i++) //INFO_LOG(CONSOLE, "CloseClick");
{ CloseWindow();
swprintf_s( tempstr, _T("%hs"), adapter.aa_levels[i].name ); }
ComboBox_AddString(GetDlgItem(hDlg, IDC_ANTIALIASMODE), tempstr); void GFXConfigDialogDX::InitializeGUIValues()
} {
ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_ANTIALIASMODE), g_Config.iMultisampleMode); // General Display Settings
if (adapter.aa_levels.size() == 1) m_AdapterCB->SetSelection(g_Config.iAdapter);
{ m_VSync->SetValue(g_Config.bVSync);
ComboBox_Enable(GetDlgItem(hDlg, IDC_ANTIALIASMODE), FALSE); m_WidescreenHack->SetValue(g_Config.bWidescreenHack);
} m_KeepAR->SetSelection(g_Config.iAspectRatio);
swprintf_s( tempstr, _T("%hs"), "Auto (Fractional)" ); m_MSAAModeCB->SetSelection(g_Config.iMultisampleMode);
ComboBox_AddString(GetDlgItem(hDlg, IDC_EFBSCALE), tempstr); m_EFBScaleMode->SetSelection(g_Config.iEFBScale);
swprintf_s( tempstr, _T("%hs"), "Auto (Integral)" ); m_EnableEFBAccess->SetValue(g_Config.bEFBAccessEnable);
ComboBox_AddString(GetDlgItem(hDlg, IDC_EFBSCALE), tempstr); m_SafeTextureCache->SetValue(g_Config.bSafeTextureCache);
swprintf_s( tempstr, _T("%hs"), "1x" ); if(g_Config.iSafeTextureCache_ColorSamples == 0)
ComboBox_AddString(GetDlgItem(hDlg, IDC_EFBSCALE), tempstr); m_Radio_SafeTextureCache_Safe->SetValue(true);
swprintf_s( tempstr, _T("%hs"), "2x" ); else
ComboBox_AddString(GetDlgItem(hDlg, IDC_EFBSCALE), tempstr); if(g_Config.iSafeTextureCache_ColorSamples > 128)
swprintf_s( tempstr, _T("%hs"), "3x" ); m_Radio_SafeTextureCache_Normal->SetValue(true);
ComboBox_AddString(GetDlgItem(hDlg, IDC_EFBSCALE), tempstr); else
ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_EFBSCALE), g_Config.iEFBScale); m_Radio_SafeTextureCache_Fast->SetValue(true);
for (int i = 0; i < 4; i++)
{ // Enhancements
ComboBox_AddString(GetDlgItem(hDlg, IDC_ASPECTRATIO), aspect_ratio_names[i]); if(g_Config.iMaxAnisotropy == 1)
} m_MaxAnisotropy->SetValue(false);
ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_ASPECTRATIO), g_Config.iAspectRatio); else
{
Button_SetCheck(GetDlgItem(hDlg, IDC_VSYNC), g_Config.bVSync); if(g_Config.iMaxAnisotropy == 8)
Button_SetCheck(GetDlgItem(hDlg, IDC_WIDESCREEN_HACK), g_Config.bWidescreenHack); m_MaxAnisotropy->SetValue(true);
Button_SetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE), g_Config.bSafeTextureCache); }
m_ForceFiltering->SetValue(g_Config.bForceFiltering);
if(g_Config.iSafeTextureCache_ColorSamples == 0) m_HiresTextures->SetValue(g_Config.bHiresTextures);
{ m_MSAAModeCB->SetSelection(g_Config.iMultisampleMode);
Button_SetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_SAFE), true); m_EFBScaledCopy->SetValue(g_Config.bCopyEFBScaled);
}
else //Advance
{ m_DisableFog->SetValue(g_Config.bDisableFog);
if(g_Config.iSafeTextureCache_ColorSamples > 128) m_OverlayFPS->SetValue(g_Config.bShowFPS);
{
Button_SetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_NORMAL), true); m_CopyEFB->SetValue(!g_Config.bEFBCopyDisable);
} g_Config.bCopyEFBToTexture ? m_Radio_CopyEFBToGL->SetValue(true) : m_Radio_CopyEFBToRAM->SetValue(true);
else
{ m_EnableHotkeys->SetValue(g_Config.bOSDHotKey);
Button_SetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_FAST), true); m_WireFrame->SetValue(g_Config.bWireFrame);
} m_EnableXFB->SetValue(g_Config.bUseXFB);
} m_EnableRealXFB->SetValue(g_Config.bUseRealXFB);
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_SAFE),g_Config.bSafeTextureCache); m_UseNativeMips->SetValue(g_Config.bUseNativeMips);
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_NORMAL),g_Config.bSafeTextureCache);
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_FAST),g_Config.bSafeTextureCache); m_DumpTextures->SetValue(g_Config.bDumpTextures);
m_DumpFrames->SetValue(g_Config.bDumpFrames);
Button_SetCheck(GetDlgItem(hDlg, IDC_EFB_ACCESS_ENABLE), g_Config.bEFBAccessEnable); m_OverlayStats->SetValue(g_Config.bOverlayStats);
m_ProjStats->SetValue(g_Config.bOverlayProjStats);
std::wstring str; m_ShaderErrors->SetValue(g_Config.bShowShaderErrors);
if( !D3D::DXCheck(str) ) { m_TexfmtOverlay->SetValue(g_Config.bTexFmtOverlayEnable);
SNDMSG( GetDlgItem(hDlg, IDC_DXCHK), EM_AUTOURLDETECT, TRUE, 0 ); m_TexfmtCenter->SetValue(g_Config.bTexFmtOverlayCenter);
SNDMSG( GetDlgItem(hDlg, IDC_DXCHK), EM_SETEVENTMASK, 0, ENM_LINK ); m_TexfmtCenter->Enable(m_TexfmtOverlay->IsChecked());
str.append( _T("\nhttp://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3") ); }
} void GFXConfigDialogDX::CreateGUIControls()
Edit_SetText(GetDlgItem(hDlg, IDC_DXCHK), str.c_str()); {
} this->SetSizeHints( wxDefaultSize, wxDefaultSize );
this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
void Command(HWND hDlg,WPARAM wParam)
{ wxBoxSizer* sMain;
switch (LOWORD(wParam)) sMain = new wxBoxSizer( wxVERTICAL );
{
case IDC_ASPECTRATIO: m_Notebook = new wxNotebook( this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, 0 );
g_Config.iAspectRatio = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_ASPECTRATIO)); m_PageDirect3D = new wxPanel( m_Notebook, ID_DIRERCT3D, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
break; m_PageEnhancements = new wxPanel( m_Notebook, ID_PAGEENHANCEMENTS, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
case IDC_WIDESCREEN_HACK: m_PageAdvanced = new wxPanel( m_Notebook, ID_PAGEADVANCED, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
g_Config.bWidescreenHack = Button_GetCheck(GetDlgItem(hDlg, IDC_WIDESCREEN_HACK)) ? true : false;
break; //D3D Tab
case IDC_SAFE_TEXTURE_CACHE: wxStaticBoxSizer* sbBasic;
g_Config.bSafeTextureCache = Button_GetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE)) == 0 ? false : true; sbBasic = new wxStaticBoxSizer( new wxStaticBox( m_PageDirect3D, wxID_ANY, wxT("Basic") ), wxVERTICAL );
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_SAFE),g_Config.bSafeTextureCache); m_AdapterText = new wxStaticText( m_PageDirect3D, wxID_ANY, wxT("Adapter:"), wxDefaultPosition, wxDefaultSize, 0 );
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_NORMAL),g_Config.bSafeTextureCache); m_AdapterText->Wrap( -1 );
Button_Enable(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_FAST),g_Config.bSafeTextureCache);
break; wxArrayString arrayStringFor_AdapterCB;
case IDC_EFB_ACCESS_ENABLE: for (int i = 0; i < D3D::GetNumAdapters(); ++i)
g_Config.bEFBAccessEnable = Button_GetCheck(GetDlgItem(hDlg, IDC_EFB_ACCESS_ENABLE)) == 0 ? false : true; {
break; const D3D::Adapter &adapter = D3D::GetAdapter(i);
default: arrayStringFor_AdapterCB.Add(wxString::FromAscii(adapter.ident.Description));
break; }
} const D3D::Adapter &adapter = D3D::GetAdapter(g_Config.iAdapter);
}
m_AdapterCB = new wxChoice( m_PageDirect3D, ID_ADAPTER, wxDefaultPosition, wxDefaultSize, arrayStringFor_AdapterCB, 0);
int Notify(HWND hDlg, LPARAM lParam) m_VSync = new wxCheckBox( m_PageDirect3D, ID_VSYNC, wxT("Vsync"), wxPoint( -1,-1 ), wxDefaultSize, 0 );
{ m_WidescreenHack = new wxCheckBox( m_PageDirect3D, ID_WIDESCREEN_HACK, wxT("Widescreen Hack"), wxPoint( -1,-1 ), wxDefaultSize, 0 );
switch (((LPNMHDR)lParam)->code) {
case EN_LINK: m_staticARText = new wxStaticText( m_PageDirect3D, wxID_ANY, wxT("Aspect Ratio:"), wxPoint( -1,-1 ), wxDefaultSize, 0 );
{ m_staticARText->Wrap( -1 );
ENLINK* enl = (ENLINK*)lParam; wxString m_KeepARChoices[] = { wxT("Auto"), wxT("Force 16:9 Widescreen"), wxT("Force 4:3 Standart"), wxT("Stretch to Window") };
if( enl->msg == WM_LBUTTONDOWN ) { int m_KeepARNChoices = sizeof( m_KeepARChoices ) / sizeof( wxString );
TCHAR dxlink[256]; m_KeepAR = new wxChoice( m_PageDirect3D, ID_ASPECT, wxPoint( -1,-1 ), wxDefaultSize, m_KeepARNChoices, m_KeepARChoices, 0 );
TEXTRANGE txtrng = {enl->chrg, dxlink}; m_KeepAR->SetSelection( 0 );
SNDMSG( GetDlgItem(hDlg, IDC_DXCHK), EM_GETTEXTRANGE, 0, (LPARAM)&txtrng );
ShellExecute( NULL, NULL, dxlink, NULL, NULL, SW_SHOWNORMAL ); m_staticMSAAText = new wxStaticText( m_PageDirect3D, wxID_ANY, wxT("SSAA mode:"), wxPoint( -1,-1 ), wxDefaultSize, 0 );
} m_staticMSAAText->Wrap( -1 );
} break; wxArrayString arrayStringFor_MSAAModeCB;
} for (int i = 0; i < (int)adapter.aa_levels.size(); i++)
return 0; {
} arrayStringFor_MSAAModeCB.Add(wxString::FromAscii(adapter.aa_levels[i].name));
}
void Apply(HWND hDlg) m_MSAAModeCB = new wxChoice( m_PageDirect3D, ID_ANTIALIASMODE, wxPoint( -1,-1 ), wxDefaultSize, arrayStringFor_MSAAModeCB, 0);
{ m_EFBScaleText = new wxStaticText( m_PageDirect3D, wxID_ANY, wxT("EFB Scale:"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.iAdapter = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_ADAPTER)); m_EFBScaleText->Wrap( -1 );
g_Config.iMultisampleMode = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_ANTIALIASMODE)); wxString m_EFBScaleModeChoices[] = { wxT("Auto (Fractional)"), wxT("Auto (Integral)"), wxT("1x"), wxT("2x"), wxT("3x") };
g_Config.iEFBScale = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_EFBSCALE)); int m_EFBScaleModeNChoices = sizeof( m_EFBScaleModeChoices ) / sizeof( wxString );
g_Config.bVSync = Button_GetCheck(GetDlgItem(hDlg, IDC_VSYNC)) ? true : false; m_EFBScaleMode = new wxChoice( m_PageDirect3D, ID_EFBSCALEMODE, wxDefaultPosition, wxDefaultSize, m_EFBScaleModeNChoices, m_EFBScaleModeChoices, 0 );
if(Button_GetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_SAFE)))
{ m_EnableEFBAccess = new wxCheckBox( m_PageDirect3D, ID_EFB_ACCESS_ENABLE, wxT("Enable CPU->EFB access"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.iSafeTextureCache_ColorSamples = 0;
} wxStaticBoxSizer* sbSTC;
else sbSTC = new wxStaticBoxSizer( new wxStaticBox( m_PageDirect3D, wxID_ANY, wxT("Safe Texture Cache") ), wxVERTICAL );
{ m_SafeTextureCache = new wxCheckBox( m_PageDirect3D, ID_SAFETEXTURECACHE, wxT("Use Safe Texture Cache"), wxDefaultPosition, wxDefaultSize, 0 );
if(Button_GetCheck(GetDlgItem(hDlg, IDC_SAFE_TEXTURE_CACHE_NORMAL))) m_Radio_SafeTextureCache_Safe = new wxRadioButton( m_PageDirect3D, ID_RADIO_SAFETEXTURECACHE_SAFE, wxT("Safe"), wxDefaultPosition, wxDefaultSize, 0 );
{ m_Radio_SafeTextureCache_Normal = new wxRadioButton( m_PageDirect3D, ID_RADIO_SAFETEXTURECACHE_NORMAL, wxT("Normal"), wxDefaultPosition, wxDefaultSize, 0 );
if(g_Config.iSafeTextureCache_ColorSamples < 512) m_Radio_SafeTextureCache_Fast = new wxRadioButton( m_PageDirect3D, ID_RADIO_SAFETEXTURECACHE_FAST, wxT("Fast"), wxDefaultPosition, wxDefaultSize, 0 );
{
g_Config.iSafeTextureCache_ColorSamples = 512; // Sizers
} wxGridBagSizer* sBasic;
} wxBoxSizer* sGeneral;
else
{ sGeneral = new wxBoxSizer( wxVERTICAL );
if(g_Config.iSafeTextureCache_ColorSamples > 128 || g_Config.iSafeTextureCache_ColorSamples == 0) sBasic = new wxGridBagSizer( 0, 0 );
{ sBasic->SetFlexibleDirection( wxBOTH );
g_Config.iSafeTextureCache_ColorSamples = 128; sBasic->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
} sBasic->Add( m_AdapterText, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
} sBasic->Add( m_AdapterCB, wxGBPosition( 0, 1 ), wxGBSpan( 1, 2 ), wxALL|wxEXPAND, 5 );
} sBasic->Add( m_VSync, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str()); sBasic->Add( m_WidescreenHack, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALL, 5 );
} sBasic->Add( m_staticARText, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
}; sBasic->Add( m_KeepAR, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
sBasic->Add( m_staticMSAAText, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 );
struct TabAdvanced : public W32Util::Tab sBasic->Add( m_MSAAModeCB, wxGBPosition( 3, 1 ), wxGBSpan( 1, 2 ), wxALL, 5 );
{ sBasic->Add( m_EFBScaleText, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
void Init(HWND hDlg) sBasic->Add( m_EFBScaleMode, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
{ sBasic->Add( m_EnableEFBAccess, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
// HWND opt = GetDlgItem(hDlg,IDC_DLOPTLEVEL); sbBasic->Add( sBasic, 0, 0, 5 );
// ComboBox_AddString(opt,"0: Interpret (slowest, most compatible)"); sGeneral->Add( sbBasic, 0, wxEXPAND|wxALL, 5 );
// ComboBox_AddString(opt,"1: Compile lists and decode vertex lists");
//ComboBox_AddString(opt,"2: Compile+decode to vbufs and use hw xform"); wxGridBagSizer* sSTC;
//ComboBox_AddString(opt,"Recompile to vbuffers and shaders"); sSTC = new wxGridBagSizer( 0, 0 );
// ComboBox_SetCurSel(opt,g_Config.iCompileDLsLevel); sSTC->SetFlexibleDirection( wxBOTH );
sSTC->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
Button_SetCheck(GetDlgItem(hDlg,IDC_OSDHOTKEY), g_Config.bOSDHotKey); sSTC->Add( m_SafeTextureCache, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYFPS), g_Config.bShowFPS); sSTC->Add( 0, 0, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND, 5 );
Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS), g_Config.bOverlayStats); sSTC->Add( m_Radio_SafeTextureCache_Safe, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALL, 5 );
Button_SetCheck(GetDlgItem(hDlg,IDC_OVERLAYPROJSTATS), g_Config.bOverlayProjStats); sSTC->Add( m_Radio_SafeTextureCache_Normal, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALL, 5 );
Button_SetCheck(GetDlgItem(hDlg,IDC_WIREFRAME), g_Config.bWireFrame); sSTC->Add( m_Radio_SafeTextureCache_Fast, wxGBPosition( 0, 4 ), wxGBSpan( 1, 1 ), wxALL, 5 );
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXDUMP), g_Config.bDumpTextures); sbSTC->Add( sSTC, 0, wxEXPAND, 5 );
Button_SetCheck(GetDlgItem(hDlg,IDC_DUMPFRAMES), g_Config.bDumpFrames); sGeneral->Add( sbSTC, 0, wxEXPAND|wxALL, 5 );
Button_SetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS), g_Config.bShowShaderErrors);
Button_SetCheck(GetDlgItem(hDlg,IDC_DISABLEFOG), g_Config.bDisableFog); m_PageDirect3D->SetSizer( sGeneral );
Button_SetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY), !g_Config.bEFBCopyDisable); m_PageDirect3D->Layout();
Button_SetCheck(GetDlgItem(hDlg,IDC_ENABLEXFB),g_Config.bUseXFB); sGeneral->Fit( m_PageDirect3D );
Button_SetCheck(GetDlgItem(hDlg,IDC_ENABLEREALXFB),g_Config.bUseRealXFB); m_Notebook->AddPage( m_PageDirect3D, wxT("Direct3D"), true );
Button_SetCheck(GetDlgItem(hDlg,IDC_USENATIVEMIPS),g_Config.bUseNativeMips);
if(g_Config.bCopyEFBToTexture) //Enhancements Tab
Button_SetCheck(GetDlgItem(hDlg,IDC_EFBTOTEX), true); wxStaticBoxSizer* sbTextureFilter;
else sbTextureFilter = new wxStaticBoxSizer( new wxStaticBox( m_PageEnhancements, wxID_ANY, wxT("Texture Filtering") ), wxVERTICAL );
Button_SetCheck(GetDlgItem(hDlg,IDC_EFBTORAM), true); m_ForceFiltering = new wxCheckBox( m_PageEnhancements, ID_FORCEFILTERING, wxT("Force bi/trilinear filtering (Breaks video in several Wii games )"), wxDefaultPosition, wxDefaultSize, 0 );
m_MaxAnisotropy = new wxCheckBox( m_PageEnhancements, ID_FORCEANISOTROPY, wxT("Enable 16x Anisotropy filtering"), wxDefaultPosition, wxDefaultSize, 0 );
m_HiresTextures = new wxCheckBox( m_PageEnhancements, ID_LOADHIRESTEXTURES, wxT("Enable hires Texture loading"), wxDefaultPosition, wxDefaultSize, 0 );
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY), g_Config.bTexFmtOverlayEnable);
Button_SetCheck(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), g_Config.bTexFmtOverlayCenter); wxStaticBoxSizer* sbEFBHacks;
Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY)) ? Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), true) : Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), false); sbEFBHacks = new wxStaticBoxSizer( new wxStaticBox( m_PageEnhancements, wxID_ANY, wxT("EFB Hacks") ), wxVERTICAL );
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), false); m_EFBScaledCopy = new wxCheckBox( m_PageEnhancements, ID_EFBSCALEDCOPY, wxT("EFB Scaled Copy"), wxDefaultPosition, wxDefaultSize, 0 );
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), false);
} // Sizers
void Command(HWND hDlg,WPARAM wParam) wxBoxSizer* sEnhancements;
{ wxGridBagSizer* sTextureFilter;
switch (LOWORD(wParam)) sEnhancements = new wxBoxSizer( wxVERTICAL );
{ sTextureFilter = new wxGridBagSizer( 0, 0 );
case IDC_ENABLEXFB: sTextureFilter->SetFlexibleDirection( wxBOTH );
{ sTextureFilter->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
g_Config.bUseXFB = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEXFB)) ? true : false; sTextureFilter->Add( m_ForceFiltering, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
} sTextureFilter->Add( m_MaxAnisotropy, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
break; sTextureFilter->Add( m_HiresTextures, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
case IDC_ENABLEREALXFB: sbTextureFilter->Add( sTextureFilter, 0, wxEXPAND, 5 );
{ sEnhancements->Add( sbTextureFilter, 0, wxEXPAND|wxALL, 5 );
g_Config.bUseXFB = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEREALXFB)) ? true : (Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEXFB)) ? true : false);
g_Config.bUseRealXFB = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEREALXFB)) ? true : false; wxGridBagSizer* sEFBHacks;
Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEREALXFB)) ? Button_Enable(GetDlgItem(hDlg,IDC_ENABLEXFB), false) : Button_Enable(GetDlgItem(hDlg,IDC_ENABLEXFB), true); sEFBHacks = new wxGridBagSizer( 0, 0 );
} sEFBHacks->SetFlexibleDirection( wxBOTH );
break; sEFBHacks->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
case IDC_ENABLEEFBCOPY: sEFBHacks->Add( m_EFBScaledCopy, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
{ sbEFBHacks->Add( sEFBHacks, 1, wxEXPAND, 5 );
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTORAM), false); sEnhancements->Add( sbEFBHacks, 0, wxEXPAND|wxALL, 5 );
Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), true) : Button_Enable(GetDlgItem(hDlg,IDC_EFBTOTEX), false);
} m_PageEnhancements->SetSizer( sEnhancements );
break; m_PageEnhancements->Layout();
case IDC_TEXFMT_OVERLAY: sEnhancements->Fit( m_PageEnhancements );
{ m_Notebook->AddPage( m_PageEnhancements, wxT("Enhancements"), false );
Button_GetCheck(GetDlgItem(hDlg, IDC_TEXFMT_OVERLAY)) ? Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), true) : Button_Enable(GetDlgItem(hDlg,IDC_TEXFMT_CENTER), false);
} //Advanced Tab
break; wxStaticBoxSizer* sbSettings;
default: sbSettings = new wxStaticBoxSizer( new wxStaticBox( m_PageAdvanced, wxID_ANY, wxT("Settings") ), wxVERTICAL );
break; m_DisableFog = new wxCheckBox( m_PageAdvanced, ID_DISABLEFOG, wxT("Disable Fog"), wxDefaultPosition, wxDefaultSize, 0 );
} m_OverlayFPS = new wxCheckBox( m_PageAdvanced, ID_OVERLAYFPS, wxT("Overlay FPS Counter"), wxDefaultPosition, wxDefaultSize, 0 );
} m_CopyEFB = new wxCheckBox( m_PageAdvanced, ID_ENABLEEFBCOPY, wxT("Enable EFB Copy"), wxDefaultPosition, wxDefaultSize, 0 );
void Apply(HWND hDlg) m_EnableHotkeys = new wxCheckBox( m_PageAdvanced, ID_ENABLEHOTKEY, wxT("Enable Hotkey"), wxDefaultPosition, wxDefaultSize, 0 );
{ m_Radio_CopyEFBToRAM = new wxRadioButton( m_PageAdvanced, ID_EFBTORAM, wxT("To Ram"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.bTexFmtOverlayEnable = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_OVERLAY)) ? true : false; m_Radio_CopyEFBToGL = new wxRadioButton( m_PageAdvanced, ID_EFBTOTEX, wxT("To Texture"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.bTexFmtOverlayCenter = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXFMT_CENTER)) ? true : false; m_WireFrame = new wxCheckBox( m_PageAdvanced, ID_WIREFRAME, wxT("Enable Wireframe"), wxDefaultPosition, wxDefaultSize, 0 );
m_EnableRealXFB = new wxCheckBox( m_PageAdvanced, ID_ENABLEREALXFB, wxT("Enable Real XFB"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.bOSDHotKey = Button_GetCheck(GetDlgItem(hDlg,IDC_OSDHOTKEY)) ? true : false; m_EnableXFB = new wxCheckBox( m_PageAdvanced, ID_ENABLEXFB, wxT("Enable XFB"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.bShowFPS = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYFPS)) ? true : false; m_UseNativeMips = new wxCheckBox( m_PageAdvanced, ID_USENATIVEMIPS, wxT("Use Native Mips"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.bOverlayStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYSTATS)) ? true : false;
g_Config.bOverlayProjStats = Button_GetCheck(GetDlgItem(hDlg,IDC_OVERLAYPROJSTATS)) ? true : false; wxStaticBoxSizer* sbDataDumping;
g_Config.bWireFrame = Button_GetCheck(GetDlgItem(hDlg,IDC_WIREFRAME)) ? true : false; sbDataDumping = new wxStaticBoxSizer( new wxStaticBox( m_PageAdvanced, wxID_ANY, wxT("Data Dumping") ), wxVERTICAL );
g_Config.bDumpTextures = Button_GetCheck(GetDlgItem(hDlg,IDC_TEXDUMP)) ? true : false; m_DumpTextures = new wxCheckBox( m_PageAdvanced, ID_TEXDUMP, wxT("Dump Textures"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.bDumpFrames = Button_GetCheck(GetDlgItem(hDlg,IDC_DUMPFRAMES)) ? true : false; m_DumpFrames = new wxCheckBox( m_PageAdvanced, ID_DUMPFRAMES, wxT("Dump Frames To User/Dump/Frames"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.bShowShaderErrors = Button_GetCheck(GetDlgItem(hDlg,IDC_SHOWSHADERERRORS)) ? true : false;
g_Config.bDisableFog = Button_GetCheck(GetDlgItem(hDlg,IDC_DISABLEFOG)) ? true : false; wxStaticBoxSizer* sbDebuggingTools;
g_Config.bEFBCopyDisable = Button_GetCheck(GetDlgItem(hDlg,IDC_ENABLEEFBCOPY)) ? false : true; sbDebuggingTools = new wxStaticBoxSizer( new wxStaticBox( m_PageAdvanced, wxID_ANY, wxT("Debugging tools") ), wxVERTICAL );
g_Config.bCopyEFBToTexture = Button_GetCheck(GetDlgItem(hDlg,IDC_EFBTORAM)) ? false : true; m_OverlayStats = new wxCheckBox( m_PageAdvanced, ID_OVERLAYSTATS, wxT("Overlay Some Statics"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.bUseXFB = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEXFB)) ? true : false; m_ShaderErrors = new wxCheckBox( m_PageAdvanced, ID_SHADERERRORS, wxT("Show Shader Compilation Errors"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.bUseRealXFB = Button_GetCheck(GetDlgItem(hDlg, IDC_ENABLEREALXFB)) ? true : false; m_ShaderErrors->Enable( false );
g_Config.bUseNativeMips = Button_GetCheck(GetDlgItem(hDlg, IDC_USENATIVEMIPS)) ? true : false; m_TexfmtOverlay = new wxCheckBox( m_PageAdvanced, ID_TEXFMT_OVERLAY, wxT("Enable TexFmt Overlay"), wxDefaultPosition, wxDefaultSize, 0 );
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str()); m_TexfmtCenter = new wxCheckBox( m_PageAdvanced, ID_TEXFMT_CENTER, wxT("Centered"), wxDefaultPosition, wxDefaultSize, 0 );
m_ProjStats = new wxCheckBox( m_PageAdvanced, wxID_ANY, wxT("Overlay Projection Stats"), wxDefaultPosition, wxDefaultSize, 0 );
if( D3D::dev != NULL ) {
D3D::SetRenderState( D3DRS_FILLMODE, g_Config.bWireFrame ? D3DFILL_WIREFRAME : D3DFILL_SOLID ); // Sizers
} wxBoxSizer* sAdvanced;
} sAdvanced = new wxBoxSizer( wxVERTICAL );
};
wxGridBagSizer* sSettings;
struct TabEnhancements : public W32Util::Tab sSettings = new wxGridBagSizer( 0, 0 );
{ sSettings->SetFlexibleDirection( wxBOTH );
void Init(HWND hDlg) sSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
{ sSettings->Add( m_DisableFog, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
Button_SetCheck(GetDlgItem(hDlg, IDC_FORCEFILTERING),g_Config.bForceFiltering); sSettings->Add( m_OverlayFPS, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxLEFT, 20 );
Button_SetCheck(GetDlgItem(hDlg, IDC_FORCEANISOTROPY),g_Config.iMaxAnisotropy > 1); sSettings->Add( m_CopyEFB, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
Button_SetCheck(GetDlgItem(hDlg, IDC_LOADHIRESTEXTURE), g_Config.bHiresTextures); sSettings->Add( m_EnableHotkeys, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxLEFT, 20 );
Button_SetCheck(GetDlgItem(hDlg, IDC_EFBSCALEDCOPY), g_Config.bCopyEFBScaled); sSettings->Add( m_Radio_CopyEFBToRAM, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
sSettings->Add( m_Radio_CopyEFBToGL, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP, 10 );
/* sSettings->Add( m_WireFrame, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxLEFT, 20 );
Temporarily disabled the old postprocessing code since it wasn't working anyway. sSettings->Add( m_EnableRealXFB, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxLEFT, 20 );
New postprocessing code will come sooner or later, sharing shaders and framework with sSettings->Add( m_EnableXFB, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
the GL postprocessing. sSettings->Add( m_UseNativeMips, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
sbSettings->Add( sSettings, 0, wxEXPAND, 5 );
HWND pp = GetDlgItem(hDlg, IDC_POSTPROCESSEFFECT); sAdvanced->Add( sbSettings, 0, wxEXPAND|wxALL, 5 );
const char **names = Postprocess::GetPostprocessingNames();
int i = 0; wxGridBagSizer* sDataDumping;
while (true) sDataDumping = new wxGridBagSizer( 0, 0 );
{ sDataDumping->SetFlexibleDirection( wxBOTH );
if (!names[i]) sDataDumping->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
break; sDataDumping->Add( m_DumpTextures, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
sDataDumping->Add( m_DumpFrames, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, names[i], -1, tempwstr, 2000); sbDataDumping->Add( sDataDumping, 0, wxEXPAND, 5 );
ComboBox_AddString(pp, tempwstr); sAdvanced->Add( sbDataDumping, 0, wxEXPAND|wxALL, 5 );
i++;
} wxGridBagSizer* sDebuggingTools;
ComboBox_SetCurSel(pp, g_Config.iPostprocessEffect); sDebuggingTools = new wxGridBagSizer( 0, 0 );
*/ sDebuggingTools->SetFlexibleDirection( wxBOTH );
} sDebuggingTools->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
void Command(HWND hDlg, WPARAM wParam) sDebuggingTools->Add( m_OverlayStats, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
{ sDebuggingTools->Add( m_ShaderErrors, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
/* sDebuggingTools->Add( m_TexfmtOverlay, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
switch (LOWORD(wParam)) sDebuggingTools->Add( m_TexfmtCenter, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
{ sDebuggingTools->Add( m_ProjStats, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 );
default: sbDebuggingTools->Add( sDebuggingTools, 0, wxEXPAND, 5 );
break; sAdvanced->Add( sbDebuggingTools, 0, wxEXPAND|wxALL, 5 );
}
*/ m_PageAdvanced->SetSizer( sAdvanced );
} m_PageAdvanced->Layout();
void Apply(HWND hDlg) sAdvanced->Fit( m_PageAdvanced );
{ m_Notebook->AddPage( m_PageAdvanced, wxT("Advanced"), false );
g_Config.iMaxAnisotropy = Button_GetCheck(GetDlgItem(hDlg, IDC_FORCEANISOTROPY)) ? 8 : 1;
g_Config.bForceFiltering = Button_GetCheck(GetDlgItem(hDlg, IDC_FORCEFILTERING)) ? true : false; sMain->Add( m_Notebook, 1, wxALL|wxEXPAND, 5 );
g_Config.bHiresTextures = Button_GetCheck(GetDlgItem(hDlg, IDC_LOADHIRESTEXTURE)) ? true : false;
g_Config.bCopyEFBScaled = Button_GetCheck(GetDlgItem(hDlg, IDC_EFBSCALEDCOPY)) ? true : false; //Buttons
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str()); wxBoxSizer* sButtons;
} sButtons = new wxBoxSizer( wxVERTICAL );
}; m_Close = new wxButton( this, ID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 );
sButtons->Add( m_Close, 0, wxALL|wxEXPAND, 5 );
sMain->Add( sButtons, 0, wxALIGN_RIGHT, 5 );
void DlgSettings_Show(HINSTANCE hInstance, HWND _hParent)
{ this->SetSizer( sMain );
bool tfoe = g_Config.bTexFmtOverlayEnable; this->Layout();
bool tfoc = g_Config.bTexFmtOverlayCenter;
InitializeGUIValues();
g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
W32Util::PropSheet sheet; Fit();
sheet.Add(new TabDirect3D, (LPCTSTR)IDD_SETTINGS,_T("Direct3D")); Center();
sheet.Add(new TabEnhancements, (LPCTSTR)IDD_ENHANCEMENTS,_T("Enhancements")); UpdateGUI();
sheet.Add(new TabAdvanced, (LPCTSTR)IDD_ADVANCED,_T("Advanced")); }
void GFXConfigDialogDX::DirectXSettingsChanged(wxCommandEvent& event)
#ifdef DEBUGFAST {
sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin (DEBUGFAST)")); switch (event.GetId())
#elif defined _DEBUG {
sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin (DEBUG)")); case ID_ADAPTER:
#else g_Config.iAdapter = m_AdapterCB->GetSelection();
sheet.Show(hInstance,_hParent,_T("DX9 Graphics Plugin")); break;
#endif case ID_VSYNC:
g_Config.bVSync = m_VSync->IsChecked();
if ((tfoe != g_Config.bTexFmtOverlayEnable) || break;
((g_Config.bTexFmtOverlayEnable) && ( tfoc != g_Config.bTexFmtOverlayCenter))) case ID_WIDESCREEN_HACK:
{ g_Config.bWidescreenHack = m_WidescreenHack->IsChecked();
TextureCache::Invalidate(false); break;
} case ID_ASPECT:
g_Config.iAspectRatio = m_KeepAR->GetSelection();
break;
case ID_ANTIALIASMODE:
g_Config.iMultisampleMode = m_MSAAModeCB->GetSelection();
break;
case ID_EFBSCALEMODE:
g_Config.iEFBScale = m_EFBScaleMode->GetSelection();
break;
case ID_EFB_ACCESS_ENABLE:
g_Config.bEFBAccessEnable = m_EnableEFBAccess->IsChecked();
break;
case ID_SAFETEXTURECACHE:
g_Config.bSafeTextureCache = m_SafeTextureCache->IsChecked();
break;
case ID_RADIO_SAFETEXTURECACHE_SAFE:
g_Config.iSafeTextureCache_ColorSamples = 0;
break;
case ID_RADIO_SAFETEXTURECACHE_NORMAL:
if(g_Config.iSafeTextureCache_ColorSamples < 512)
g_Config.iSafeTextureCache_ColorSamples = 512;
break;
case ID_RADIO_SAFETEXTURECACHE_FAST:
if(g_Config.iSafeTextureCache_ColorSamples > 128 || g_Config.iSafeTextureCache_ColorSamples == 0)
g_Config.iSafeTextureCache_ColorSamples = 128;
break;
}
UpdateGUI();
}
void GFXConfigDialogDX::EnhancementsSettingsChanged(wxCommandEvent& event)
{
switch (event.GetId())
{
case ID_FORCEFILTERING:
g_Config.bForceFiltering = m_ForceFiltering->IsChecked();
break;
case ID_FORCEANISOTROPY:
g_Config.iMaxAnisotropy = m_MaxAnisotropy->IsChecked() ? 8 : 1;
break;
case ID_LOADHIRESTEXTURES:
g_Config.bHiresTextures = m_HiresTextures->IsChecked();
break;
case ID_EFBSCALEDCOPY:
g_Config.bCopyEFBScaled = m_EFBScaledCopy->IsChecked();
break;
}
UpdateGUI();
}
void GFXConfigDialogDX::AdvancedSettingsChanged(wxCommandEvent& event)
{
switch (event.GetId())
{
case ID_DISABLEFOG:
g_Config.bDisableFog = m_DisableFog->IsChecked();
break;
case ID_OVERLAYFPS:
g_Config.bShowFPS = m_OverlayFPS->IsChecked();
break;
case ID_ENABLEEFBCOPY:
g_Config.bEFBCopyDisable = !m_CopyEFB->IsChecked();
break;
case ID_EFBTORAM:
g_Config.bCopyEFBToTexture = false;
break;
case ID_EFBTOTEX:
g_Config.bCopyEFBToTexture = true;
break;
case ID_ENABLEHOTKEY:
g_Config.bOSDHotKey = m_EnableHotkeys->IsChecked();
break;
case ID_WIREFRAME:
g_Config.bWireFrame = m_WireFrame->IsChecked();
break;
case ID_ENABLEXFB:
g_Config.bUseXFB = m_EnableXFB->IsChecked();
break;
case ID_ENABLEREALXFB:
g_Config.bUseRealXFB = m_EnableRealXFB->IsChecked();
break;
case ID_USENATIVEMIPS:
g_Config.bUseNativeMips = m_UseNativeMips->IsChecked();
break;
case ID_TEXDUMP:
g_Config.bDumpTextures = m_DumpTextures->IsChecked();
break;
case ID_DUMPFRAMES:
g_Config.bDumpFrames = m_DumpFrames->IsChecked();
break;
case ID_OVERLAYSTATS:
g_Config.bOverlayStats = m_OverlayStats->IsChecked();
break;
case ID_PROJSTATS:
g_Config.bOverlayProjStats = m_ProjStats->IsChecked();
break;
case ID_SHADERERRORS:
g_Config.bShowShaderErrors = m_ShaderErrors->IsChecked();
break;
case ID_TEXFMT_OVERLAY:
g_Config.bTexFmtOverlayEnable = m_TexfmtOverlay->IsChecked();
break;
case ID_TEXFMT_CENTER:
g_Config.bTexFmtOverlayCenter = m_TexfmtCenter->IsChecked();
break;
}
UpdateGUI();
}
void GFXConfigDialogDX::CloseWindow()
{
// Save the config to INI
g_Config.Save((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
EndModal(1);
}
void GFXConfigDialogDX::UpdateGUI()
{
if (g_Config.bUseRealXFB)
{
// must use XFB to use real XFB
g_Config.bUseXFB = true;
m_EnableXFB->SetValue(true);
}
m_EnableXFB->Enable(!g_Config.bUseRealXFB);
m_TexfmtCenter->Enable(g_Config.bTexFmtOverlayEnable);
// Disable the Copy to options when EFBCopy is disabled
m_Radio_CopyEFBToRAM->Enable(!g_Config.bEFBCopyDisable);
m_Radio_CopyEFBToGL->Enable(!g_Config.bEFBCopyDisable);
// Disable/Enable Safe Texture Cache options
m_Radio_SafeTextureCache_Safe->Enable(g_Config.bSafeTextureCache);
m_Radio_SafeTextureCache_Normal->Enable(g_Config.bSafeTextureCache);
m_Radio_SafeTextureCache_Fast->Enable(g_Config.bSafeTextureCache);
} }

View File

@ -15,6 +15,175 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#pragma once #ifndef _DX_DLGSETTINGS_H_
#define _DX_DLGSETTINGS_H_
#include <wx/wx.h>
#include <wx/dialog.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/combobox.h>
#include <wx/checkbox.h>
#include <wx/notebook.h>
#include <wx/panel.h>
#include <wx/filepicker.h>
#include <wx/gbsizer.h>
void DlgSettings_Show(HINSTANCE hInstance, HWND parent); class GFXConfigDialogDX : public wxDialog
{
public:
GFXConfigDialogDX(wxWindow *parent, wxWindowID id = 1,
#ifdef DEBUGFAST
const wxString &title = wxT("DX (DEBUGFAST) Plugin Configuration"),
#else
#ifndef _DEBUG
const wxString &title = wxT("DX Plugin Configuration"),
#else
const wxString &title = wxT("DX (DEBUG) Plugin Configuration"),
#endif
#endif
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE);
virtual ~GFXConfigDialogDX();
void CreateGUIControls();
void CloseClick(wxCommandEvent& WXUNUSED (event));
private:
DECLARE_EVENT_TABLE();
wxBoxSizer* sGeneral;
wxStaticBoxSizer* sbBasic;
wxGridBagSizer* sBasic;
wxStaticBoxSizer* sbSTC;
wxGridBagSizer* sSTC;
wxBoxSizer* sEnhancements;
wxStaticBoxSizer* sbTextureFilter;
wxGridBagSizer* sTextureFilter;
wxStaticBoxSizer* sbEFBHacks;
wxGridBagSizer* sEFBHacks;
wxBoxSizer* sAdvanced;
wxStaticBoxSizer* sbSettings;
wxGridBagSizer* sSettings;
wxStaticBoxSizer* sbDataDumping;
wxGridBagSizer* sDataDumping;
wxStaticBoxSizer* sbDebuggingTools;
wxGridBagSizer* sDebuggingTools;
wxButton *m_Close;
wxNotebook *m_Notebook;
wxPanel *m_PageDirect3D;
wxPanel *m_PageEnhancements;
wxPanel *m_PageAdvanced;
//Direct3D Tab
wxStaticText* m_AdapterText;
wxChoice *m_AdapterCB;
wxArrayString arrayStringFor_AdapterCB;
wxArrayString arrayStringFor_MSAAModeCB;
wxCheckBox *m_VSync;
wxCheckBox *m_WidescreenHack;
wxStaticText* m_staticARText;
wxChoice *m_KeepAR;
wxStaticText* m_staticMSAAText;
wxChoice *m_MSAAModeCB;
wxStaticText* m_EFBScaleText;
wxChoice *m_EFBScaleMode;
wxCheckBox *m_EnableEFBAccess;
wxCheckBox *m_SafeTextureCache;
wxRadioButton *m_Radio_SafeTextureCache_Fast;
wxRadioButton *m_Radio_SafeTextureCache_Normal;
wxRadioButton *m_Radio_SafeTextureCache_Safe;
//Enhancements Tab
wxCheckBox *m_ForceFiltering;
wxCheckBox *m_MaxAnisotropy;
wxCheckBox *m_HiresTextures;
wxCheckBox *m_EFBScaledCopy;
//Advanced Tab
wxCheckBox *m_DisableFog;
wxCheckBox *m_OverlayFPS;
wxCheckBox *m_CopyEFB;
wxRadioButton *m_Radio_CopyEFBToRAM;
wxRadioButton *m_Radio_CopyEFBToGL;
wxCheckBox *m_EnableHotkeys;
wxCheckBox *m_WireFrame;
wxCheckBox *m_EnableXFB;
wxCheckBox *m_EnableRealXFB;
wxCheckBox *m_UseNativeMips;
wxCheckBox *m_DumpTextures;
wxCheckBox *m_DumpFrames;
wxCheckBox *m_OverlayStats;
wxCheckBox *m_ProjStats;
wxCheckBox *m_ShaderErrors;
wxCheckBox *m_TexfmtOverlay;
wxCheckBox *m_TexfmtCenter;
enum
{
ID_CLOSE,
ID_ADAPTER,
ID_VSYNC,
ID_WIDESCREEN_HACK,
ID_ASPECT,
ID_FULLSCREENRESOLUTION,
ID_ANTIALIASMODE,
ID_EFBSCALEMODE,
ID_EFB_ACCESS_ENABLE,
ID_SAFETEXTURECACHE,
ID_RADIO_SAFETEXTURECACHE_SAFE,
ID_RADIO_SAFETEXTURECACHE_NORMAL,
ID_RADIO_SAFETEXTURECACHE_FAST,
ID_FORCEFILTERING,
ID_FORCEANISOTROPY,
ID_LOADHIRESTEXTURES,
ID_EFBSCALEDCOPY,
ID_DISABLEFOG,
ID_OVERLAYFPS,
ID_ENABLEEFBCOPY,
ID_EFBTORAM,
ID_EFBTOTEX,
ID_ENABLEHOTKEY,
ID_WIREFRAME,
ID_ENABLEXFB,
ID_ENABLEREALXFB,
ID_USENATIVEMIPS,
ID_TEXDUMP,
ID_DUMPFRAMES,
ID_OVERLAYSTATS,
ID_PROJSTATS,
ID_SHADERERRORS,
ID_TEXFMT_OVERLAY,
ID_TEXFMT_CENTER,
ID_CHECK1,
ID_LIST1,
ID_DEBUGSTEP,
ID_REGISTERS,
ID_ENABLEDEBUGGING,
ID_REGISTERSELECT,
ID_ARTEXT,
ID_NOTEBOOK = 1000,
ID_DEBUGGER,
ID_ABOUT,
ID_DIRERCT3D,
ID_PAGEENHANCEMENTS,
ID_PAGEADVANCED
};
void InitializeAdapters();
void OnClose(wxCloseEvent& event);
void InitializeGUIValues();
void DirectXSettingsChanged(wxCommandEvent& event);
void EnhancementsSettingsChanged(wxCommandEvent& event);
void AdvancedSettingsChanged(wxCommandEvent& event);
void CloseWindow();
void UpdateGUI();
};
#endif //_DX_DLGSETTINGS_H_

View File

@ -1118,7 +1118,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
else else
{ {
char msg [255]; char msg [255];
sprintf(msg, "Dumping Frames to \"%sframedump0.avi\" (%dx%d RGB24)", File::GetUserPath(D_DUMPFRAMES_IDX), s_recordWidth, s_recordHeight); sprintf_s(msg,255, "Dumping Frames to \"%sframedump0.avi\" (%dx%d RGB24)", File::GetUserPath(D_DUMPFRAMES_IDX), s_recordWidth, s_recordHeight);
OSD::AddMessage(msg, 2000); OSD::AddMessage(msg, 2000);
} }
} }
@ -1397,7 +1397,7 @@ void Renderer::SetInterlacingMode()
void Renderer::SetScreenshot(const char *filename) void Renderer::SetScreenshot(const char *filename)
{ {
s_criticalScreenshot.Enter(); s_criticalScreenshot.Enter();
strcpy(s_sScreenshotName,filename); strcpy_s(s_sScreenshotName,filename);
s_bScreenshot = true; s_bScreenshot = true;
s_criticalScreenshot.Leave(); s_criticalScreenshot.Leave();
} }

View File

@ -21,6 +21,13 @@
#include "LogManager.h" #include "LogManager.h"
#include "debugger/debugger.h" #include "debugger/debugger.h"
#if defined(HAVE_WX) && HAVE_WX
#include "DlgSettings.h"
GFXConfigDialogDX *m_ConfigFrame = NULL;
#endif // HAVE_WX
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
#include "Debugger/Debugger.h" #include "Debugger/Debugger.h"
GFXDebuggerDX9 *m_DebuggerFrame = NULL; GFXDebuggerDX9 *m_DebuggerFrame = NULL;
@ -205,8 +212,33 @@ void DllConfig(HWND _hParent)
// If not initialized, only init D3D so we can enumerate resolutions. // If not initialized, only init D3D so we can enumerate resolutions.
if (!s_PluginInitialized) if (!s_PluginInitialized)
D3D::Init(); D3D::Init();
HINSTANCE hREd = LoadLibrary(_T("riched20.dll")); g_Config.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "gfx_dx9.ini").c_str());
DlgSettings_Show(g_hInstance, _hParent); g_Config.GameIniLoad(globals->game_ini);
UpdateActiveConfig();
#if defined(HAVE_WX) && HAVE_WX
wxWindow *frame = GetParentedWxWindow(_hParent);
m_ConfigFrame = new GFXConfigDialogDX(frame);
// Prevent user to show more than 1 config window at same time
#ifdef _WIN32
frame->Disable();
m_ConfigFrame->CreateGUIControls();
m_ConfigFrame->ShowModal();
frame->Enable();
#else
m_ConfigFrame->CreateGUIControls();
m_ConfigFrame->ShowModal();
#endif
#ifdef _WIN32
frame->SetFocus();
frame->SetHWND(NULL);
#endif
m_ConfigFrame->Destroy();
m_ConfigFrame = NULL;
frame->Destroy();
#endif
if (!s_PluginInitialized) if (!s_PluginInitialized)
D3D::Shutdown(); D3D::Shutdown();
} }
@ -341,7 +373,6 @@ void VideoFifo_CheckSwapRequest()
{ {
Renderer::Swap(s_beginFieldArgs.xfbAddr, s_beginFieldArgs.field, s_beginFieldArgs.fbWidth, s_beginFieldArgs.fbHeight); Renderer::Swap(s_beginFieldArgs.xfbAddr, s_beginFieldArgs.field, s_beginFieldArgs.fbWidth, s_beginFieldArgs.fbHeight);
} }
Common::AtomicStoreRelease(s_swapRequested, FALSE); Common::AtomicStoreRelease(s_swapRequested, FALSE);
} }
} }

View File

@ -1,54 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Resource.rc
//
#define IDD_ABOUT 102
#define IDD_SETTINGS 103
#define IDD_ENHANCEMENTS 104
#define IDD_ADVANCED 105
#define IDC_ADAPTER 1001
#define IDC_ANTIALIASMODE 1002
#define IDC_ANTIALIASMODE2 1003
#define IDC_EFBSCALE 1003
#define IDC_VSYNC 1006
#define IDC_WIDESCREEN_HACK 1010
#define IDC_SAFE_TEXTURE_CACHE 1011
#define IDC_EFB_ACCESS_ENABLE 1012
#define IDC_WIREFRAME 1013
#define IDC_DISABLEFOG 1014
#define IDC_OVERLAYFPS 1015
#define IDC_OVERLAYSTATS 1016
#define IDC_OVERLAYPROJSTATS 1017
#define IDC_ENABLEEFBCOPY 1018
#define IDC_EFBTORAM 1019
#define IDC_EFBTOTEX 1020
#define IDC_TEXDUMP 1021
#define IDC_DUMPFRAMES 1022
#define IDC_SHOWSHADERERRORS 1023
#define IDC_TEXFMT_OVERLAY 1024
#define IDC_TEXFMT_CENTER 1025
#define IDC_FORCEFILTERING 1026
#define IDC_ENABLEXFB 1026
#define IDC_FORCEANISOTROPY 1027
#define IDC_ENABLEREALXFB 1027
#define IDC_LOADHIRESTEXTURE 1028
#define IDC_EFBSCALEDCOPY 1029
#define IDC_OSDHOTKEY 1030
#define IDC_ASPECTRATIO 1040
#define IDC_SAFE_TEXTURE_CACHE_SAFE 1041
#define IDC_SAFE_TEXTURE_CACHE_NORMAL 1042
#define IDC_SAFE_TEXTURE_CACHE_FAST 1043
#define IDC_DXCHK 1046
#define IDC_USENATIVEMIPS 1100
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1047
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -1,198 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include <windows.h>
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUT DIALOGEX 0, 0, 188, 81
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dolphin D3D9 Video Plugin"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Close",IDOK,131,60,50,14
LTEXT "Code by ector",IDC_STATIC,7,7,85,9
LTEXT "Hardware requirements: Radeon 9500 or better, or Geforce FX5200 or better.\nRadeon recommended.",IDC_STATIC,7,19,174,26
LTEXT "Will not work correctly on older GPU:s.",IDC_STATIC,7,47,170,8
END
IDD_SETTINGS DIALOGEX 0, 0, 244, 183
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "&Graphics card:",IDC_STATIC,7,7,49,8
COMBOBOX IDC_ADAPTER,61,7,176,48,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "&V-Sync",IDC_VSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,61,25,36,8
CONTROL "&Widescreen Hack",IDC_WIDESCREEN_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,25,67,10
LTEXT "&Aspect Ratio:",IDC_STATIC,7,40,48,8
COMBOBOX IDC_ASPECTRATIO,61,39,89,57,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "SSAA mode:",IDC_STATIC,7,61,46,8
COMBOBOX IDC_ANTIALIASMODE,61,59,48,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "&Enable CPU->EFB access ",IDC_EFB_ACCESS_ENABLE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,80,94,11
GROUPBOX "Safe Texture Cache Mode",IDC_STATIC,109,94,125,27
CONTROL "&Safe Texture Cache",IDC_SAFE_TEXTURE_CACHE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,104,80,11
CONTROL "Safe",IDC_SAFE_TEXTURE_CACHE_SAFE,"Button",BS_AUTORADIOBUTTON,117,105,27,10
CONTROL "Normal",IDC_SAFE_TEXTURE_CACHE_NORMAL,"Button",BS_AUTORADIOBUTTON,154,105,38,10
CONTROL "Fast",IDC_SAFE_TEXTURE_CACHE_FAST,"Button",BS_AUTORADIOBUTTON,198,105,30,10
CONTROL "",IDC_DXCHK,"RichEdit20W",ES_MULTILINE | ES_READONLY | WS_BORDER | WS_TABSTOP,30,126,186,50
COMBOBOX IDC_EFBSCALE,161,59,76,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "EFB Scale:",IDC_STATIC,127,61,34,8
END
IDD_ADVANCED DIALOGEX 0, 0, 244, 200
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
GROUPBOX "&Settings",IDC_STATIC,6,7,228,89
CONTROL "Overlay FPS counter",IDC_OVERLAYFPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,18,82,8
CONTROL "&Overlay some statistics",IDC_OVERLAYSTATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,155,90,8
CONTROL "Show s&hader compilation errors",IDC_SHOWSHADERERRORS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,169,114,8
CONTROL "Enable &Wireframe",IDC_WIREFRAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,48,87,8
CONTROL "Disable Fog",IDC_DISABLEFOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,18,78,8
CONTROL "Enable Hotkey",IDC_OSDHOTKEY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,33,87,8
CONTROL "Enable EFB copy",IDC_ENABLEEFBCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,33,81,8
CONTROL "To RAM",IDC_EFBTORAM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,29,44,59,10
CONTROL "To Texture",IDC_EFBTOTEX,"Button",BS_AUTORADIOBUTTON,29,57,60,10
GROUPBOX "&Data dumping",IDC_STATIC,7,100,228,41
CONTROL "Dump &textures",IDC_TEXDUMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,111,70,9
CONTROL "Dump Frames to User/Dump/Frames",IDC_DUMPFRAMES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,125,138,9
GROUPBOX "Debugging Tools",IDC_STATIC,7,143,228,51
CONTROL "Enable TexFmt Overlay",IDC_TEXFMT_OVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,182,92,10
CONTROL "Centered",IDC_TEXFMT_CENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,183,52,10
CONTROL "Enable XFB",IDC_ENABLEXFB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,71,81,8
CONTROL "Enable Real XFB",IDC_ENABLEREALXFB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,114,71,81,8
CONTROL "Use Native Mips",IDC_USENATIVEMIPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,83,67,10
END
IDD_ENHANCEMENTS DIALOGEX 0, 0, 224, 175
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
GROUPBOX "Texture &filtering",IDC_STATIC,7,7,210,60
CONTROL "Force &bi/trilinear (breaks video in several Wii games)",IDC_FORCEFILTERING,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,20,192,9
CONTROL "Enable 16x &anisotropy filtering",IDC_FORCEANISOTROPY,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,35,110,10
CONTROL "Enable hires texture loading",IDC_LOADHIRESTEXTURE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,50,110,11
GROUPBOX "EFB Hacks",IDC_STATIC,7,70,210,27
CONTROL "EFB Scaled Copy",IDC_EFBSCALEDCOPY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,80,110,12
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_ABOUT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 181
TOPMARGIN, 7
BOTTOMMARGIN, 74
END
IDD_SETTINGS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 237
VERTGUIDE, 7
VERTGUIDE, 61
VERTGUIDE, 109
VERTGUIDE, 161
TOPMARGIN, 7
BOTTOMMARGIN, 176
END
IDD_ADVANCED, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 237
VERTGUIDE, 14
VERTGUIDE, 29
VERTGUIDE, 114
TOPMARGIN, 7
BOTTOMMARGIN, 195
HORZGUIDE, 18
HORZGUIDE, 33
HORZGUIDE, 49
HORZGUIDE, 156
END
IDD_ENHANCEMENTS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 217
VERTGUIDE, 16
VERTGUIDE, 74
TOPMARGIN, 7
BOTTOMMARGIN, 168
END
END
#endif // APSTUDIO_INVOKED
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include <windows.h>\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED