2008-07-23 15:20:36 +00:00
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
2008-07-23 16:20:12 +00:00
2008-07-23 15:20:36 +00:00
# include "ConfigDlg.h"
2008-07-24 13:40:07 +00:00
# include "../Globals.h"
2008-10-23 09:11:26 +00:00
# include "../Config.h"
2008-07-23 15:20:36 +00:00
2008-08-06 09:48:54 +00:00
# include "../TextureMngr.h"
2008-08-06 01:08:02 +00:00
2008-07-23 15:20:36 +00:00
BEGIN_EVENT_TABLE ( ConfigDialog , wxDialog )
EVT_CLOSE ( ConfigDialog : : OnClose )
2008-08-06 01:08:02 +00:00
EVT_BUTTON ( ID_CANCEL , ConfigDialog : : OKClick )
2008-07-23 15:20:36 +00:00
EVT_BUTTON ( ID_OK , ConfigDialog : : OKClick )
2008-11-04 09:56:25 +00:00
EVT_BUTTON ( ID_ABOUTOGL , ConfigDialog : : AboutClick )
EVT_CHECKBOX ( ID_FULLSCREEN , ConfigDialog : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_RENDERTOMAINWINDOW , ConfigDialog : : GeneralSettingsChanged )
EVT_COMBOBOX ( ID_FULLSCREENCB , ConfigDialog : : GeneralSettingsChanged )
EVT_COMBOBOX ( ID_WINDOWRESOLUTIONCB , ConfigDialog : : GeneralSettingsChanged )
EVT_COMBOBOX ( ID_ALIASMODECB , ConfigDialog : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_FORCEFILTERING , ConfigDialog : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_FORCEANISOTROPY , ConfigDialog : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_STRETCHTOFIT , ConfigDialog : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_KEEPAR , ConfigDialog : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_WIREFRAME , ConfigDialog : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_SHOWFPS , ConfigDialog : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_STATISTICS , ConfigDialog : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_SHADERERRORS , ConfigDialog : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_TEXFMTOVERLAY , ConfigDialog : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_TEXFMTCENTER , ConfigDialog : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_USEXFB , ConfigDialog : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_DUMPTEXTURES , ConfigDialog : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_DISABLELIGHTING , ConfigDialog : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_DISABLETEXTURING , ConfigDialog : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_EFBTOTEXTUREDISABLE , ConfigDialog : : AdvancedSettingsChanged )
2008-08-05 08:49:27 +00:00
EVT_DIRPICKER_CHANGED ( ID_TEXTUREPATH , ConfigDialog : : TexturePathChange )
2008-07-23 15:20:36 +00:00
END_EVENT_TABLE ( )
ConfigDialog : : ConfigDialog ( wxWindow * parent , wxWindowID id , const wxString & title , const wxPoint & position , const wxSize & size , long style )
: wxDialog ( parent , id , title , position , size , style )
{
2008-07-24 13:40:07 +00:00
g_Config . Load ( ) ;
2008-07-23 15:20:36 +00:00
CreateGUIControls ( ) ;
}
ConfigDialog : : ~ ConfigDialog ( )
{
2008-11-04 01:38:20 +00:00
}
2008-07-23 15:20:36 +00:00
void ConfigDialog : : CreateGUIControls ( )
2008-11-04 01:38:20 +00:00
{
2008-11-04 09:56:25 +00:00
// Notebook
2008-08-17 19:35:23 +00:00
m_Notebook = new wxNotebook ( this , ID_NOTEBOOK , wxDefaultPosition , wxDefaultSize ) ;
2008-10-26 13:35:34 +00:00
m_PageGeneral = new wxPanel ( m_Notebook , ID_PAGEGENERAL , wxDefaultPosition , wxDefaultSize ) ;
m_Notebook - > AddPage ( m_PageGeneral , wxT ( " General " ) ) ;
2008-11-04 09:56:25 +00:00
m_PageAdvanced = new wxPanel ( m_Notebook , ID_PAGEADVANCED , wxDefaultPosition , wxDefaultSize ) ;
m_Notebook - > AddPage ( m_PageAdvanced , wxT ( " Advanced " ) ) ;
2008-07-23 15:20:36 +00:00
2008-11-04 09:56:25 +00:00
// Buttons
m_About = new wxButton ( this , ID_ABOUTOGL , wxT ( " About " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-08-06 01:08:02 +00:00
m_OK = new wxButton ( this , ID_OK , wxT ( " OK " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-11-04 01:38:20 +00:00
m_Cancel = new wxButton ( this , ID_CANCEL , wxT ( " Cancel " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-10-07 18:05:56 +00:00
2008-11-04 09:56:25 +00:00
// Put notebook and buttons in sizers
2008-08-05 21:05:12 +00:00
wxBoxSizer * sButtons ;
sButtons = new wxBoxSizer ( wxHORIZONTAL ) ;
2008-10-07 19:17:15 +00:00
sButtons - > Add ( m_About , 0 , wxALL , 5 ) ;
2008-08-05 21:05:12 +00:00
sButtons - > Add ( 0 , 0 , 1 , wxEXPAND , 5 ) ;
sButtons - > Add ( m_OK , 0 , wxALL , 5 ) ;
2008-08-06 01:08:02 +00:00
sButtons - > Add ( m_Cancel , 0 , wxALL , 5 ) ;
2008-11-04 01:38:20 +00:00
2008-08-05 21:05:12 +00:00
wxBoxSizer * sMain ;
sMain = new wxBoxSizer ( wxVERTICAL ) ;
sMain - > Add ( m_Notebook , 1 , wxEXPAND | wxALL , 5 ) ;
sMain - > Add ( sButtons , 0 , wxEXPAND , 5 ) ;
2008-11-04 01:38:20 +00:00
2008-08-05 21:05:12 +00:00
this - > SetSizer ( sMain ) ;
this - > Layout ( ) ;
2008-11-04 09:56:25 +00:00
// General
sbBasic = new wxStaticBoxSizer ( wxVERTICAL , m_PageGeneral , wxT ( " Basic Settings " ) ) ;
2008-10-26 13:35:34 +00:00
m_Fullscreen = new wxCheckBox ( m_PageGeneral , ID_FULLSCREEN , wxT ( " Fullscreen " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-07-24 13:40:07 +00:00
m_Fullscreen - > SetValue ( g_Config . bFullscreen ) ;
2008-10-26 13:35:34 +00:00
m_RenderToMainWindow = new wxCheckBox ( m_PageGeneral , ID_RENDERTOMAINWINDOW , wxT ( " Render to main window " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-07-24 13:40:07 +00:00
m_RenderToMainWindow - > SetValue ( g_Config . renderToMainframe ) ;
2008-11-04 09:56:25 +00:00
m_StretchToFit = new wxCheckBox ( m_PageGeneral , ID_STRETCHTOFIT , wxT ( " Stretch to fit (instead of changing res.) " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-10-26 13:35:34 +00:00
m_StretchToFit - > SetValue ( g_Config . bStretchToFit ) ;
2008-11-04 09:56:25 +00:00
m_KeepAR = new wxCheckBox ( m_PageGeneral , ID_KEEPAR , wxT ( " Keep 4:3 aspect ratio " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-10-26 13:35:34 +00:00
m_KeepAR - > SetValue ( g_Config . bKeepAR ) ;
wxStaticText * FSText = new wxStaticText ( m_PageGeneral , ID_FSTEXT , wxT ( " Fullscreen video mode: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
m_FullscreenCB = new wxComboBox ( m_PageGeneral , ID_FULLSCREENCB , wxEmptyString , wxDefaultPosition , wxDefaultSize , arrayStringFor_FullscreenCB , 0 , wxDefaultValidator ) ;
2008-08-06 21:07:31 +00:00
m_FullscreenCB - > SetValue ( wxString : : FromAscii ( g_Config . iFSResolution ) ) ;
2008-10-26 13:35:34 +00:00
wxStaticText * WMText = new wxStaticText ( m_PageGeneral , ID_WMTEXT , wxT ( " Windowed resolution: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
m_WindowResolutionCB = new wxComboBox ( m_PageGeneral , ID_WINDOWRESOLUTIONCB , wxEmptyString , wxDefaultPosition , wxDefaultSize , arrayStringFor_WindowResolutionCB , 0 , wxDefaultValidator ) ;
2008-08-06 21:07:31 +00:00
m_WindowResolutionCB - > SetValue ( wxString : : FromAscii ( g_Config . iWindowedRes ) ) ;
2008-07-23 15:20:36 +00:00
2008-11-04 09:56:25 +00:00
// Enhancements
sbEnhancements = new wxStaticBoxSizer ( wxVERTICAL , m_PageGeneral , wxT ( " Enhancements " ) ) ;
m_ForceFiltering = new wxCheckBox ( m_PageGeneral , ID_FORCEFILTERING , wxT ( " Force bi/trilinear filtering (May cause small glitches) " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-08-05 08:49:27 +00:00
m_ForceFiltering - > SetValue ( g_Config . bForceFiltering ) ;
2008-11-04 09:56:25 +00:00
m_ForceAnisotropy = new wxCheckBox ( m_PageGeneral , ID_FORCEANISOTROPY , wxT ( " Force maximum anisotropy filtering " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-10-09 18:47:53 +00:00
//m_ForceAnisotropy->SetValue(g_Config.bForceMaxAniso);
m_ForceAnisotropy - > Enable ( false ) ;
2008-11-04 09:56:25 +00:00
wxStaticText * AAText = new wxStaticText ( m_PageGeneral , ID_AATEXT , wxT ( " Anti-alias mode: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2008-10-26 13:35:34 +00:00
wxArrayString arrayStringFor_AliasModeCB ;
2008-11-04 09:56:25 +00:00
m_AliasModeCB = new wxComboBox ( m_PageGeneral , ID_ALIASMODECB , wxEmptyString , wxDefaultPosition , wxDefaultSize , arrayStringFor_AliasModeCB , 0 , wxDefaultValidator ) ;
2008-10-26 13:35:34 +00:00
wxString tmp ;
tmp < < g_Config . iMultisampleMode ;
m_AliasModeCB - > SetValue ( tmp ) ;
2008-10-09 18:47:53 +00:00
2008-11-04 09:56:25 +00:00
sGeneral = new wxBoxSizer ( wxVERTICAL ) ;
sBasic = new wxGridBagSizer ( 0 , 0 ) ;
sBasic - > Add ( m_Fullscreen , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sBasic - > Add ( m_RenderToMainWindow , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sBasic - > Add ( m_StretchToFit , wxGBPosition ( 2 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sBasic - > Add ( m_KeepAR , wxGBPosition ( 3 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sBasic - > Add ( FSText , wxGBPosition ( 4 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sBasic - > Add ( m_FullscreenCB , wxGBPosition ( 4 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sBasic - > Add ( WMText , wxGBPosition ( 5 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sBasic - > Add ( m_WindowResolutionCB , wxGBPosition ( 5 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sbBasic - > Add ( sBasic ) ;
sGeneral - > Add ( sbBasic , 0 , wxEXPAND | wxALL , 5 ) ;
sEnhancements = new wxGridBagSizer ( 0 , 0 ) ;
sEnhancements - > Add ( m_ForceFiltering , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sEnhancements - > Add ( m_ForceAnisotropy , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sEnhancements - > Add ( AAText , wxGBPosition ( 2 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sEnhancements - > Add ( m_AliasModeCB , wxGBPosition ( 2 , 1 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sbEnhancements - > Add ( sEnhancements ) ;
sGeneral - > Add ( sbEnhancements , 0 , wxEXPAND | wxALL , 5 ) ;
m_PageGeneral - > SetSizer ( sGeneral ) ;
sGeneral - > Layout ( ) ;
// Information
sbInfo = new wxStaticBoxSizer ( wxVERTICAL , m_PageAdvanced , wxT ( " Info " ) ) ;
m_ShowFPS = new wxCheckBox ( m_PageAdvanced , ID_SHOWFPS , wxT ( " Overlay FPS " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-09-09 23:34:13 +00:00
m_ShowFPS - > SetValue ( g_Config . bShowFPS ) ;
2008-11-04 09:56:25 +00:00
m_Statistics = new wxCheckBox ( m_PageAdvanced , ID_STATISTICS , wxT ( " Overlay some statistics " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-08-05 08:49:27 +00:00
m_Statistics - > SetValue ( g_Config . bOverlayStats ) ;
2008-11-04 09:56:25 +00:00
m_ShaderErrors = new wxCheckBox ( m_PageAdvanced , ID_SHADERERRORS , wxT ( " Show shader compilation issues " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-10-26 13:35:34 +00:00
//m_ShaderErrors->SetValue(g_Config.bShowShaderErrors);
m_ShaderErrors - > Enable ( false ) ;
2008-11-04 09:56:25 +00:00
m_TexFmtOverlay = new wxCheckBox ( m_PageAdvanced , ID_TEXFMTOVERLAY , wxT ( " Overlay texture format " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-08-06 01:08:02 +00:00
m_TexFmtOverlay - > SetValue ( g_Config . bTexFmtOverlayEnable ) ;
2008-11-04 09:56:25 +00:00
m_TexFmtCenter = new wxCheckBox ( m_PageAdvanced , ID_TEXFMTCENTER , wxT ( " centered " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-08-06 01:08:02 +00:00
m_TexFmtCenter - > SetValue ( g_Config . bTexFmtOverlayCenter ) ;
m_TexFmtCenter - > Enable ( m_TexFmtOverlay - > IsChecked ( ) ) ;
2008-11-04 09:56:25 +00:00
// Render
sbRendering = new wxStaticBoxSizer ( wxVERTICAL , m_PageAdvanced , wxT ( " Rendering " ) ) ;
m_UseXFB = new wxCheckBox ( m_PageAdvanced , ID_USEXFB , wxT ( " Use External Framebuffer (XFB) " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-10-15 14:07:03 +00:00
m_UseXFB - > SetValue ( g_Config . bUseXFB ) ;
2008-11-04 09:56:25 +00:00
m_Wireframe = new wxCheckBox ( m_PageAdvanced , ID_WIREFRAME , wxT ( " Enable Wireframe " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-10-28 08:14:17 +00:00
m_Wireframe - > SetValue ( g_Config . bWireFrame ) ;
m_Wireframe - > Enable ( true ) ;
2008-11-04 09:56:25 +00:00
m_DisableLighting = new wxCheckBox ( m_PageAdvanced , ID_DISABLELIGHTING , wxT ( " Disable Material Lighting " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-10-28 08:14:17 +00:00
m_DisableLighting - > SetValue ( g_Config . bDisableLighting ) ;
m_DisableLighting - > Enable ( true ) ;
2008-11-04 09:56:25 +00:00
m_DisableTexturing = new wxCheckBox ( m_PageAdvanced , ID_DISABLETEXTURING , wxT ( " Disable Texturing " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-10-28 08:14:17 +00:00
m_DisableTexturing - > SetValue ( g_Config . bDisableTexturing ) ;
m_DisableTexturing - > Enable ( true ) ;
2008-11-04 09:56:25 +00:00
// Utility
sbUtilities = new wxStaticBoxSizer ( wxVERTICAL , m_PageAdvanced , wxT ( " Utilities " ) ) ;
m_DumpTextures = new wxCheckBox ( m_PageAdvanced , ID_DUMPTEXTURES , wxT ( " Dump textures to: " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-10-26 13:35:34 +00:00
m_DumpTextures - > SetValue ( g_Config . bDumpTextures ) ;
2008-11-04 09:56:25 +00:00
m_TexturePath = new wxDirPickerCtrl ( m_PageAdvanced , ID_TEXTUREPATH , wxEmptyString , wxT ( " Choose a directory to store texture dumps: " ) , wxDefaultPosition , wxDefaultSize , wxDIRP_USE_TEXTCTRL ) ;
2008-10-26 13:35:34 +00:00
m_TexturePath - > SetPath ( wxString : : FromAscii ( g_Config . texDumpPath ) ) ;
m_TexturePath - > Enable ( m_DumpTextures - > IsChecked ( ) ) ;
2008-07-23 15:20:36 +00:00
2008-11-04 09:56:25 +00:00
// Hacks
sbHacks = new wxStaticBoxSizer ( wxVERTICAL , m_PageAdvanced , wxT ( " Hacks " ) ) ;
m_EFBToTextureDisable = new wxCheckBox ( m_PageAdvanced , ID_EFBTOTEXTUREDISABLE , wxT ( " Disable copy EFB to texture " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-10-28 08:14:17 +00:00
m_EFBToTextureDisable - > Enable ( true ) ;
m_EFBToTextureDisable - > SetValue ( g_Config . bEBFToTextureDisable ) ;
2008-11-04 09:56:25 +00:00
sAdvanced = new wxBoxSizer ( wxVERTICAL ) ;
sInfo = new wxGridBagSizer ( 0 , 0 ) ;
sInfo - > Add ( m_ShowFPS , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sInfo - > Add ( m_ShaderErrors , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sInfo - > Add ( m_Statistics , wxGBPosition ( 2 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sInfo - > Add ( m_TexFmtOverlay , wxGBPosition ( 3 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sInfo - > Add ( m_TexFmtCenter , wxGBPosition ( 3 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sbInfo - > Add ( sInfo ) ;
sAdvanced - > Add ( sbInfo , 0 , wxEXPAND | wxALL , 5 ) ;
sRendering = new wxGridBagSizer ( 0 , 0 ) ;
sRendering - > Add ( m_UseXFB , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sRendering - > Add ( m_Wireframe , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sRendering - > Add ( m_DisableLighting , wxGBPosition ( 2 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sRendering - > Add ( m_DisableTexturing , wxGBPosition ( 3 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sbRendering - > Add ( sRendering ) ;
sAdvanced - > Add ( sbRendering , 0 , wxEXPAND | wxALL , 5 ) ;
sUtilities = new wxGridBagSizer ( 0 , 0 ) ;
sUtilities - > Add ( m_DumpTextures , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sUtilities - > Add ( m_TexturePath , wxGBPosition ( 0 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sbUtilities - > Add ( sUtilities ) ;
sAdvanced - > Add ( sbUtilities , 0 , wxEXPAND | wxALL , 5 ) ;
sHacks = new wxGridBagSizer ( 0 , 0 ) ;
sHacks - > Add ( m_EFBToTextureDisable , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sbHacks - > Add ( sHacks ) ;
sAdvanced - > Add ( sbHacks , 0 , wxEXPAND | wxALL , 5 ) ;
m_PageAdvanced - > SetSizer ( sAdvanced ) ;
sAdvanced - > Layout ( ) ;
2008-09-07 17:11:52 +00:00
Fit ( ) ;
2008-11-04 09:56:25 +00:00
Center ( ) ;
2008-07-23 15:20:36 +00:00
}
2008-08-05 08:49:27 +00:00
void ConfigDialog : : OnClose ( wxCloseEvent & event )
2008-07-23 15:20:36 +00:00
{
EndModal ( 0 ) ;
}
void ConfigDialog : : OKClick ( wxCommandEvent & event )
{
2008-08-06 01:08:02 +00:00
switch ( event . GetId ( ) )
2008-07-23 15:20:36 +00:00
{
2008-08-06 01:08:02 +00:00
case ID_CANCEL :
Close ( ) ;
break ;
case ID_OK :
2008-07-24 13:40:07 +00:00
g_Config . Save ( ) ;
2008-08-06 01:08:02 +00:00
Close ( ) ;
break ;
2008-07-23 15:20:36 +00:00
}
}
2008-08-05 08:49:27 +00:00
void ConfigDialog : : AddFSReso ( char * reso )
2008-07-30 04:23:43 +00:00
{
2008-08-05 08:49:27 +00:00
m_FullscreenCB - > Append ( wxString : : FromAscii ( reso ) ) ;
2008-07-30 04:23:43 +00:00
}
2008-08-05 08:49:27 +00:00
void ConfigDialog : : AddWindowReso ( char * reso )
{
m_WindowResolutionCB - > Append ( wxString : : FromAscii ( reso ) ) ;
}
2008-08-17 19:35:23 +00:00
void ConfigDialog : : AddAAMode ( int mode )
{
wxString tmp ;
tmp < < mode ;
2008-08-17 20:22:12 +00:00
m_AliasModeCB - > Append ( tmp ) ;
2008-08-17 19:35:23 +00:00
}
2008-11-04 09:56:25 +00:00
void ConfigDialog : : AboutClick ( wxCommandEvent & event )
2008-08-05 08:49:27 +00:00
{
2008-11-04 09:56:25 +00:00
wxMessageBox ( _T ( " Dolphin OpenGL Plugin \n By zerofrog(@gmail.com) \n \n "
" A card supporting Vertex/Pixel Shader 2.0 or higher, framebuffer objects, "
2008-11-11 04:50:39 +00:00
" and multiple render targets is required in order to use this plugin. " ) ,
2008-11-04 09:56:25 +00:00
_T ( " Dolphin OGL " ) , wxOK , this ) ;
2008-07-30 04:23:43 +00:00
}
2008-08-06 01:08:02 +00:00
2008-11-04 09:56:25 +00:00
void ConfigDialog : : GeneralSettingsChanged ( wxCommandEvent & event )
2008-08-06 01:08:02 +00:00
{
2008-11-04 09:56:25 +00:00
switch ( event . GetId ( ) )
{
case ID_FULLSCREEN :
g_Config . bFullscreen = m_Fullscreen - > IsChecked ( ) ;
break ;
case ID_RENDERTOMAINWINDOW :
g_Config . renderToMainframe = m_RenderToMainWindow - > IsChecked ( ) ;
break ;
case ID_STRETCHTOFIT :
g_Config . bStretchToFit = m_StretchToFit - > IsChecked ( ) ;
break ;
case ID_KEEPAR :
g_Config . bKeepAR = m_KeepAR - > IsChecked ( ) ;
break ;
case ID_FULLSCREENCB :
strcpy ( g_Config . iFSResolution , m_FullscreenCB - > GetValue ( ) . mb_str ( ) ) ;
break ;
case ID_WINDOWRESOLUTIONCB :
strcpy ( g_Config . iWindowedRes , m_WindowResolutionCB - > GetValue ( ) . mb_str ( ) ) ;
break ;
case ID_FORCEFILTERING :
g_Config . bForceFiltering = m_ForceFiltering - > IsChecked ( ) ;
break ;
case ID_FORCEANISOTROPY :
g_Config . bForceMaxAniso = m_ForceAnisotropy - > IsChecked ( ) ;
break ;
case ID_ALIASMODECB :
g_Config . iMultisampleMode = atoi ( m_AliasModeCB - > GetValue ( ) . mb_str ( ) ) ;
break ;
}
2008-07-30 04:23:43 +00:00
}
2008-08-05 08:49:27 +00:00
2008-11-04 09:56:25 +00:00
void ConfigDialog : : AdvancedSettingsChanged ( wxCommandEvent & event )
2008-08-05 08:49:27 +00:00
{
2008-11-04 09:56:25 +00:00
switch ( event . GetId ( ) )
2008-08-06 01:08:02 +00:00
{
2008-11-04 09:56:25 +00:00
case ID_SHOWFPS :
g_Config . bShowFPS = m_ShowFPS - > IsChecked ( ) ;
break ;
case ID_SHADERERRORS :
g_Config . bShowShaderErrors = m_ShaderErrors - > IsChecked ( ) ;
break ;
case ID_STATISTICS :
g_Config . bOverlayStats = m_Statistics - > IsChecked ( ) ;
break ;
2008-08-06 01:08:02 +00:00
case ID_TEXFMTOVERLAY :
g_Config . bTexFmtOverlayEnable = m_TexFmtOverlay - > IsChecked ( ) ;
m_TexFmtCenter - > Enable ( m_TexFmtOverlay - > IsChecked ( ) ) ;
2008-11-04 09:56:25 +00:00
TextureMngr : : Invalidate ( ) ;
2008-08-06 01:08:02 +00:00
break ;
case ID_TEXFMTCENTER :
g_Config . bTexFmtOverlayCenter = m_TexFmtCenter - > IsChecked ( ) ;
2008-11-04 09:56:25 +00:00
TextureMngr : : Invalidate ( ) ;
break ;
case ID_USEXFB :
g_Config . bUseXFB = m_UseXFB - > IsChecked ( ) ;
break ;
case ID_WIREFRAME :
g_Config . bWireFrame = m_Wireframe - > IsChecked ( ) ;
break ;
case ID_DISABLELIGHTING :
g_Config . bDisableLighting = m_DisableLighting - > IsChecked ( ) ;
break ;
case ID_DISABLETEXTURING :
g_Config . bDisableTexturing = m_DisableTexturing - > IsChecked ( ) ;
break ;
case ID_DUMPTEXTURES :
m_TexturePath - > Enable ( m_DumpTextures - > IsChecked ( ) ) ;
g_Config . bDumpTextures = m_DumpTextures - > IsChecked ( ) ;
break ;
case ID_TEXTUREPATH :
break ;
case ID_EFBTOTEXTUREDISABLE :
g_Config . bEBFToTextureDisable = m_EFBToTextureDisable - > IsChecked ( ) ;
2008-08-06 01:08:02 +00:00
break ;
}
2008-08-05 08:49:27 +00:00
}
void ConfigDialog : : TexturePathChange ( wxFileDirPickerEvent & event )
{
2008-11-04 09:56:25 +00:00
// Note: if a user inputs an incorrect path(by typing, not by choosing from
// the combobox) this event wil not be fired.
2008-08-05 09:53:42 +00:00
strcpy ( g_Config . texDumpPath , event . GetPath ( ) . mb_str ( ) ) ;
2008-08-05 08:49:27 +00:00
}