From 3457347716ea1f9426afc0aca7392cfabe78588f Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Sat, 15 Aug 2009 16:17:59 +0000 Subject: [PATCH] wxgui: Begin work on some missing panels for the pcsx2 config dialog. git-svn-id: http://pcsx2.googlecode.com/svn/branches/wxgui@1628 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/App.h | 4 +- pcsx2/gui/Dialogs/ConfigurationDialog.cpp | 11 ++++- pcsx2/gui/Panels/ConfigurationPanels.h | 27 ++++++++++++- pcsx2/gui/Panels/CpuPanel.cpp | 49 ++++++++++++++++++++++- pcsx2/gui/Panels/PluginSelectorPanel.cpp | 34 +++++++++------- pcsx2/gui/Panels/VideoPanel.cpp | 16 +++++++- pcsx2/gui/main.cpp | 1 + 7 files changed, 120 insertions(+), 22 deletions(-) diff --git a/pcsx2/gui/App.h b/pcsx2/gui/App.h index 04ded9a56b..9f51995e15 100644 --- a/pcsx2/gui/App.h +++ b/pcsx2/gui/App.h @@ -161,7 +161,8 @@ struct AppImageIds Plugins, Speedhacks, Gamefixes, - Video; + Video, + Cpu; ConfigIds() : Paths( -1 ) @@ -169,6 +170,7 @@ struct AppImageIds , Speedhacks( -1 ) , Gamefixes( -1 ) , Video( -1 ) + , Cpu( -1 ) { } } Config; diff --git a/pcsx2/gui/Dialogs/ConfigurationDialog.cpp b/pcsx2/gui/Dialogs/ConfigurationDialog.cpp index 08a6107dbc..610d9b2327 100644 --- a/pcsx2/gui/Dialogs/ConfigurationDialog.cpp +++ b/pcsx2/gui/Dialogs/ConfigurationDialog.cpp @@ -52,10 +52,10 @@ Dialogs::ConfigurationDialog::ConfigurationDialog( wxWindow* parent, int id ) : g_ApplyState.StartBook( &m_listbook ); g_ApplyState.SetCurrentPage( m_listbook.GetPageCount() ); - m_listbook.AddPage( new PathsPanel( m_listbook, IdealWidth ), _("Folders"), false, cfgid.Paths ); + m_listbook.AddPage( new CpuPanel( m_listbook, IdealWidth ), _("CPU"), false, cfgid.Cpu ); g_ApplyState.SetCurrentPage( m_listbook.GetPageCount() ); - m_listbook.AddPage( new PluginSelectorPanel( m_listbook, IdealWidth ), _("Plugins"), false, cfgid.Plugins ); + m_listbook.AddPage( new VideoPanel( m_listbook, IdealWidth ), _("GS/Video"), false, cfgid.Video ); g_ApplyState.SetCurrentPage( m_listbook.GetPageCount() ); m_listbook.AddPage( new SpeedHacksPanel( m_listbook, IdealWidth ), _("Speedhacks"), false, cfgid.Speedhacks ); @@ -63,6 +63,13 @@ Dialogs::ConfigurationDialog::ConfigurationDialog( wxWindow* parent, int id ) : g_ApplyState.SetCurrentPage( m_listbook.GetPageCount() ); m_listbook.AddPage( new GameFixesPanel( m_listbook, IdealWidth ), _("Game Fixes"), false, cfgid.Gamefixes ); + g_ApplyState.SetCurrentPage( m_listbook.GetPageCount() ); + m_listbook.AddPage( new PluginSelectorPanel( m_listbook, IdealWidth ), _("Plugins"), false, cfgid.Plugins ); + + g_ApplyState.SetCurrentPage( m_listbook.GetPageCount() ); + m_listbook.AddPage( new PathsPanel( m_listbook, IdealWidth ), _("Folders"), false, cfgid.Paths ); + + mainSizer.Add( &m_listbook ); AddOkCancel( mainSizer, true ); diff --git a/pcsx2/gui/Panels/ConfigurationPanels.h b/pcsx2/gui/Panels/ConfigurationPanels.h index debb6cdc9a..6962625bbb 100644 --- a/pcsx2/gui/Panels/ConfigurationPanels.h +++ b/pcsx2/gui/Panels/ConfigurationPanels.h @@ -192,7 +192,29 @@ namespace Panels void Apply( AppConfig& conf ); }; + + ////////////////////////////////////////////////////////////////////////////////////////// + // + class CpuPanel : public BaseApplicableConfigPanel + { + protected: + + public: + CpuPanel( wxWindow& parent, int idealWidth ); + void Apply( AppConfig& conf ); + }; + ////////////////////////////////////////////////////////////////////////////////////////// + // + class VideoPanel : public BaseApplicableConfigPanel + { + protected: + + public: + VideoPanel( wxWindow& parent, int idealWidth ); + void Apply( AppConfig& conf ); + }; + ////////////////////////////////////////////////////////////////////////////////////////// // class SpeedHacksPanel : public BaseApplicableConfigPanel @@ -328,7 +350,8 @@ namespace Panels class ComboBoxPanel : public wxPanelWithHelpers { protected: - wxComboBox* m_combobox[NumPluginTypes]; + wxComboBox* m_combobox[NumPluginTypes]; + wxComboBox& m_BiosBox; public: ComboBoxPanel( PluginSelectorPanel* parent ); @@ -356,7 +379,7 @@ namespace Panels protected: wxArrayString m_FileList; // list of potential plugin files StatusPanel& m_StatusPanel; - ComboBoxPanel& m_ComboBoxes; + ComboBoxPanel& m_ComponentBoxes; bool m_Uninitialized; EnumThread* m_EnumeratorThread; diff --git a/pcsx2/gui/Panels/CpuPanel.cpp b/pcsx2/gui/Panels/CpuPanel.cpp index 8f88550d75..dc9a00e2f4 100644 --- a/pcsx2/gui/Panels/CpuPanel.cpp +++ b/pcsx2/gui/Panels/CpuPanel.cpp @@ -16,4 +16,51 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "PrecompiledHeader.h" \ No newline at end of file +#include "PrecompiledHeader.h" +#include "ConfigurationPanels.h" + +using namespace wxHelpers; + +Panels::CpuPanel::CpuPanel( wxWindow& parent, int idealWidth ) : + BaseApplicableConfigPanel( &parent, idealWidth ) +{ + wxFlexGridSizer& s_main = *new wxFlexGridSizer( 2 ); + + s_main.AddGrowableCol( 0, 1 ); + s_main.AddGrowableCol( 1, 1 ); + + // i18n: No point in translating PS2 CPU names :) + wxStaticBoxSizer& s_ee = *new wxStaticBoxSizer( wxVERTICAL, this, L"EmotionEngine" ); + wxStaticBoxSizer& s_iop = *new wxStaticBoxSizer( wxVERTICAL, this, L"IOP" ); + wxStaticBoxSizer& s_vu0 = *new wxStaticBoxSizer( wxVERTICAL, this, L"VU0" ); + wxStaticBoxSizer& s_vu1 = *new wxStaticBoxSizer( wxVERTICAL, this, L"VU1" ); + + m_StartNewRadioGroup = true; + AddRadioButton( s_ee, _("Interpreter"), wxEmptyString, _("Quite possibly the slowest thing in the universe.") ); + AddRadioButton( s_ee, _("Recompiler") ); + + m_StartNewRadioGroup = true; + AddRadioButton( s_iop, _("Interpreter") ); + AddRadioButton( s_iop, _("Recompiler") ); + + m_StartNewRadioGroup = true; + AddRadioButton( s_vu0, _("Interpreter") ); + AddRadioButton( s_vu0, _("microVU Recompiler [new!]") ); + AddRadioButton( s_vu0, _("superVU Recompiler [legacy]"), wxEmptyString, _("Useful for diagnosing possible bugs in the new mVU recompiler.") ); + + m_StartNewRadioGroup = true; + AddRadioButton( s_vu1, _("Interpreter") ); + AddRadioButton( s_vu1, _("microVU Recompiler [new!]") ); + AddRadioButton( s_vu1, _("superVU Recompiler [legacy]"), wxEmptyString, _("Useful for diagnosing possible bugs in the new mVU recompiler.") ); + + s_main.Add( &s_ee, SizerFlags::StdExpand() ); + s_main.Add( &s_iop, SizerFlags::StdExpand() ); + s_main.Add( &s_vu0, SizerFlags::StdExpand() ); + s_main.Add( &s_vu1, SizerFlags::StdExpand() ); + + SetSizerAndFit( &s_main ); +} + +void Panels::CpuPanel::Apply( AppConfig& conf ) +{ +} diff --git a/pcsx2/gui/Panels/PluginSelectorPanel.cpp b/pcsx2/gui/Panels/PluginSelectorPanel.cpp index 8580e45d3d..53d2f7bf02 100644 --- a/pcsx2/gui/Panels/PluginSelectorPanel.cpp +++ b/pcsx2/gui/Panels/PluginSelectorPanel.cpp @@ -146,6 +146,7 @@ void Panels::PluginSelectorPanel::StatusPanel::Reset() // ------------------------------------------------------------------------ Panels::PluginSelectorPanel::ComboBoxPanel::ComboBoxPanel( PluginSelectorPanel* parent ) : wxPanelWithHelpers( parent ) +, m_BiosBox( *new wxComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY ) ) { wxFlexGridSizer& s_plugin = *new wxFlexGridSizer( NumPluginTypes, 3, 16, 10 ); s_plugin.SetFlexibleDirection( wxHORIZONTAL ); @@ -164,6 +165,9 @@ Panels::PluginSelectorPanel::ComboBoxPanel::ComboBoxPanel( PluginSelectorPanel* s_plugin.Add( new wxButton( this, wxID_ANY, L"Configure..." ) ); } + s_plugin.Add( new wxStaticText( this, wxID_ANY, L"BIOS" ), wxSizerFlags().Border( wxTOP | wxLEFT, 2 ) ); + s_plugin.Add( &m_BiosBox, wxSizerFlags().Expand() ); + SetSizerAndFit( &s_plugin ); } @@ -180,16 +184,16 @@ Panels::PluginSelectorPanel::PluginSelectorPanel( wxWindow& parent, int idealWid , m_StatusPanel( *new StatusPanel( this, wxDir::GetAllFiles( g_Conf->Folders.Plugins.ToString(), &m_FileList, wxsFormat( L"*%s", wxDynamicLibrary::GetDllExt()), wxDIR_FILES ) ) ) -, m_ComboBoxes( *new ComboBoxPanel( this ) ) +, m_ComponentBoxes( *new ComboBoxPanel( this ) ) , m_Uninitialized( true ) , m_EnumeratorThread( NULL ) { wxBoxSizer& s_main = *new wxBoxSizer( wxVERTICAL ); + + s_main.Add( &m_ComponentBoxes, SizerFlags::StdExpand().ReserveSpaceEvenIfHidden() ); - s_main.Add( &m_ComboBoxes, SizerFlags::StdExpand().ReserveSpaceEvenIfHidden() ); - - s_main.AddSpacer( 4 ); - AddStaticText( s_main, _("Tip: Installed plugins that are not compatible with your hardware or operating system will be listed below a separator.") ); + //s_main.AddSpacer( 4 ); + //AddStaticText( s_main, _("Tip: Installed plugins that are not compatible with your hardware or operating system will be listed below a separator.") ); s_main.AddSpacer( 4 ); s_main.Add( &m_StatusPanel, SizerFlags::StdExpand().ReserveSpaceEvenIfHidden() ); @@ -221,10 +225,10 @@ void Panels::PluginSelectorPanel::Apply( AppConfig& conf ) { for( int i=0; iFolders.Plugins.ToString() ); conf.BaseFilenames.Plugins[tbl_PluginInfo[i].id] = relative.GetFullPath(); } @@ -236,7 +240,7 @@ void Panels::PluginSelectorPanel::DoRefresh() // Disable all controls until enumeration is complete. - m_ComboBoxes.Hide(); + m_ComponentBoxes.Hide(); m_StatusPanel.Show(); // Use a thread to load plugins. @@ -258,7 +262,7 @@ void Panels::PluginSelectorPanel::OnShow( wxShowEvent& evt ) void Panels::PluginSelectorPanel::OnRefresh( wxCommandEvent& evt ) { - m_ComboBoxes.Reset(); + m_ComponentBoxes.Reset(); DoRefresh(); } @@ -272,11 +276,11 @@ void Panels::PluginSelectorPanel::OnEnumComplete( wxCommandEvent& evt ) int emptyBoxes = 0; for( int i=0; i 0 ) @@ -288,7 +292,7 @@ void Panels::PluginSelectorPanel::OnEnumComplete( wxCommandEvent& evt ) ); } - m_ComboBoxes.Show(); + m_ComponentBoxes.Show(); m_StatusPanel.Hide(); m_StatusPanel.Reset(); } @@ -314,7 +318,7 @@ void Panels::PluginSelectorPanel::OnProgress( wxCommandEvent& evt ) { if( result.PassedTest & tbl_PluginInfo[i].typemask ) { - int sel = m_ComboBoxes.Get(i).Append( wxsFormat( L"%s %s [%s]", + int sel = m_ComponentBoxes.Get(i).Append( wxsFormat( L"%s %s [%s]", result.Name.c_str(), result.Version[i].c_str(), Path::GetFilenameWithoutExt( m_FileList[evtidx] ).c_str() ), (void*)evtidx ); @@ -326,7 +330,7 @@ void Panels::PluginSelectorPanel::OnProgress( wxCommandEvent& evt ) right.MakeRelativeTo( g_Conf->Folders.Plugins.ToString() ); if( left == right ) - m_ComboBoxes.Get(i).SetSelection( sel ); + m_ComponentBoxes.Get(i).SetSelection( sel ); } } } diff --git a/pcsx2/gui/Panels/VideoPanel.cpp b/pcsx2/gui/Panels/VideoPanel.cpp index 8f88550d75..66048bfc95 100644 --- a/pcsx2/gui/Panels/VideoPanel.cpp +++ b/pcsx2/gui/Panels/VideoPanel.cpp @@ -16,4 +16,18 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "PrecompiledHeader.h" \ No newline at end of file +#include "PrecompiledHeader.h" +#include "ConfigurationPanels.h" + +Panels::VideoPanel::VideoPanel( wxWindow& parent, int idealWidth ) : + BaseApplicableConfigPanel( &parent, idealWidth ) +{ + // TODO: + // Framelimiting / Frameskipping / Vsync + // GS Window Options ( incl. Fullscreen ) + // MTGS Forced Synchronization +} + +void Panels::VideoPanel::Apply( AppConfig& conf ) +{ +} diff --git a/pcsx2/gui/main.cpp b/pcsx2/gui/main.cpp index 598cc27aad..2c863466c2 100644 --- a/pcsx2/gui/main.cpp +++ b/pcsx2/gui/main.cpp @@ -370,6 +370,7 @@ wxImageList& Pcsx2App::GetImgList_Config() FancyLoadMacro( Gamefixes ); FancyLoadMacro( Speedhacks ); FancyLoadMacro( Video ); + FancyLoadMacro( Cpu ); } m_ConfigImagesAreLoaded = true; return m_ConfigImages;