changed ConfigMain and ogl config.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1067 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2008-11-04 09:56:25 +00:00
parent 1473512180
commit b6b61f0a9f
11 changed files with 296 additions and 461 deletions
@@ -194,7 +194,7 @@ void CEXIMemoryCard::SetCS(int cs)
if (m_uPosition > 2)
{
memset(memory_card_content, 0xFF, memory_card_size);
status &= ~0x80;
status &= ~MC_STATUS_BUSY;
}
break;
@@ -80,7 +80,6 @@ void AboutDolphin::CreateGUIControls()
this->SetSizer(sMain);
sMain->Layout();
SetIcon(wxNullIcon);
CenterOnParent();
Fit();
}
+29 -56
View File
@@ -26,9 +26,7 @@
BEGIN_EVENT_TABLE(CConfigMain, wxDialog)
EVT_CLOSE(CConfigMain::OnClose)
EVT_BUTTON(ID_OK, CConfigMain::OKClick)
EVT_BUTTON(ID_APPLY, CConfigMain::OKClick)
EVT_BUTTON(ID_CANCEL, CConfigMain::OKClick)
EVT_BUTTON(ID_CLOSE, CConfigMain::CloseClick)
EVT_CHECKBOX(ID_ALLWAYS_HLEBIOS, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_USEDYNAREC, CConfigMain::CoreSettingsChanged)
EVT_CHECKBOX(ID_USEDUALCORE, CConfigMain::CoreSettingsChanged)
@@ -63,7 +61,7 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
: wxDialog(parent, id, title, position, size, style)
{
bRefreshList = false;
// Load Wii SYSCONF
pStream = NULL;
pStream = fopen("./WII/shared2/sys/SYSCONF", "rb");
@@ -86,6 +84,10 @@ CConfigMain::~CConfigMain()
void CConfigMain::CreateGUIControls()
{
// Why does this not work? some restriction is needed so that huge
// ISO paths dont cause the dialog to become gargantuan
SetMaxSize(wxSize(350, 350));
Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
GeneralPage = new wxPanel(Notebook, ID_GENERALPAGE, wxDefaultPosition, wxDefaultSize);
@@ -99,17 +101,12 @@ void CConfigMain::CreateGUIControls()
PluginPage = new wxPanel(Notebook, ID_PLUGINPAGE, wxDefaultPosition, wxDefaultSize);
Notebook->AddPage(PluginPage, wxT("Plugins"));
OK = new wxButton(this, ID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
Cancel = new wxButton(this, ID_CANCEL, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
Apply = new wxButton(this, ID_APPLY, wxT("Apply"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
Apply->Disable();
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
wxBoxSizer* sButtons;
sButtons = new wxBoxSizer(wxHORIZONTAL);
sButtons->Add(0, 0, 1, wxEXPAND, 5);
sButtons->Add(OK, 0, wxALL, 5);
sButtons->Add(Cancel, 0, wxALL, 5);
sButtons->Add(Apply, 0, wxALL, 5);
sButtons->Add(m_Close, 0, wxALL, 5);
wxBoxSizer* sMain;
sMain = new wxBoxSizer(wxVERTICAL);
@@ -125,7 +122,7 @@ void CConfigMain::CreateGUIControls()
UseDualCore->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bUseDualCore);
SkipIdle = new wxCheckBox(GeneralPage, ID_IDLESKIP, wxT("Enable Idle Skipping"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
SkipIdle->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bSkipIdle);
EnableCheats = new wxCheckBox(GeneralPage, ID_ENABLECHEATS, wxT("Enable cheats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
EnableCheats = new wxCheckBox(GeneralPage, ID_ENABLECHEATS, wxT("Enable Cheats"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
EnableCheats->SetValue(SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableCheats);
sbAdvanced = new wxStaticBoxSizer(wxVERTICAL, GeneralPage, wxT("Advanced Settings"));
@@ -300,46 +297,31 @@ void CConfigMain::CreateGUIControls()
sPlugins->Add(sbWiimotePlugin, 0, wxEXPAND|wxALL, 5);
PluginPage->SetSizer(sPlugins);
sPlugins->Layout();
SetIcon(wxNullIcon);
Fit();
Center();
}
void CConfigMain::OnClose(wxCloseEvent& WXUNUSED (event))
{
Destroy();
// Save Wii SYSCONF
pStream = NULL;
pStream = fopen("./WII/shared2/sys/SYSCONF", "wb");
if (pStream != NULL)
{
fwrite(m_SYSCONF, 1, 0x4000, pStream);
fclose(pStream);
}
else
{
PanicAlert("Could not write to Wii SYSCONF");
}
}
void CConfigMain::OKClick(wxCommandEvent& event)
void CConfigMain::CloseClick(wxCommandEvent& WXUNUSED (event))
{
switch (event.GetId())
{
case ID_OK:
DoApply();
Destroy();
// Save Wii SYSCONF
pStream = NULL;
pStream = fopen("./WII/shared2/sys/SYSCONF", "wb");
if (pStream != NULL)
{
fwrite(m_SYSCONF, 1, 0x4000, pStream);
fclose(pStream);
}
else
{
PanicAlert("Could not write to Wii SYSCONF");
}
break;
case ID_APPLY:
DoApply();
break;
case ID_CANCEL:
Destroy();
break;
}
Close();
}
void CConfigMain::CoreSettingsChanged(wxCommandEvent& event)
@@ -464,7 +446,10 @@ void CConfigMain::DVDRootChanged(wxFileDirPickerEvent& WXUNUSED (event))
void CConfigMain::OnSelectionChanged(wxCommandEvent& WXUNUSED (event))
{
Apply->Enable();
GetFilename(GraphicSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
GetFilename(DSPSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin);
GetFilename(PADSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin);
GetFilename(WiimoteSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin);
}
void CConfigMain::OnConfig(wxCommandEvent& event)
@@ -529,18 +514,6 @@ void CConfigMain::CallConfig(wxChoice* _pChoice)
}
}
void CConfigMain::DoApply()
{
Apply->Disable();
GetFilename(GraphicSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin);
GetFilename(DSPSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin);
GetFilename(PADSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin);
GetFilename(WiimoteSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin);
SConfig::GetInstance().SaveSettings();
}
bool CConfigMain::GetFilename(wxChoice* _pChoice, std::string& _rFilename)
{
_rFilename.clear();
+6 -15
View File
@@ -35,7 +35,7 @@ class CConfigMain
CConfigMain(wxWindow* parent, wxWindowID id = 1, const wxString& title = wxT("Dolphin Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = CONFIG_MAIN_STYLE);
virtual ~CConfigMain();
void OKClick(wxCommandEvent& event);
void CloseClick(wxCommandEvent& event);
void OnSelectionChanged(wxCommandEvent& event);
void OnConfig(wxCommandEvent& event);
@@ -73,9 +73,7 @@ class CConfigMain
wxPanel *PathsPage;
wxPanel *PluginPage;
wxButton* OK;
wxButton* Cancel;
wxButton* Apply;
wxButton* m_Close;
wxCheckBox* AllwaysHLEBIOS;
wxCheckBox* UseDynaRec;
@@ -190,9 +188,7 @@ class CConfigMain
ID_WIIPAGE,
ID_PATHSPAGE,
ID_PLUGINPAGE,
ID_CANCEL,
ID_APPLY,
ID_OK,
ID_CLOSE,
ID_ALLWAYS_HLEBIOS,
ID_USEDYNAREC,
ID_USEDUALCORE,
@@ -227,16 +223,14 @@ class CConfigMain
ID_PAD_ABOUT ,
ID_PAD_CONFIG,
ID_PAD_CB,
ID_DSP_ABOUT ,
ID_DSP_ABOUT,
ID_DSP_CONFIG,
ID_DSP_TEXT,
ID_DSP_CB,
ID_GRAPHIC_ABOUT ,
ID_GRAPHIC_ABOUT,
ID_GRAPHIC_CONFIG,
ID_GRAPHIC_TEXT,
ID_GRAPHIC_CB,
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
ID_GRAPHIC_CB
};
void CreateGUIControls();
@@ -252,9 +246,6 @@ class CConfigMain
void FillChoiceBox(wxChoice* _pChoice, int _PluginType, const std::string& _SelectFilename);
void CallConfig(wxChoice* _pChoice);
//void CallAbout(wxChoice* _pChoice);
void DoApply();
bool GetFilename(wxChoice* _pChoice, std::string& _rFilename);
};
+2 -12
View File
@@ -383,18 +383,8 @@ void CFrame::OnHelp(wxCommandEvent& event)
{
case IDM_HELPABOUT:
{
#ifdef _WIN32
wxWindow win;
win.SetHWND(this->GetHWND());
AboutDolphin frame(&win);
frame.ShowModal();
win.SetHWND(0);
#else
wxWindow win;
AboutDolphin frame(&win);
frame.ShowModal();
#endif
AboutDolphin frame(this);
frame.ShowModal();
break;
}
case IDM_HELPWEBSITE:
+1 -1
View File
@@ -572,7 +572,7 @@ void CGameListCtrl::OnDeleteGCM(wxCommandEvent& WXUNUSED (event))
const GameListItem *iso = GetSelectedISO();
if (!iso)
return;
if (wxMessageBox(_T("Are you sure you want to delete this file?"),
if (wxMessageBox(_T("Are you sure you want to delete this file?\nIt will be gone forever!"),
wxMessageBoxCaptionStr, wxYES_NO|wxICON_EXCLAMATION) == wxYES)
{
File::Delete(iso->GetFileName().c_str());
@@ -66,6 +66,7 @@ ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &titl
#endif
clickedButton = NULL;
CreateGUIControls();
Fit();
}
ConfigDialog::~ConfigDialog()
@@ -233,9 +234,6 @@ void ConfigDialog::CreateGUIControls()
m_Controller[i]->SetSizer(sPage[i]);
sPage[i]->Layout();
}
SetIcon(wxNullIcon);
Fit();
}
void ConfigDialog::OnClose(wxCloseEvent& event)
@@ -70,14 +70,12 @@ void Config::Load()
iniFile.Get("Settings", "WireFrame", &bWireFrame, 0);
iniFile.Get("Settings", "DisableLighting", &bDisableLighting, 0);
iniFile.Get("Settings", "DisableTexturing", &bDisableTexturing, 0);
iniFile.Get("Settings", "DisableCulling", &bDisableCulling, 0);
iniFile.Get("Enhancements", "ForceFiltering", &bForceFiltering, 0);
iniFile.Get("Enhancements", "ForceMaxAniso", &bForceMaxAniso, 0);
iniFile.Get("Enhancements", "StretchToFit", &bStretchToFit, false);
iniFile.Get("Enhancements", "KeepAR", &bKeepAR, false);
iniFile.Get("Hacks", "InvertDepth", &bInvertDepth, 0);
iniFile.Get("Hacks", "EFBToTextureDisable", &bEBFToTextureDisable, 0);
}
@@ -104,14 +102,12 @@ void Config::Save()
iniFile.Set("Settings", "Wireframe", bWireFrame);
iniFile.Set("Settings", "DisableLighting", bDisableLighting);
iniFile.Set("Settings", "DisableTexturing", bDisableTexturing);
iniFile.Set("Settings", "DisableCulling", bDisableCulling);
iniFile.Set("Enhancements", "ForceFiltering", bForceFiltering);
iniFile.Set("Enhancements", "ForceMaxAniso", bForceMaxAniso);
iniFile.Set("Enhancements", "StretchToFit", bStretchToFit);
iniFile.Set("Enhancements", "KeepAR", bKeepAR);
iniFile.Set("Hacks", "InvertDepth", bInvertDepth);
iniFile.Set("Hacks", "EFBToTextureDisable", bEBFToTextureDisable);
iniFile.Save("gfx_opengl.ini");
@@ -54,14 +54,12 @@ struct Config
bool bWireFrame;
bool bDisableLighting;
bool bDisableTexturing;
bool bDisableCulling;
// Utility
char texDumpPath[280];
bool bDumpTextures;
// Hacks
bool bInvertDepth;
bool bEBFToTextureDisable;
int iLog; // CONF_ bits
File diff suppressed because it is too large Load Diff
@@ -19,7 +19,6 @@
#define __CONFIGDIALOG_h__
#include <wx/wx.h>
#include <wx/aboutdlg.h>
#include <wx/dialog.h>
#include <wx/textctrl.h>
#include <wx/button.h>
@@ -38,140 +37,111 @@
class ConfigDialog : public wxDialog
{
private:
DECLARE_EVENT_TABLE();
public:
ConfigDialog(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("OpenGL Plugin Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ConfigDialog_STYLE);
virtual ~ConfigDialog();
void OKClick(wxCommandEvent& event);
// General
void FullScreenCheck(wxCommandEvent& event);
void RenderMainCheck(wxCommandEvent& event);
void AddFSReso(char *reso);
void AddWindowReso(char *reso);
void StretchToFitCheck(wxCommandEvent& event);
void KeepARCheck(wxCommandEvent& event);
void DllAbout(wxCommandEvent& event);
// Enhancements
void AddAAMode(int mode);
void FSCB(wxCommandEvent& event);
void WMCB(wxCommandEvent& event);
void AACB(wxCommandEvent& event);
void ForceFilteringCheck(wxCommandEvent& event);
void ForceAnisotropyCheck(wxCommandEvent& event);
// Information
void ShowFPSCheck(wxCommandEvent& event);
void OverlayCheck(wxCommandEvent& event);
void ShowShaderErrorsCheck(wxCommandEvent& event);
void TexFmtOverlayChange(wxCommandEvent& event);
// Render
void WireframeCheck(wxCommandEvent& event);
void UseXFBChange(wxCommandEvent& event);
void DisableLighting(wxCommandEvent& event);
void DisableTexturing(wxCommandEvent& event);
void DisableCulling(wxCommandEvent& event);
// Util
void DumpTexturesChange(wxCommandEvent& event);
void TexturePathChange(wxFileDirPickerEvent& event);
// Hacks
void InvertDepth(wxCommandEvent& event);
void EFBToTextureDisable(wxCommandEvent& event);
private:
DECLARE_EVENT_TABLE();
wxButton* m_About;
wxBoxSizer* sGeneral;
wxStaticBoxSizer* sbBasic;
wxGridBagSizer* sBasic;
wxStaticBoxSizer* sbEnhancements;
wxGridBagSizer* sEnhancements;
wxBoxSizer* sAdvanced;
wxStaticBoxSizer* sbInfo;
wxGridBagSizer* sInfo;
wxStaticBoxSizer* sbRendering;
wxGridBagSizer* sRendering;
wxStaticBoxSizer* sbUtilities;
wxGridBagSizer* sUtilities;
wxStaticBoxSizer* sbHacks;
wxGridBagSizer* sHacks;
wxButton *m_About;
wxButton *m_Cancel;
wxButton *m_OK;
wxDirPickerCtrl *m_TexturePath;
wxCheckBox *m_DumpTextures;
wxCheckBox *m_UseXFB;
wxCheckBox *m_TexFmtCenter;
wxCheckBox *m_TexFmtOverlay;
wxCheckBox *m_Statistics;
wxCheckBox *m_ShowFPS;
wxCheckBox *m_ShaderErrors;
wxCheckBox *m_Wireframe;
wxCheckBox *m_ForceAnisotropy;
wxNotebook *m_Notebook;
wxPanel *m_PageGeneral;
wxPanel *m_PageAdvanced;
wxCheckBox *m_Fullscreen;
wxCheckBox *m_RenderToMainWindow;
wxCheckBox *m_StretchToFit;
wxCheckBox *m_KeepAR;
wxCheckBox *m_ForceFiltering;
wxComboBox *m_AliasModeCB;
wxComboBox *m_WindowResolutionCB;
wxArrayString arrayStringFor_FullscreenCB;
wxComboBox *m_FullscreenCB;
wxCheckBox *m_RenderToMainWindow;
wxCheckBox *m_Fullscreen;
wxArrayString arrayStringFor_WindowResolutionCB;
wxComboBox *m_WindowResolutionCB;
wxCheckBox *m_ForceFiltering;
wxCheckBox *m_ForceAnisotropy;
wxComboBox *m_AliasModeCB;
wxCheckBox *m_ShowFPS;
wxCheckBox *m_ShaderErrors;
wxCheckBox *m_Statistics;
wxCheckBox *m_TexFmtOverlay;
wxCheckBox *m_TexFmtCenter;
wxCheckBox *m_UseXFB;
wxCheckBox *m_Wireframe;
wxCheckBox *m_DisableLighting;
wxCheckBox *m_DisableTexturing;
wxCheckBox *m_InvertDepth;
wxCheckBox *m_ProjectionHax1;
wxCheckBox *m_ProjectionHax2;
wxCheckBox *m_DumpTextures;
wxDirPickerCtrl *m_TexturePath;
wxCheckBox *m_EFBToTextureDisable;
wxCheckBox *m_DisableCulling;
wxPanel *m_PageGeneral;
wxPanel *m_PageEnhancements;
wxPanel *m_PageInformation;
wxPanel *m_PageRender;
wxPanel *m_PageUtility;
wxPanel *m_PageHacks;
wxNotebook *m_Notebook;
private:
enum
{
////GUI Enum Control ID Start
ID_CANCEL = 1000,
ID_OK,
ID_TEXTUREPATH,
ID_SHADERERRORS,
ID_USEXFB,
ID_TEXFMTCENTER,
ID_TEXFMTOVERLAY,
ID_SHOWFPS,
ID_STATISTICS,
ID_DUMPTEXTURES,
ID_WIREFRAME,
ID_FORCEANISOTROPY,
ID_OK = 1000,
ID_CANCEL,
ID_ABOUTOGL,
ID_NOTEBOOK,
ID_PAGEGENERAL,
ID_PAGEADVANCED,
ID_FULLSCREEN,
ID_RENDERTOMAINWINDOW,
ID_STRETCHTOFIT,
ID_KEEPAR,
ID_FORCEFILTERING,
ID_ALIASMODECB,
ID_AATEXT,
ID_WINDOWRESOLUTIONCB,
ID_WMTEXT,
ID_FULLSCREENCB,
ID_FSTEXT,
ID_RENDERTOMAINWINDOW,
ID_FULLSCREEN,
ID_NOTEBOOK,
ID_INVERTDEPTH,
ID_PROJECTIONHAX1,
ID_PROJECTIONHAX2,
ID_FULLSCREENCB,
ID_WMTEXT,
ID_WINDOWRESOLUTIONCB,
ID_FORCEFILTERING,
ID_FORCEANISOTROPY,
ID_AATEXT,
ID_ALIASMODECB,
ID_SHOWFPS,
ID_SHADERERRORS,
ID_STATISTICS,
ID_TEXFMTOVERLAY,
ID_TEXFMTCENTER,
ID_USEXFB,
ID_WIREFRAME,
ID_DISABLELIGHTING,
ID_DISABLETEXTURING,
ID_DUMPTEXTURES,
ID_TEXTUREPATH,
ID_EFBTOTEXTUREDISABLE,
ID_DISABLECULLING,
ID_PAGEGENERAL,
ID_PAGEENHANCEMENTS,
ID_PAGEINFORMATION,
ID_PAGERENDER,
ID_PAGEUTILITY,
ID_PAGEHACKS,
ID_GRAPHIC_ABOUT,
////GUI Enum Control ID End
ID_DUMMY_VALUE_ //don't remove this value unless you have other enum values
};
private:
void OnClose(wxCloseEvent& event);
void CreateGUIControls();
void AboutClick(wxCommandEvent& event);
void GeneralSettingsChanged(wxCommandEvent& event);
void AdvancedSettingsChanged(wxCommandEvent& event);
void TexturePathChange(wxFileDirPickerEvent& event);
};
#endif