2009-07-28 21:32:10 +00:00
// Copyright (C) 2003 Dolphin Project.
2008-12-08 05:25:12 +00:00
// 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/
2009-06-09 19:40:47 +00:00
# include <wx/wx.h>
# include <wx/sizer.h>
# include <wx/filepicker.h>
# include <wx/gbsizer.h>
# include <wx/notebook.h>
# include <wx/mimetype.h>
2008-12-08 05:25:12 +00:00
# include "ConfigDlg.h"
# include "../Globals.h"
2009-09-13 09:23:30 +00:00
# include "VideoConfig.h"
2008-12-08 05:25:12 +00:00
# include "../TextureMngr.h"
2009-04-19 10:10:45 +00:00
# include "VertexShaderManager.h"
2009-06-09 21:10:14 +00:00
# include "../PostProcessing.h"
2009-08-15 07:20:37 +00:00
# include "GlobalControl.h"
2009-09-06 15:11:21 +00:00
# include "Render.h"
# include "FileUtil.h"
2008-12-08 05:25:12 +00:00
2009-07-02 17:11:27 +00:00
BEGIN_EVENT_TABLE ( GFXConfigDialogOGL , wxDialog )
EVT_CLOSE ( GFXConfigDialogOGL : : OnClose )
EVT_BUTTON ( ID_CLOSE , GFXConfigDialogOGL : : CloseClick )
EVT_BUTTON ( ID_ABOUTOGL , GFXConfigDialogOGL : : AboutClick )
EVT_CHECKBOX ( ID_FULLSCREEN , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_VSYNC , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_RENDERTOMAINWINDOW , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_COMBOBOX ( ID_FULLSCREENCB , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_COMBOBOX ( ID_WINDOWRESOLUTIONCB , GFXConfigDialogOGL : : GeneralSettingsChanged )
2009-08-16 12:11:36 +00:00
EVT_COMBOBOX ( ID_WINDOWFSRESOLUTIONCB , GFXConfigDialogOGL : : GeneralSettingsChanged )
2009-07-02 17:11:27 +00:00
EVT_CHOICE ( ID_MAXANISOTROPY , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_CHOICE ( ID_MSAAMODECB , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_NATIVERESOLUTION , GFXConfigDialogOGL : : GeneralSettingsChanged )
2009-09-05 05:42:51 +00:00
EVT_CHECKBOX ( ID_2X_RESOLUTION , GFXConfigDialogOGL : : GeneralSettingsChanged )
2009-09-02 21:30:19 +00:00
EVT_CHECKBOX ( ID_WIDESCREEN_HACK , GFXConfigDialogOGL : : GeneralSettingsChanged )
2009-07-02 17:11:27 +00:00
EVT_CHECKBOX ( ID_USEXFB , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_FORCEFILTERING , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_AUTOSCALE , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_KEEPAR_4_3 , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_KEEPAR_16_9 , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_CHECKBOX ( ID_CROP , GFXConfigDialogOGL : : GeneralSettingsChanged )
2009-01-04 23:00:07 +00:00
# ifndef _WIN32
2009-07-02 17:11:27 +00:00
EVT_CHECKBOX ( ID_HIDECURSOR , GFXConfigDialogOGL : : GeneralSettingsChanged )
2009-01-04 23:00:07 +00:00
# endif
2009-07-02 17:11:27 +00:00
EVT_CHECKBOX ( ID_WIREFRAME , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_SHOWFPS , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_STATISTICS , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_PROJSTATS , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_SHOWEFBCOPYREGIONS , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_SHADERERRORS , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_TEXFMTOVERLAY , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_TEXFMTCENTER , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_DUMPTEXTURES , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_HIRESTEXTURES , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_DUMPEFBTARGET , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_DUMPFRAMES , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_FREELOOK , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_DISABLELIGHTING , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_DISABLETEXTURING , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_DISABLEFOG , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_EFBCOPYDISABLEHOTKEY , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_HACK , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_SAFETEXTURECACHE , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_DSTALPHAPASS , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHECKBOX ( ID_CHECKBOX_DISABLECOPYEFB , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_RADIOBUTTON ( ID_RADIO_COPYEFBTORAM , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_RADIOBUTTON ( ID_RADIO_COPYEFBTOGL , GFXConfigDialogOGL : : AdvancedSettingsChanged )
EVT_CHOICE ( ID_PHACKVALUE , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_CHOICE ( ID_POSTSHADER , GFXConfigDialogOGL : : GeneralSettingsChanged )
EVT_BUTTON ( ID_RELOADSHADER , GFXConfigDialogOGL : : ReloadShaderClick )
EVT_BUTTON ( ID_EDITSHADER , GFXConfigDialogOGL : : EditShaderClick )
2008-12-08 05:25:12 +00:00
END_EVENT_TABLE ( )
2009-07-02 17:11:27 +00:00
GFXConfigDialogOGL : : GFXConfigDialogOGL ( wxWindow * parent , wxWindowID id , const wxString & title , const wxPoint & position , const wxSize & size , long style )
2008-12-08 05:25:12 +00:00
: wxDialog ( parent , id , title , position , size , style )
{
}
2009-09-02 21:00:45 +00:00
2009-02-19 10:29:53 +00:00
// Close and unload the window
// ---------------
2009-07-02 17:11:27 +00:00
GFXConfigDialogOGL : : ~ GFXConfigDialogOGL ( )
2008-12-08 05:25:12 +00:00
{
2009-07-02 17:11:27 +00:00
INFO_LOG ( CONSOLE , " GFXConfigDialogOGL Closed " ) ;
2008-12-08 05:25:12 +00:00
}
2009-07-02 17:11:27 +00:00
void GFXConfigDialogOGL : : OnClose ( wxCloseEvent & event )
2009-02-19 10:29:53 +00:00
{
2009-07-26 09:52:35 +00:00
//INFO_LOG(CONSOLE, "OnClose");
2009-02-22 04:24:53 +00:00
// notice that we don't run wxEntryCleanup(); here so the dll will still be loaded
/* JP: Yes, it seems like Close() does not do that. It only runs EndModal() or something
similar to hide the window . And I don ' t understand the " Window deletion overview " on
2009-02-25 05:54:36 +00:00
the wxWidgets website . Destroy ( ) doesn ' t run the destructor either . However running
wxEntryCleanup ( ) from here crashes the process . But we can run it from CloseClick ( ) */
2009-02-22 04:24:53 +00:00
//wxEntryCleanup();
2009-02-19 10:29:53 +00:00
//EndModal(0);
// Allow wxWidgets to close and unload the window
2009-07-26 09:52:35 +00:00
//event.Skip();
CloseWindow ( ) ;
2009-02-19 10:29:53 +00:00
}
2009-07-02 17:11:27 +00:00
void GFXConfigDialogOGL : : CloseClick ( wxCommandEvent & WXUNUSED ( event ) )
2009-02-19 10:29:53 +00:00
{
2009-07-26 09:52:35 +00:00
//INFO_LOG(CONSOLE, "CloseClick");
2009-02-22 04:24:53 +00:00
2009-02-25 05:54:36 +00:00
// If we run wxEntryCleanup() the class will be entirely deleted, and the destructor will be run
//g_Config.Save();
2009-02-23 21:38:06 +00:00
//wxEntryCleanup();
2009-02-22 04:24:53 +00:00
2009-07-26 09:52:35 +00:00
//Close();
CloseWindow ( ) ;
2009-02-19 10:29:53 +00:00
}
2009-09-02 21:00:45 +00:00
2009-03-08 20:04:40 +00:00
// Add avaliable resolutions and other settings
2009-02-19 10:29:53 +00:00
// ---------------
2009-07-03 23:53:20 +00:00
void GFXConfigDialogOGL : : AddFSReso ( const char * reso )
2009-02-19 10:29:53 +00:00
{
arrayStringFor_FullscreenCB . Add ( wxString : : FromAscii ( reso ) ) ;
}
2009-07-03 23:53:20 +00:00
void GFXConfigDialogOGL : : AddWindowReso ( const char * reso )
2009-02-19 10:29:53 +00:00
{
arrayStringFor_WindowResolutionCB . Add ( wxString : : FromAscii ( reso ) ) ;
}
2009-09-02 21:00:45 +00:00
2009-02-19 10:29:53 +00:00
2008-12-08 05:25:12 +00:00
2009-07-02 17:11:27 +00:00
void GFXConfigDialogOGL : : CreateGUIControls ( )
2008-12-08 05:25:12 +00:00
{
// Notebook
m_Notebook = new wxNotebook ( this , ID_NOTEBOOK , wxDefaultPosition , wxDefaultSize ) ;
m_PageGeneral = new wxPanel ( m_Notebook , ID_PAGEGENERAL , wxDefaultPosition , wxDefaultSize ) ;
m_Notebook - > AddPage ( m_PageGeneral , wxT ( " General " ) ) ;
m_PageAdvanced = new wxPanel ( m_Notebook , ID_PAGEADVANCED , wxDefaultPosition , wxDefaultSize ) ;
m_Notebook - > AddPage ( m_PageAdvanced , wxT ( " Advanced " ) ) ;
// Buttons
m_About = new wxButton ( this , ID_ABOUTOGL , wxT ( " About " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_Close = new wxButton ( this , ID_CLOSE , wxT ( " Close " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
// Put notebook and buttons in sizers
wxBoxSizer * sButtons ;
sButtons = new wxBoxSizer ( wxHORIZONTAL ) ;
sButtons - > Add ( m_About , 0 , wxALL , 5 ) ;
sButtons - > AddStretchSpacer ( ) ;
sButtons - > Add ( m_Close , 0 , wxALL , 5 ) ;
wxBoxSizer * sMain ;
sMain = new wxBoxSizer ( wxVERTICAL ) ;
sMain - > Add ( m_Notebook , 1 , wxEXPAND | wxALL , 5 ) ;
sMain - > Add ( sButtons , 0 , wxEXPAND , 5 ) ;
this - > SetSizer ( sMain ) ;
this - > Layout ( ) ;
2009-06-06 13:36:33 +00:00
// General Display Settings
sbBasic = new wxStaticBoxSizer ( wxVERTICAL , m_PageGeneral , wxT ( " Basic Display Settings " ) ) ;
2009-09-06 15:11:21 +00:00
m_RenderToMainWindow = new wxCheckBox ( m_PageGeneral , ID_RENDERTOMAINWINDOW , wxT ( " Child window " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-09-06 13:36:05 +00:00
m_RenderToMainWindow - > SetValue ( g_Config . RenderToMainframe ) ;
2009-06-08 06:05:09 +00:00
m_NativeResolution = new wxCheckBox ( m_PageGeneral , ID_NATIVERESOLUTION , wxT ( " Native " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-09-05 05:42:51 +00:00
m_2xResolution = new wxCheckBox ( m_PageGeneral , ID_2X_RESOLUTION , wxT ( " 2x " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-09-06 15:11:21 +00:00
m_WidescreenHack = new wxCheckBox ( m_PageGeneral , ID_WIDESCREEN_HACK , wxT ( " Wide screen hack " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-09-05 05:42:51 +00:00
wxStaticText * IRText = new wxStaticText ( m_PageGeneral , ID_IRTEXT , wxT ( " Native resolution: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
wxStaticText * RText = new wxStaticText ( m_PageGeneral , ID_RTEXT , wxT ( " Custom resolution: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2009-09-06 18:58:53 +00:00
wxStaticText * WMText = new wxStaticText ( m_PageGeneral , ID_WMTEXT , wxT ( " Child window: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2009-08-23 03:14:07 +00:00
wxStaticText * WM2Text = new wxStaticText ( m_PageGeneral , ID_WM2TEXT , wxT ( " Window mode: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2009-09-06 15:11:21 +00:00
wxStaticText * FMText = new wxStaticText ( m_PageGeneral , ID_FMTEXT , wxT ( " Separate window: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2009-06-07 14:50:16 +00:00
m_WindowResolutionCB = new wxComboBox ( m_PageGeneral , ID_WINDOWRESOLUTIONCB , arrayStringFor_WindowResolutionCB [ 0 ] , wxDefaultPosition , wxDefaultSize , arrayStringFor_WindowResolutionCB , wxCB_READONLY , wxDefaultValidator ) ;
2009-09-13 08:21:35 +00:00
m_WindowResolutionCB - > SetValue ( wxString : : FromAscii ( g_Config . cInternalRes ) ) ;
2009-08-16 12:11:36 +00:00
m_WindowFSResolutionCB = new wxComboBox ( m_PageGeneral , ID_WINDOWFSRESOLUTIONCB , arrayStringFor_FullscreenCB [ 0 ] , wxDefaultPosition , wxDefaultSize , arrayStringFor_FullscreenCB , wxCB_READONLY , wxDefaultValidator ) ;
2009-09-13 08:21:35 +00:00
m_WindowFSResolutionCB - > SetValue ( wxString : : FromAscii ( g_Config . cFSResolution ) ) ;
2009-02-28 16:33:59 +00:00
// Aspect ratio / positioning controls
2009-06-06 13:36:33 +00:00
wxStaticText * KeepARText = new wxStaticText ( m_PageGeneral , wxID_ANY , wxT ( " Keep aspect ratio: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
m_KeepAR43 = new wxCheckBox ( m_PageGeneral , ID_KEEPAR_4_3 , wxT ( " 4:3 " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_KeepAR169 = new wxCheckBox ( m_PageGeneral , ID_KEEPAR_16_9 , wxT ( " 16:9 " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-02-25 05:54:36 +00:00
m_Crop = new wxCheckBox ( m_PageGeneral , ID_CROP , wxT ( " Crop " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-06-07 14:50:16 +00:00
m_Fullscreen = new wxCheckBox ( m_PageGeneral , ID_FULLSCREEN , wxT ( " Fullscreen " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_Fullscreen - > SetValue ( g_Config . bFullscreen ) ;
2009-02-28 16:33:59 +00:00
m_UseXFB = new wxCheckBox ( m_PageGeneral , ID_USEXFB , wxT ( " Use Real XFB " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_AutoScale = new wxCheckBox ( m_PageGeneral , ID_AUTOSCALE , wxT ( " Auto scale (try to remove borders) " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-02-24 19:16:08 +00:00
2009-06-08 06:05:09 +00:00
// Default values
2009-02-28 16:33:59 +00:00
m_NativeResolution - > SetValue ( g_Config . bNativeResolution ) ;
2009-09-05 05:42:51 +00:00
m_2xResolution - > SetValue ( g_Config . b2xResolution ) ;
2009-09-02 21:30:19 +00:00
m_WidescreenHack - > SetValue ( g_Config . bWidescreenHack ) ;
2009-02-24 19:16:08 +00:00
m_KeepAR43 - > SetValue ( g_Config . bKeepAR43 ) ;
m_KeepAR169 - > SetValue ( g_Config . bKeepAR169 ) ;
2009-02-25 05:54:36 +00:00
m_Crop - > SetValue ( g_Config . bCrop ) ;
2009-02-28 16:33:59 +00:00
m_UseXFB - > SetValue ( g_Config . bUseXFB ) ;
m_AutoScale - > SetValue ( g_Config . bAutoScale ) ;
2008-12-17 22:09:33 +00:00
2009-01-04 23:00:07 +00:00
# ifndef _WIN32
m_HideCursor = new wxCheckBox ( m_PageGeneral , ID_HIDECURSOR , wxT ( " Hide mouse cursor " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_HideCursor - > SetValue ( g_Config . bHideCursor ) ;
# endif
2009-06-06 13:36:33 +00:00
// Advanced Display Settings
sbBasicAdvanced = new wxStaticBoxSizer ( wxVERTICAL , m_PageGeneral , wxT ( " Advanced Display Settings " ) ) ;
m_VSync = new wxCheckBox ( m_PageGeneral , ID_VSYNC , wxT ( " VSync (req. restart) " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_VSync - > SetValue ( g_Config . bVSync ) ;
2009-03-08 20:04:40 +00:00
wxStaticText * MSAAText = new wxStaticText ( m_PageGeneral , ID_MSAAMODETEXT , wxT ( " Antialias (MSAA): " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
m_MSAAModeCB = new wxChoice ( m_PageGeneral , ID_MSAAMODECB , wxDefaultPosition , wxDefaultSize , arrayStringFor_MSAAModeCB , 0 , wxDefaultValidator ) ;
m_MSAAModeCB - > Append ( wxT ( " (off) " ) ) ;
m_MSAAModeCB - > Append ( wxT ( " 2x " ) ) ;
m_MSAAModeCB - > Append ( wxT ( " 4x " ) ) ;
m_MSAAModeCB - > Append ( wxT ( " 8x " ) ) ;
m_MSAAModeCB - > Append ( wxT ( " 8x CSAA " ) ) ;
m_MSAAModeCB - > Append ( wxT ( " 8xQ CSAA " ) ) ;
m_MSAAModeCB - > Append ( wxT ( " 16x CSAA " ) ) ;
m_MSAAModeCB - > Append ( wxT ( " 16xQ CSAA " ) ) ;
m_MSAAModeCB - > SetSelection ( g_Config . iMultisampleMode ) ;
2009-06-08 02:48:38 +00:00
m_EFBCopyDisableHotKey = new wxCheckBox ( m_PageGeneral , ID_EFBCOPYDISABLEHOTKEY , wxT ( " OSD Hotkeys " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
# ifndef _WIN32
// JPeterson set the hot key to be Win32-specific
m_EFBCopyDisableHotKey - > Enable ( false ) ;
# endif
m_EFBCopyDisableHotKey - > SetValue ( g_Config . bEFBCopyDisableHotKey ) ;
2009-02-19 11:28:55 +00:00
// Tool tips
2009-07-30 07:08:31 +00:00
m_Fullscreen - > SetToolTip (
2009-09-06 15:11:21 +00:00
wxT ( " Start the separate window in fullscreen mode. " )
wxT ( " Press Alt+Enter to switch between Fullscreen and Windowed mode. " )
2009-09-06 18:54:20 +00:00
wxT ( " \n \n Applies instanty during gameplay: <Yes> " ) ) ;
2009-07-30 07:08:31 +00:00
m_NativeResolution - > SetToolTip (
wxT ( " This will use the game's native resolution and stretch it to fill the " )
wxT ( " \n window instead of changing the internal display resolution. It " )
wxT ( " \n may result in a blurrier image, but it may also give a higher " )
wxT ( " \n FPS if you have a slow graphics card. " )
wxT ( " \n \n Applies instanty during gameplay: <Yes> " ) ) ;
2009-09-05 05:42:51 +00:00
m_2xResolution - > SetToolTip ( wxT (
" Applies instanty during gameplay: <Yes, if allowed> " ) ) ;
2009-09-06 00:11:16 +00:00
m_WidescreenHack - > SetToolTip (
wxT ( " This multiplys a perpective projection value to increase the amount being " )
wxT ( " \n shown instead of stretching the screen, this may cause graphical problems " )
wxT ( " \n in some games " )
wxT ( " \n \n Applies instanty during gameplay: <Yes> " ) ) ;
2009-07-30 07:08:31 +00:00
m_Crop - > SetToolTip (
wxT ( " Crop the picture instead of creating a letterbox. It will assume that your screen " )
wxT ( " \n is of the 5:4 format if you have selected the 4:3 aspect ratio. It will assume " )
wxT ( " \n that your screen is of the 16:10 format if you have selected the 16:9 aspect ratio. " )
wxT ( " \n \n Applies instanty during gameplay: <Yes> " ) ) ;
m_WindowResolutionCB - > SetToolTip (
2009-08-13 09:24:44 +00:00
wxT ( " Select internal resolution for the separate rendering window for windowed mode " )
wxT ( " \n \n Applies instanty during gameplay: <No> " ) ) ;
2009-08-16 12:11:36 +00:00
m_WindowFSResolutionCB - > SetToolTip (
2009-08-13 09:24:44 +00:00
wxT ( " Select internal resolution for the separate rendering window for fullscreen mode " )
wxT ( " \n \n Applies instanty during gameplay: <No> " ) ) ;
2009-06-07 11:51:53 +00:00
m_MSAAModeCB - > SetToolTip ( wxT (
2009-06-08 06:05:09 +00:00
" Applies instanty during gameplay: <No> " ) ) ;
2009-06-08 02:48:38 +00:00
m_EFBCopyDisableHotKey - > SetToolTip ( wxT (
" Enable OSD hotkeys '3', '4', '5', etc. " ) ) ;
2008-12-17 22:09:33 +00:00
2008-12-08 05:25:12 +00:00
// Enhancements
sbEnhancements = new wxStaticBoxSizer ( wxVERTICAL , m_PageGeneral , wxT ( " Enhancements " ) ) ;
2009-04-24 01:30:45 +00:00
wxStaticText * AnisoText = new wxStaticText ( m_PageGeneral , ID_MAXANISOTROPYTEXT , wxT ( " Anisotropic filter: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2008-12-08 05:25:12 +00:00
m_MaxAnisotropyCB = new wxChoice ( m_PageGeneral , ID_MAXANISOTROPY , wxDefaultPosition , wxDefaultSize , arrayStringFor_MaxAnisotropyCB , 0 , wxDefaultValidator ) ;
m_MaxAnisotropyCB - > Append ( wxT ( " 1x " ) ) ;
m_MaxAnisotropyCB - > Append ( wxT ( " 2x " ) ) ;
m_MaxAnisotropyCB - > Append ( wxT ( " 4x " ) ) ;
m_MaxAnisotropyCB - > Append ( wxT ( " 8x " ) ) ;
m_MaxAnisotropyCB - > Append ( wxT ( " 16x " ) ) ;
m_MaxAnisotropyCB - > SetSelection ( g_Config . iMaxAnisotropy - 1 ) ;
2009-09-13 08:21:35 +00:00
m_ForceFiltering = new wxCheckBox ( m_PageGeneral , ID_FORCEFILTERING , wxT ( " Force bi/trilinear filter. (Breaks FMV in many Wii games) " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-03-15 08:32:35 +00:00
m_ForceFiltering - > SetValue ( g_Config . bForceFiltering ) ;
2008-12-08 05:25:12 +00:00
2009-06-09 19:40:47 +00:00
wxStaticText * PostShaderText = new wxStaticText ( m_PageGeneral , ID_POSTSHADERTEXT , wxT ( " Post-processing shader: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
m_PostShaderCB = new wxChoice ( m_PageGeneral , ID_POSTSHADER , wxDefaultPosition , wxDefaultSize , arrayStringFor_PostShaderCB , 0 , wxDefaultValidator ) ;
m_PostShaderCB - > Append ( wxT ( " (off) " ) ) ;
m_ReloadShader = new wxButton ( m_PageGeneral , ID_RELOADSHADER , wxT ( " &Reload " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_EditShader = new wxButton ( m_PageGeneral , ID_EDITSHADER , wxT ( " &Edit " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
if ( File : : IsDirectory ( " User/Shaders " ) )
{
File : : FSTEntry entry ;
File : : ScanDirectoryTree ( " User/Shaders " , entry ) ;
2009-06-09 21:10:14 +00:00
for ( u32 i = 0 ; i < entry . children . size ( ) ; i + + )
2009-06-09 19:40:47 +00:00
{
std : : string name = entry . children [ i ] . virtualName . c_str ( ) ;
2009-06-09 21:10:14 +00:00
if ( ! strcasecmp ( name . substr ( name . size ( ) - 4 ) . c_str ( ) , " .txt " ) )
2009-06-09 19:40:47 +00:00
name = name . substr ( 0 , name . size ( ) - 4 ) ;
2009-06-09 21:10:14 +00:00
m_PostShaderCB - > Append ( wxString : : FromAscii ( name . c_str ( ) ) ) ;
2009-06-09 19:40:47 +00:00
}
}
else
{
File : : CreateDir ( " User/Shaders " ) ;
}
2009-06-09 21:10:14 +00:00
wxString shader = wxString : : FromAscii ( g_Config . sPostProcessingShader . c_str ( ) ) ;
if ( shader = = _ ( " " ) )
shader = wxT ( " (off) " ) ;
2009-06-09 19:40:47 +00:00
m_PostShaderCB - > SetStringSelection ( shader ) ;
2009-09-06 15:11:21 +00:00
// Sizers
2008-12-08 05:25:12 +00:00
sGeneral = new wxBoxSizer ( wxVERTICAL ) ;
2009-06-06 13:36:33 +00:00
sBasic = new wxGridBagSizer ( 0 , 0 ) ;
2009-06-07 14:50:16 +00:00
sBasic - > Add ( IRText , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2009-08-13 09:24:44 +00:00
sBasic - > Add ( m_NativeResolution , wxGBPosition ( 0 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2009-09-05 05:42:51 +00:00
sBasic - > Add ( m_2xResolution , wxGBPosition ( 0 , 2 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2009-08-13 09:24:44 +00:00
sBasic - > Add ( RText , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sBasic - > Add ( WMText , wxGBPosition ( 1 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sBasic - > Add ( m_WindowResolutionCB , wxGBPosition ( 2 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sBasic - > Add ( FMText , wxGBPosition ( 1 , 2 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2009-08-16 12:11:36 +00:00
sBasic - > Add ( m_WindowFSResolutionCB , wxGBPosition ( 2 , 2 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
2009-06-06 13:36:33 +00:00
2009-08-13 09:24:44 +00:00
sBasic - > Add ( KeepARText , wxGBPosition ( 3 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sBasic - > Add ( m_KeepAR43 , wxGBPosition ( 3 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sBasic - > Add ( m_KeepAR169 , wxGBPosition ( 3 , 2 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sBasic - > Add ( m_Crop , wxGBPosition ( 3 , 3 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
2009-09-02 21:30:19 +00:00
sBasic - > Add ( m_WidescreenHack , wxGBPosition ( 4 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2009-08-13 09:24:44 +00:00
2009-06-06 13:36:33 +00:00
// This option is configured from the main Dolphin.exe settings for _WIN32
2009-01-04 23:00:07 +00:00
# ifndef _WIN32
2009-09-06 15:11:21 +00:00
sBasic - > Add ( m_HideCursor , wxGBPosition ( 5 , 0 ) , wxGBSpan ( 1 , 4 ) , wxALL , 5 ) ;
2009-01-04 23:00:07 +00:00
# endif
2009-02-25 05:54:36 +00:00
2008-12-08 05:25:12 +00:00
sbBasic - > Add ( sBasic ) ;
sGeneral - > Add ( sbBasic , 0 , wxEXPAND | wxALL , 5 ) ;
2009-06-06 13:36:33 +00:00
sBasicAdvanced = new wxGridBagSizer ( 0 , 0 ) ;
2009-09-06 15:11:21 +00:00
sBasicAdvanced - > Add ( WM2Text , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sBasicAdvanced - > Add ( m_RenderToMainWindow , wxGBPosition ( 0 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sBasicAdvanced - > Add ( m_Fullscreen , wxGBPosition ( 0 , 2 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sBasicAdvanced - > Add ( m_EFBCopyDisableHotKey , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 3 ) , wxALL , 5 ) ;
sBasicAdvanced - > Add ( m_VSync , wxGBPosition ( 2 , 0 ) , wxGBSpan ( 1 , 3 ) , wxALL , 5 ) ;
sBasicAdvanced - > Add ( m_UseXFB , wxGBPosition ( 3 , 0 ) , wxGBSpan ( 1 , 3 ) , wxALL , 5 ) ;
2009-06-08 02:48:38 +00:00
sBasicAdvanced - > Add ( m_AutoScale , wxGBPosition ( 4 , 0 ) , wxGBSpan ( 1 , 3 ) , wxALL , 5 ) ;
2009-06-06 13:36:33 +00:00
sbBasicAdvanced - > Add ( sBasicAdvanced ) ;
sGeneral - > Add ( sbBasicAdvanced , 0 , wxEXPAND | wxALL , 5 ) ;
2008-12-08 05:25:12 +00:00
sEnhancements = new wxGridBagSizer ( 0 , 0 ) ;
2009-03-08 20:04:40 +00:00
sEnhancements - > Add ( AnisoText , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sEnhancements - > Add ( m_MaxAnisotropyCB , wxGBPosition ( 0 , 1 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sEnhancements - > Add ( MSAAText , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sEnhancements - > Add ( m_MSAAModeCB , wxGBPosition ( 1 , 1 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
2009-03-09 20:18:36 +00:00
sEnhancements - > Add ( m_ForceFiltering , wxGBPosition ( 2 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
2009-06-09 19:40:47 +00:00
sEnhancements - > Add ( PostShaderText , wxGBPosition ( 3 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sEnhancements - > Add ( m_PostShaderCB , wxGBPosition ( 3 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sEnhancements - > Add ( m_ReloadShader , wxGBPosition ( 3 , 2 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sEnhancements - > Add ( m_EditShader , wxGBPosition ( 3 , 3 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
2008-12-08 05:25:12 +00:00
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 ) ;
m_ShowFPS - > SetValue ( g_Config . bShowFPS ) ;
m_Statistics = new wxCheckBox ( m_PageAdvanced , ID_STATISTICS , wxT ( " Overlay some statistics " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_Statistics - > SetValue ( g_Config . bOverlayStats ) ;
2009-02-15 20:49:59 +00:00
m_ProjStats = new wxCheckBox ( m_PageAdvanced , ID_PROJSTATS , wxT ( " Overlay Projection Stats " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_ProjStats - > SetValue ( g_Config . bOverlayProjStats ) ;
2009-03-16 07:54:44 +00:00
m_ShowEFBCopyRegions = new wxCheckBox ( m_PageAdvanced , ID_SHOWEFBCOPYREGIONS , wxT ( " Show EFB Copy Regions " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_ShowEFBCopyRegions - > SetValue ( g_Config . bShowEFBCopyRegions ) ;
2009-03-02 19:38:38 +00:00
m_ShaderErrors = new wxCheckBox ( m_PageAdvanced , ID_SHADERERRORS , wxT ( " Show shader compilation issues " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-12-08 05:25:12 +00:00
//m_ShaderErrors->SetValue(g_Config.bShowShaderErrors);
2009-03-02 19:38:38 +00:00
m_ShaderErrors - > Enable ( false ) ;
2008-12-08 05:25:12 +00:00
m_TexFmtOverlay = new wxCheckBox ( m_PageAdvanced , ID_TEXFMTOVERLAY , wxT ( " Overlay texture format " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_TexFmtOverlay - > SetValue ( g_Config . bTexFmtOverlayEnable ) ;
m_TexFmtCenter = new wxCheckBox ( m_PageAdvanced , ID_TEXFMTCENTER , wxT ( " centered " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_TexFmtCenter - > SetValue ( g_Config . bTexFmtOverlayCenter ) ;
m_TexFmtCenter - > Enable ( m_TexFmtOverlay - > IsChecked ( ) ) ;
// Render
sbRendering = new wxStaticBoxSizer ( wxVERTICAL , m_PageAdvanced , wxT ( " Rendering " ) ) ;
m_Wireframe = new wxCheckBox ( m_PageAdvanced , ID_WIREFRAME , wxT ( " Enable Wireframe " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_Wireframe - > SetValue ( g_Config . bWireFrame ) ;
m_Wireframe - > Enable ( true ) ;
m_DisableLighting = new wxCheckBox ( m_PageAdvanced , ID_DISABLELIGHTING , wxT ( " Disable Material Lighting " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_DisableLighting - > SetValue ( g_Config . bDisableLighting ) ;
m_DisableLighting - > Enable ( true ) ;
m_DisableTexturing = new wxCheckBox ( m_PageAdvanced , ID_DISABLETEXTURING , wxT ( " Disable Texturing " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_DisableTexturing - > SetValue ( g_Config . bDisableTexturing ) ;
m_DisableTexturing - > Enable ( true ) ;
2009-03-16 07:54:44 +00:00
m_DstAlphaPass = new wxCheckBox ( m_PageAdvanced , ID_DSTALPHAPASS , wxT ( " Disable Destination Alpha Pass " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-03-16 05:04:59 +00:00
m_DstAlphaPass - > SetValue ( g_Config . bDstAlphaPass ) ;
m_DstAlphaPass - > Enable ( true ) ;
2009-04-01 12:31:18 +00:00
m_DisableFog = new wxCheckBox ( m_PageAdvanced , ID_DISABLEFOG , wxT ( " Disable Fog " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_DisableFog - > SetValue ( g_Config . bDisableFog ) ;
2009-01-19 21:18:43 +00:00
2009-01-13 20:50:51 +00:00
m_StaticBox_EFB = new wxStaticBox ( m_PageAdvanced , ID_STATICBOX_EFB , wxT ( " EFB Copy " ) ) ;
m_CheckBox_DisableCopyEFB = new wxCheckBox ( m_PageAdvanced , ID_CHECKBOX_DISABLECOPYEFB , wxT ( " Disable " ) ) ;
m_CheckBox_DisableCopyEFB - > SetValue ( g_Config . bEFBCopyDisable ) ;
2009-07-30 07:08:31 +00:00
m_CheckBox_DisableCopyEFB - > SetToolTip ( wxT ( " This may lead to a higher FPS in for example Zelda - TP. " )
wxT ( " But it may also cause graphical errors and missing graphics. " ) ) ;
2009-01-19 21:18:43 +00:00
2009-01-13 20:50:51 +00:00
m_Radio_CopyEFBToRAM = new wxRadioButton ( m_PageAdvanced , ID_RADIO_COPYEFBTORAM , wxT ( " Copy EFB to system RAM (real) " ) ) ;
2009-01-19 21:18:43 +00:00
m_Radio_CopyEFBToRAM - > SetToolTip ( wxT ( " [This option will apply immediately and does not require a restart to take effect.] " ) ) ;
2009-01-13 20:50:51 +00:00
m_Radio_CopyEFBToGL = new wxRadioButton ( m_PageAdvanced , ID_RADIO_COPYEFBTOGL , wxT ( " Copy EFB to GL texture (hack) " ) ) ;
2009-01-19 21:18:43 +00:00
m_Radio_CopyEFBToGL - > SetToolTip ( wxT ( " [This option will apply immediately and does not require a restart to take effect.] " ) ) ;
2009-01-13 20:50:51 +00:00
g_Config . bCopyEFBToRAM ? m_Radio_CopyEFBToRAM - > SetValue ( true ) : m_Radio_CopyEFBToGL - > SetValue ( true ) ;
2008-12-08 05:25:12 +00:00
// Utility
sbUtilities = new wxStaticBoxSizer ( wxVERTICAL , m_PageAdvanced , wxT ( " Utilities " ) ) ;
2009-03-07 09:29:25 +00:00
m_DumpTextures = new wxCheckBox ( m_PageAdvanced , ID_DUMPTEXTURES , wxT ( " Dump textures " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2008-12-08 05:25:12 +00:00
m_DumpTextures - > SetValue ( g_Config . bDumpTextures ) ;
2009-05-07 07:43:56 +00:00
m_HiresTextures = new wxCheckBox ( m_PageAdvanced , ID_HIRESTEXTURES , wxT ( " Load Hires textures " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_HiresTextures - > SetValue ( g_Config . bHiresTextures ) ;
2009-03-07 09:29:25 +00:00
m_DumpEFBTarget = new wxCheckBox ( m_PageAdvanced , ID_DUMPEFBTARGET , wxT ( " Dump EFB Target " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_DumpEFBTarget - > SetValue ( g_Config . bDumpEFBTarget ) ;
2009-03-28 21:07:16 +00:00
m_DumpFrames = new wxCheckBox ( m_PageAdvanced , ID_DUMPFRAMES , wxT ( " Dump Rendered Frames " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
# ifdef _WIN32
2009-07-30 07:08:31 +00:00
m_DumpFrames - > SetToolTip (
wxT ( " When dumping begins, you will be prompted to choose a video codec to " )
wxT ( " encode the video in. " ) ) ;
2009-03-28 21:07:16 +00:00
# else
m_DumpFrames - > SetToolTip ( wxT (
" !!WARNING!! This option dumps raw bitmaps of each frame, and will fill up "
" your hard drive very quickly. Only turn this on if you have a named pipe "
" set up for the dump or several gigabytes of space available. " ) ) ;
# endif
m_DumpFrames - > SetValue ( g_Config . bDumpFrames ) ;
2009-08-08 22:01:18 +00:00
m_FreeLook = new wxCheckBox ( m_PageAdvanced , ID_FREELOOK , wxT ( " Free Look " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
m_FreeLook - > SetToolTip (
wxT ( " Use WASD to move around, 0 and 9 to move faster or slower, and the " )
wxT ( " left mouse button to pan the view. " ) ) ;
m_FreeLook - > SetValue ( g_Config . bFreeLook ) ;
2008-12-08 05:25:12 +00:00
2009-02-19 02:58:29 +00:00
// Hacks controls
2009-01-12 15:00:00 +00:00
m_SafeTextureCache = new wxCheckBox ( m_PageAdvanced , ID_SAFETEXTURECACHE , wxT ( " Use Safe texture cache " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-05-11 06:40:03 +00:00
m_PhackvalueCB = new wxChoice ( m_PageAdvanced , ID_PHACKVALUE , wxDefaultPosition , wxDefaultSize , arrayStringFor_PhackvalueCB , 0 , wxDefaultValidator ) ;
2009-05-11 06:48:14 +00:00
m_PhackvalueCB - > Append ( wxT ( " None " ) ) ;
2009-05-13 13:28:49 +00:00
m_PhackvalueCB - > Append ( wxT ( " Zelda Twilight Princess Bloom hack " ) ) ;
2009-05-11 06:48:14 +00:00
m_PhackvalueCB - > Append ( wxT ( " Sonic and the Black Knight " ) ) ;
m_PhackvalueCB - > Append ( wxT ( " Bleach Versus Crusade " ) ) ;
m_PhackvalueCB - > Append ( wxT ( " Final Fantasy CC Echo of Time " ) ) ;
2009-06-09 14:24:20 +00:00
m_PhackvalueCB - > Append ( wxT ( " Harvest Moon Magical Melody " ) ) ;
m_PhackvalueCB - > Append ( wxT ( " Baten Kaitos " ) ) ;
m_PhackvalueCB - > Append ( wxT ( " Baten Kaitos Origin " ) ) ;
2009-06-10 01:26:42 +00:00
m_PhackvalueCB - > Append ( wxT ( " Skies of Arcadia " ) ) ;
2009-05-11 06:40:03 +00:00
m_PhackvalueCB - > SetSelection ( g_Config . iPhackvalue ) ;
2009-04-10 10:25:53 +00:00
2009-02-19 02:58:29 +00:00
// Default values
2008-12-08 05:25:12 +00:00
m_SafeTextureCache - > SetValue ( g_Config . bSafeTextureCache ) ;
2009-02-19 02:58:29 +00:00
// Tool tips
2009-07-30 07:08:31 +00:00
m_SafeTextureCache - > SetToolTip ( wxT ( " This is useful to prevent Metroid Prime from crashing, but can cause problems in other games. " )
wxT ( " \n [This option will apply immediately and does not require a restart. However it may not " )
wxT ( " be entirely safe to change it midgames.] " ) ) ;
2009-05-13 13:28:49 +00:00
2009-07-30 07:08:31 +00:00
m_DstAlphaPass - > SetToolTip ( wxT ( " This renders a second time to set alpha to a constant value, " )
wxT ( " \n Disabling it may speed up some games, but could also cause glitches. " ) ) ;
2009-04-01 12:31:18 +00:00
m_DisableFog - > SetToolTip ( wxT ( " This option should not require a restart. " ) ) ;
2008-12-08 05:25:12 +00:00
2009-02-19 02:58:29 +00:00
// Sizers
sHacks = new wxGridBagSizer ( 0 , 0 ) ;
2009-05-11 06:40:03 +00:00
sHacks - > Add ( m_SafeTextureCache , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sHacks - > Add ( m_PhackvalueCB , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
2009-04-10 10:25:53 +00:00
2009-02-19 02:58:29 +00:00
sbHacks = new wxStaticBoxSizer ( wxVERTICAL , m_PageAdvanced , wxT ( " Hacks " ) ) ;
2009-02-20 13:35:43 +00:00
sbHacks - > Add ( sHacks , 0 , wxEXPAND | ( wxTOP ) , 0 ) ;
2009-02-19 02:58:29 +00:00
// Sizers
2008-12-08 05:25:12 +00:00
sAdvanced = new wxBoxSizer ( wxVERTICAL ) ;
sInfo = new wxGridBagSizer ( 0 , 0 ) ;
sInfo - > Add ( m_ShowFPS , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
2009-03-02 19:38:38 +00:00
sInfo - > Add ( m_ShaderErrors , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sInfo - > Add ( m_Statistics , wxGBPosition ( 2 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
2009-07-26 09:52:35 +00:00
sInfo - > Add ( m_ProjStats , wxGBPosition ( 3 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sInfo - > Add ( m_ShowEFBCopyRegions , wxGBPosition ( 4 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sInfo - > Add ( m_TexFmtOverlay , wxGBPosition ( 5 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
sInfo - > Add ( m_TexFmtCenter , wxGBPosition ( 5 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALL , 5 ) ;
2008-12-08 05:25:12 +00:00
sbInfo - > Add ( sInfo ) ;
2009-02-19 02:58:29 +00:00
2009-01-13 20:50:51 +00:00
wxBoxSizer * sRenderBoxRow1 = new wxBoxSizer ( wxHORIZONTAL ) ;
2008-12-08 05:25:12 +00:00
sRendering = new wxGridBagSizer ( 0 , 0 ) ;
2009-04-01 12:31:18 +00:00
sRendering - > Add ( m_Wireframe , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 4 ) ;
sRendering - > Add ( m_DisableLighting , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 4 ) ;
sRendering - > Add ( m_DisableTexturing , wxGBPosition ( 2 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 4 ) ;
sRendering - > Add ( m_DstAlphaPass , wxGBPosition ( 3 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 4 ) ;
sRendering - > Add ( m_DisableFog , wxGBPosition ( 4 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALL , 4 ) ;
sRenderBoxRow1 - > Add ( sRendering , 0 , wxALL | wxEXPAND , 1 ) ;
2009-01-13 20:50:51 +00:00
wxStaticBoxSizer * sSBox = new wxStaticBoxSizer ( m_StaticBox_EFB , wxVERTICAL ) ;
wxBoxSizer * sStrip1 = new wxBoxSizer ( wxHORIZONTAL ) ;
sStrip1 - > Add ( m_CheckBox_DisableCopyEFB , 0 , wxALL | wxEXPAND , 5 ) ;
sSBox - > Add ( sStrip1 , 0 , wxALL | wxEXPAND , 0 ) ;
sSBox - > Add ( m_Radio_CopyEFBToRAM , 0 , wxALL | wxEXPAND , 5 ) ;
sSBox - > Add ( m_Radio_CopyEFBToGL , 0 , wxALL | wxEXPAND , 5 ) ;
sRenderBoxRow1 - > Add ( sSBox , 0 , wxALL | wxEXPAND , 5 ) ;
sbRendering - > Add ( sRenderBoxRow1 ) ;
2009-02-19 02:58:29 +00:00
2009-04-19 10:10:45 +00:00
//sUtilities = new wxBoxSizer(wxHORIZONTAL);
sUtilities = new wxGridBagSizer ( 0 , 0 ) ;
sUtilities - > Add ( m_DumpTextures , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2009-05-07 07:43:56 +00:00
sUtilities - > Add ( m_HiresTextures , wxGBPosition ( 0 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sUtilities - > Add ( m_DumpEFBTarget , wxGBPosition ( 0 , 2 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2009-04-19 10:10:45 +00:00
sUtilities - > Add ( m_DumpFrames , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sUtilities - > Add ( m_FreeLook , wxGBPosition ( 1 , 1 ) , wxGBSpan ( 1 , 1 ) , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2009-02-04 17:33:59 +00:00
sbUtilities - > Add ( sUtilities , 1 , wxEXPAND ) ;
2008-12-08 05:25:12 +00:00
2009-02-19 02:58:29 +00:00
// Sizers
sAdvanced - > Add ( sbInfo , 0 , wxEXPAND | wxALL , 5 ) ;
sAdvanced - > Add ( sbRendering , 0 , wxEXPAND | ( wxLEFT | wxDOWN | wxRIGHT ) , 5 ) ;
sAdvanced - > Add ( sbUtilities , 1 , wxEXPAND | ( wxLEFT | wxDOWN | wxRIGHT ) , 5 ) ;
2009-02-20 13:35:43 +00:00
sAdvanced - > Add ( sbHacks , 0 , wxEXPAND | ( wxLEFT | wxDOWN | wxRIGHT ) , 5 ) ;
2009-02-19 02:58:29 +00:00
2008-12-08 05:25:12 +00:00
m_PageAdvanced - > SetSizer ( sAdvanced ) ;
sAdvanced - > Layout ( ) ;
Fit ( ) ;
Center ( ) ;
2009-02-19 02:58:29 +00:00
UpdateGUI ( ) ;
2008-12-08 05:25:12 +00:00
}
2009-07-02 17:11:27 +00:00
void GFXConfigDialogOGL : : AboutClick ( wxCommandEvent & WXUNUSED ( event ) )
2008-12-08 05:25:12 +00:00
{
2009-07-30 07:08:31 +00:00
wxMessageBox ( wxT ( " Dolphin OpenGL Plugin \n By zerofrog(@gmail.com) \n \n " )
wxT ( " A card supporting Vertex/Pixel Shader 2.0 or higher, framebuffer objects, " )
wxT ( " and multiple render targets is required in order to use this plugin. " ) ,
wxT ( " Dolphin OGL " ) , wxOK , this ) ;
2008-12-08 05:25:12 +00:00
}
2009-07-02 17:11:27 +00:00
void GFXConfigDialogOGL : : ReloadShaderClick ( wxCommandEvent & WXUNUSED ( event ) )
2009-06-09 19:40:47 +00:00
{
PostProcessing : : ReloadShader ( ) ;
}
2009-07-02 17:11:27 +00:00
void GFXConfigDialogOGL : : EditShaderClick ( wxCommandEvent & WXUNUSED ( event ) )
2009-06-09 19:40:47 +00:00
{
2009-06-09 21:10:14 +00:00
if ( m_PostShaderCB - > GetStringSelection ( ) = = wxT ( " (off) " ) )
2009-06-09 19:40:47 +00:00
return ;
2009-06-09 21:10:14 +00:00
wxString shader = wxT ( " User/Shaders/ " ) + m_PostShaderCB - > GetStringSelection ( ) + _ ( " .txt " ) ;
2009-06-09 19:40:47 +00:00
if ( wxFileExists ( shader ) )
{
wxFileType * filetype = wxTheMimeTypesManager - > GetFileTypeFromExtension ( _ ( " txt " ) ) ;
if ( filetype = = NULL ) // From extension failed, trying with MIME type now
{
filetype = wxTheMimeTypesManager - > GetFileTypeFromMimeType ( _ ( " text/plain " ) ) ;
if ( filetype = = NULL ) // MIME type failed, aborting mission
{
PanicAlert ( " Filetype 'txt' is unknown! Will not open! " ) ;
return ;
}
}
wxString OpenCommand ;
OpenCommand = filetype - > GetOpenCommand ( shader ) ;
if ( OpenCommand . IsEmpty ( ) )
PanicAlert ( " Couldn't find open command for extension 'ini'! " ) ;
else
if ( wxExecute ( OpenCommand , wxEXEC_ASYNC ) = = - 1 )
PanicAlert ( " wxExecute returned -1 on application run! " ) ;
}
}
2009-07-02 17:11:27 +00:00
void GFXConfigDialogOGL : : GeneralSettingsChanged ( wxCommandEvent & event )
2008-12-08 05:25:12 +00:00
{
switch ( event . GetId ( ) )
{
case ID_FULLSCREEN :
g_Config . bFullscreen = m_Fullscreen - > IsChecked ( ) ;
break ;
case ID_RENDERTOMAINWINDOW :
2009-09-06 13:36:05 +00:00
g_Config . RenderToMainframe = m_RenderToMainWindow - > IsChecked ( ) ;
2009-04-03 20:12:59 +00:00
g_Config . bFullscreen = false ;
2008-12-08 05:25:12 +00:00
break ;
2009-02-28 16:33:59 +00:00
case ID_NATIVERESOLUTION :
g_Config . bNativeResolution = m_NativeResolution - > IsChecked ( ) ;
2009-09-05 05:42:51 +00:00
// Don't allow 1x and 2x at the same time
if ( g_Config . bNativeResolution ) { g_Config . b2xResolution = false ; m_2xResolution - > SetValue ( false ) ; }
break ;
case ID_2X_RESOLUTION :
g_Config . b2xResolution = m_2xResolution - > IsChecked ( ) ;
// Don't allow 1x and 2x at the same time
if ( g_Config . b2xResolution ) { g_Config . bNativeResolution = false ; m_NativeResolution - > SetValue ( false ) ; }
2009-06-08 06:05:09 +00:00
break ;
2009-09-02 21:30:19 +00:00
case ID_WIDESCREEN_HACK :
g_Config . bWidescreenHack = m_WidescreenHack - > IsChecked ( ) ;
break ;
2009-03-05 23:11:13 +00:00
case ID_VSYNC :
g_Config . bVSync = m_VSync - > IsChecked ( ) ;
break ;
2009-02-28 16:33:59 +00:00
case ID_USEXFB :
g_Config . bUseXFB = m_UseXFB - > IsChecked ( ) ;
break ;
case ID_AUTOSCALE :
g_Config . bAutoScale = m_AutoScale - > IsChecked ( ) ;
2008-12-08 05:25:12 +00:00
break ;
2009-03-09 20:18:36 +00:00
case ID_KEEPAR_4_3 :
2009-02-24 19:16:08 +00:00
g_Config . bKeepAR43 = m_KeepAR43 - > IsChecked ( ) ;
// Don't allow both at the same time
if ( g_Config . bKeepAR43 ) { g_Config . bKeepAR169 = false ; m_KeepAR169 - > SetValue ( false ) ; }
break ;
2009-03-09 20:18:36 +00:00
case ID_KEEPAR_16_9 :
2009-02-24 19:16:08 +00:00
g_Config . bKeepAR169 = m_KeepAR169 - > IsChecked ( ) ;
// Don't allow both at the same time
if ( g_Config . bKeepAR169 ) { g_Config . bKeepAR43 = false ; m_KeepAR43 - > SetValue ( false ) ; }
2008-12-08 05:25:12 +00:00
break ;
2009-03-09 20:18:36 +00:00
case ID_CROP :
2009-02-25 05:54:36 +00:00
g_Config . bCrop = m_Crop - > IsChecked ( ) ;
break ;
2009-02-28 16:33:59 +00:00
2009-03-09 20:18:36 +00:00
case ID_FORCEFILTERING :
g_Config . bForceFiltering = m_ForceFiltering - > IsChecked ( ) ;
break ;
2009-01-04 23:00:07 +00:00
# ifndef _WIN32
2009-02-28 16:33:59 +00:00
case ID_HIDECURSOR :
g_Config . bHideCursor = m_HideCursor - > IsChecked ( ) ;
break ;
2009-01-04 23:00:07 +00:00
# endif
2008-12-08 05:25:12 +00:00
case ID_WINDOWRESOLUTIONCB :
2009-09-13 08:21:35 +00:00
strcpy ( g_Config . cInternalRes , m_WindowResolutionCB - > GetValue ( ) . mb_str ( ) ) ;
2009-08-13 09:24:44 +00:00
break ;
2009-08-16 12:11:36 +00:00
case ID_WINDOWFSRESOLUTIONCB :
2009-09-13 08:21:35 +00:00
strcpy ( g_Config . cFSResolution , m_WindowFSResolutionCB - > GetValue ( ) . mb_str ( ) ) ;
2008-12-08 05:25:12 +00:00
break ;
case ID_MAXANISOTROPY :
g_Config . iMaxAnisotropy = m_MaxAnisotropyCB - > GetSelection ( ) + 1 ;
break ;
2009-03-08 20:04:40 +00:00
case ID_MSAAMODECB :
g_Config . iMultisampleMode = m_MSAAModeCB - > GetSelection ( ) ;
2008-12-08 05:25:12 +00:00
break ;
2009-05-11 21:20:27 +00:00
case ID_PHACKVALUE :
2009-05-11 06:40:03 +00:00
g_Config . iPhackvalue = m_PhackvalueCB - > GetSelection ( ) ;
2009-05-11 21:20:27 +00:00
if ( g_Config . iPhackvalue > = 0 )
2009-05-11 06:40:03 +00:00
{
2009-06-03 23:38:31 +00:00
g_Config . UpdateProjectionHack ( ) ;
2009-05-11 06:40:03 +00:00
}
break ;
2009-06-09 19:40:47 +00:00
case ID_POSTSHADER :
2009-06-09 21:10:14 +00:00
g_Config . sPostProcessingShader = m_PostShaderCB - > GetString ( m_PostShaderCB - > GetSelection ( ) ) . mb_str ( ) ;
2009-06-09 19:40:47 +00:00
if ( g_Config . sPostProcessingShader = = " (off) " )
g_Config . sPostProcessingShader = " " ;
break ;
2008-12-08 05:25:12 +00:00
}
2009-02-19 02:58:29 +00:00
UpdateGUI ( ) ;
}
2008-12-08 05:25:12 +00:00
2009-07-02 17:11:27 +00:00
void GFXConfigDialogOGL : : AdvancedSettingsChanged ( wxCommandEvent & event )
2008-12-08 05:25:12 +00:00
{
switch ( event . GetId ( ) )
{
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 ;
case ID_TEXFMTOVERLAY :
g_Config . bTexFmtOverlayEnable = m_TexFmtOverlay - > IsChecked ( ) ;
m_TexFmtCenter - > Enable ( m_TexFmtOverlay - > IsChecked ( ) ) ;
2009-02-22 20:21:56 +00:00
TextureMngr : : Invalidate ( false ) ;
2008-12-08 05:25:12 +00:00
break ;
case ID_TEXFMTCENTER :
g_Config . bTexFmtOverlayCenter = m_TexFmtCenter - > IsChecked ( ) ;
2009-02-22 20:21:56 +00:00
TextureMngr : : Invalidate ( false ) ;
2008-12-08 05:25:12 +00:00
break ;
2009-03-16 07:54:44 +00:00
case ID_SHOWEFBCOPYREGIONS :
g_Config . bShowEFBCopyRegions = m_ShowEFBCopyRegions - > IsChecked ( ) ;
break ;
2008-12-08 05:25:12 +00:00
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 ;
2009-04-01 12:31:18 +00:00
case ID_DISABLEFOG :
g_Config . bDisableFog = m_DisableFog - > IsChecked ( ) ;
2009-05-11 06:40:03 +00:00
break ;
2009-03-16 05:04:59 +00:00
case ID_DSTALPHAPASS :
g_Config . bDstAlphaPass = m_DstAlphaPass - > IsChecked ( ) ;
break ;
2008-12-08 05:25:12 +00:00
case ID_DUMPTEXTURES :
g_Config . bDumpTextures = m_DumpTextures - > IsChecked ( ) ;
break ;
2009-05-07 07:43:56 +00:00
case ID_HIRESTEXTURES :
g_Config . bHiresTextures = m_HiresTextures - > IsChecked ( ) ;
break ;
2009-03-07 09:29:25 +00:00
case ID_DUMPEFBTARGET :
g_Config . bDumpEFBTarget = m_DumpEFBTarget - > IsChecked ( ) ;
break ;
2009-03-28 21:07:16 +00:00
case ID_DUMPFRAMES :
g_Config . bDumpFrames = m_DumpFrames - > IsChecked ( ) ;
break ;
2009-04-19 10:10:45 +00:00
case ID_FREELOOK :
g_Config . bFreeLook = m_FreeLook - > IsChecked ( ) ;
break ;
2008-12-08 05:25:12 +00:00
case ID_TEXTUREPATH :
break ;
2009-01-13 20:50:51 +00:00
case ID_CHECKBOX_DISABLECOPYEFB :
g_Config . bEFBCopyDisable = m_CheckBox_DisableCopyEFB - > IsChecked ( ) ;
2008-12-08 05:25:12 +00:00
break ;
2009-01-11 22:25:57 +00:00
case ID_EFBCOPYDISABLEHOTKEY :
g_Config . bEFBCopyDisableHotKey = m_EFBCopyDisableHotKey - > IsChecked ( ) ;
2008-12-08 05:25:12 +00:00
break ;
2009-02-19 02:58:29 +00:00
// Hacks
2008-12-08 05:25:12 +00:00
case ID_SAFETEXTURECACHE :
g_Config . bSafeTextureCache = m_SafeTextureCache - > IsChecked ( ) ;
break ;
2009-05-11 06:40:03 +00:00
case ID_HACK :
g_Config . bHack = m_Hack - > IsChecked ( ) ;
2009-04-10 10:25:53 +00:00
break ;
2009-01-13 20:50:51 +00:00
case ID_RADIO_COPYEFBTORAM :
g_Config . bCopyEFBToRAM = true ;
break ;
case ID_RADIO_COPYEFBTOGL :
g_Config . bCopyEFBToRAM = false ;
2009-01-11 22:25:57 +00:00
break ;
2009-02-15 20:49:59 +00:00
case ID_PROJSTATS :
g_Config . bOverlayProjStats = m_ProjStats - > IsChecked ( ) ;
break ;
2008-12-08 05:25:12 +00:00
default :
break ;
}
2009-02-19 02:58:29 +00:00
UpdateGUI ( ) ;
2008-12-08 05:25:12 +00:00
}
2009-07-26 09:52:35 +00:00
void GFXConfigDialogOGL : : CloseWindow ( )
{
// Save the config to INI
2009-09-13 08:21:35 +00:00
g_Config . Save ( FULL_CONFIG_DIR " gfx_opengl.ini " ) ;
2009-07-26 09:52:35 +00:00
EndModal ( 1 ) ;
}
2009-02-19 02:58:29 +00:00
2009-07-02 17:11:27 +00:00
void GFXConfigDialogOGL : : UpdateGUI ( )
2009-02-19 02:58:29 +00:00
{
2009-02-25 05:54:36 +00:00
// This is only used together with the aspect ratio options
2009-02-28 16:33:59 +00:00
m_Crop - > Enable ( g_Config . bKeepAR43 | | g_Config . bKeepAR169 ) ;
2009-03-08 21:42:27 +00:00
if ( g_Config . bUseXFB )
{
2009-02-28 16:33:59 +00:00
// XFB looks much better if the copy comes from native resolution.
g_Config . bNativeResolution = true ;
m_NativeResolution - > SetValue ( true ) ;
}
m_AutoScale - > Enable ( ! g_Config . bUseXFB ) ;
2009-02-20 15:52:17 +00:00
2009-02-19 11:28:55 +00:00
// These options are for the separate rendering window
2009-09-06 13:36:05 +00:00
m_Fullscreen - > Enable ( ! g_Config . RenderToMainframe ) ;
if ( g_Config . RenderToMainframe ) m_Fullscreen - > SetValue ( false ) ;
2009-06-06 13:36:33 +00:00
2009-09-06 15:11:21 +00:00
// Resolution settings
m_2xResolution - > Enable ( ! g_Config . bRunning | | Renderer : : Allow2x ( ) ) ;
m_WindowResolutionCB - > Enable ( ! g_Config . bRunning & & ! ( g_Config . bNativeResolution | | g_Config . b2xResolution ) ) ;
m_WindowFSResolutionCB - > Enable ( ! g_Config . bRunning & & ! ( g_Config . RenderToMainframe | | g_Config . bNativeResolution | | g_Config . b2xResolution ) ) ;
2009-08-23 03:14:07 +00:00
2009-09-06 15:11:21 +00:00
// Disable the Copy to options when EFBCopy is disabled
2009-08-23 03:14:07 +00:00
m_Radio_CopyEFBToRAM - > Enable ( ! ( g_Config . bEFBCopyDisable ) ) ;
2009-09-06 15:11:21 +00:00
m_Radio_CopyEFBToGL - > Enable ( ! ( g_Config . bEFBCopyDisable ) ) ;
2009-02-20 03:49:57 +00:00
}
2009-06-06 13:36:33 +00:00
2009-05-11 21:20:27 +00:00