From 0dfa9a586e9f9644ba7aa29f2827191f4b37a37d Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Wed, 11 Nov 2009 14:08:42 +0000 Subject: [PATCH] Implemented new pxCheckBox into the rest of the gui components. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2188 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/Panels/ConfigurationPanels.h | 22 ++--- pcsx2/gui/Panels/CpuPanel.cpp | 8 +- pcsx2/gui/Panels/DirPickerPanel.cpp | 5 +- pcsx2/gui/Panels/GameFixesPanel.cpp | 3 +- pcsx2/gui/Panels/SpeedhacksPanel.cpp | 117 ++++++++++++++----------- pcsx2/gui/Panels/VideoPanel.cpp | 33 +++---- pcsx2/gui/wxHelpers.cpp | 4 +- pcsx2/gui/wxHelpers.h | 3 +- 8 files changed, 110 insertions(+), 85 deletions(-) diff --git a/pcsx2/gui/Panels/ConfigurationPanels.h b/pcsx2/gui/Panels/ConfigurationPanels.h index befa2e8d89..2599c35fde 100644 --- a/pcsx2/gui/Panels/ConfigurationPanels.h +++ b/pcsx2/gui/Panels/ConfigurationPanels.h @@ -99,8 +99,8 @@ namespace Panels wxRadioButton* m_Option_None; wxRadioButton* m_Option_Normal; - wxCheckBox* m_Option_FTZ; - wxCheckBox* m_Option_DAZ; + pxCheckBox* m_Option_FTZ; + pxCheckBox* m_Option_DAZ; public: BaseAdvancedCpuOptions( wxWindow& parent, int idealWidth ); @@ -141,7 +141,7 @@ namespace Panels class FramelimiterPanel : public BaseApplicableConfigPanel { protected: - wxCheckBox* m_check_LimiterDisable; + pxCheckBox* m_check_LimiterDisable; wxSpinCtrl* m_spin_NominalPct; wxSpinCtrl* m_spin_SlomoPct; wxSpinCtrl* m_spin_TurboPct; @@ -165,7 +165,7 @@ namespace Panels class VideoPanel : public BaseApplicableConfigPanel { protected: - wxCheckBox* m_check_CloseGS; + pxCheckBox* m_check_CloseGS; //wxCheckBox* m_check_CloseGS; //wxCheckBox* m_; @@ -185,11 +185,11 @@ namespace Panels wxStaticText* m_msg_eecycle; wxStaticText* m_msg_vustealer; - wxCheckBox* m_check_intc; - wxCheckBox* m_check_b1fc0; - wxCheckBox* m_check_IOPx2; - wxCheckBox* m_check_vuFlagHack; - wxCheckBox* m_check_vuMinMax; + pxCheckBox* m_check_intc; + pxCheckBox* m_check_b1fc0; + pxCheckBox* m_check_IOPx2; + pxCheckBox* m_check_vuFlagHack; + pxCheckBox* m_check_vuMinMax; public: SpeedHacksPanel( wxWindow& parent, int idealWidth ); @@ -209,7 +209,7 @@ namespace Panels class GameFixesPanel: public BaseApplicableConfigPanel { protected: - wxCheckBox* m_checkbox[NUM_OF_GAME_FIXES]; + pxCheckBox* m_checkbox[NUM_OF_GAME_FIXES]; public: GameFixesPanel( wxWindow& parent, int idealWidth ); @@ -226,7 +226,7 @@ namespace Panels protected: FoldersEnum_t m_FolderId; wxDirPickerCtrl* m_pickerCtrl; - wxCheckBox* m_checkCtrl; + pxCheckBox* m_checkCtrl; public: DirPickerPanel( wxWindow* parent, FoldersEnum_t folderid, const wxString& label, const wxString& dialogLabel ); diff --git a/pcsx2/gui/Panels/CpuPanel.cpp b/pcsx2/gui/Panels/CpuPanel.cpp index 5a7e0b024e..73af3528a5 100644 --- a/pcsx2/gui/Panels/CpuPanel.cpp +++ b/pcsx2/gui/Panels/CpuPanel.cpp @@ -24,6 +24,10 @@ Panels::BaseAdvancedCpuOptions::BaseAdvancedCpuOptions( wxWindow& parent, int id , s_round( *new wxStaticBoxSizer( wxVERTICAL, this, _("Round Mode") ) ) , s_clamp( *new wxStaticBoxSizer( wxVERTICAL, this, _("Clamping Mode") ) ) { + + m_Option_FTZ = new pxCheckBox( this, _("Flush to Zero") ); + m_Option_DAZ = new pxCheckBox( this, _("Denormals are Zero") ); + wxFlexGridSizer& grid = *new wxFlexGridSizer( 4 ); // Clever proportions selected for a fairly nice spacing, with the third @@ -46,9 +50,9 @@ Panels::BaseAdvancedCpuOptions::BaseAdvancedCpuOptions( wxWindow& parent, int id wxBoxSizer& s_daz( *new wxBoxSizer( wxVERTICAL ) ); s_daz.AddSpacer( 12 ); - m_Option_FTZ = &AddCheckBox( s_daz, _("Flush to Zero") ); + s_daz.Add( m_Option_FTZ ); + s_daz.Add( m_Option_DAZ ); s_daz.AddSpacer( 4 ); - m_Option_DAZ = &AddCheckBox( s_daz, _("Denormals are Zero") ); s_daz.AddSpacer( 22 ); s_daz.Add( new wxButton( this, wxID_DEFAULT, _("Restore Defaults") ), wxSizerFlags().Align( wxALIGN_CENTRE ) ); diff --git a/pcsx2/gui/Panels/DirPickerPanel.cpp b/pcsx2/gui/Panels/DirPickerPanel.cpp index d27b6d34e5..7a44084eb1 100644 --- a/pcsx2/gui/Panels/DirPickerPanel.cpp +++ b/pcsx2/gui/Panels/DirPickerPanel.cpp @@ -67,6 +67,9 @@ Panels::DirPickerPanel::DirPickerPanel( wxWindow* parent, FoldersEnum_t folderid , m_pickerCtrl( NULL ) , m_checkCtrl( NULL ) { + m_checkCtrl = new pxCheckBox( this, _("Use default setting") ); + + wxStaticBoxSizer& s_box( *new wxStaticBoxSizer( wxVERTICAL, this, label ) ); wxFlexGridSizer& s_lower( *new wxFlexGridSizer( 2, 0, 4 ) ); @@ -90,8 +93,8 @@ Panels::DirPickerPanel::DirPickerPanel( wxWindow* parent, FoldersEnum_t folderid ); s_box.Add( m_pickerCtrl, wxSizerFlags().Border(wxLEFT | wxRIGHT | wxTOP, 5).Expand() ); + s_lower.Add( m_checkCtrl ); - m_checkCtrl = &AddCheckBox( s_lower, _("Use default setting") ); pxSetToolTip( m_checkCtrl, pxE( ".Tooltip:DirPicker:UseDefault", L"When checked this folder will automatically reflect the default associated with PCSX2's current usermode setting. " ) ); diff --git a/pcsx2/gui/Panels/GameFixesPanel.cpp b/pcsx2/gui/Panels/GameFixesPanel.cpp index f831c9b0c6..87db9c4fde 100644 --- a/pcsx2/gui/Panels/GameFixesPanel.cpp +++ b/pcsx2/gui/Panels/GameFixesPanel.cpp @@ -73,7 +73,8 @@ Panels::GameFixesPanel::GameFixesPanel( wxWindow& parent, int idealWidth ) : const Pcsx2Config::GamefixOptions& opts( g_Conf->EmuOptions.Gamefixes ); for( int i=0; iSetToolTip( check_text[i].tooltip ); m_checkbox[i]->SetValue( !!(opts.bitset & (1 << i)) ); } diff --git a/pcsx2/gui/Panels/SpeedhacksPanel.cpp b/pcsx2/gui/Panels/SpeedhacksPanel.cpp index 5f71958b08..064fd22359 100644 --- a/pcsx2/gui/Panels/SpeedhacksPanel.cpp +++ b/pcsx2/gui/Panels/SpeedhacksPanel.cpp @@ -91,6 +91,67 @@ Panels::SpeedHacksPanel::SpeedHacksPanel( wxWindow& parent, int idealWidth ) : { const Pcsx2Config::SpeedhackOptions& opts( g_Conf->EmuOptions.Speedhacks ); + // ------------------------------------------------------------------------ + // microVU Hacks Section: + // ------------------------------------------------------------------------ + + m_check_vuFlagHack = new pxCheckBox( this, _("mVU Flag Hack"), + _("Large Speedup and High Compatibility; may cause garbage graphics, SPS, etc...") ); + + m_check_vuFlagHack->SetToolTip( pxE( ".Tooltips:Speedhacks:vuFlagHack", + L"Updates Status Flags only on blocks which will read them, instead of all the time. " + L"This is safe most of the time, and Super VU does something similar by default." + ) ); + + m_check_vuMinMax = new pxCheckBox( this, _("mVU Min/Max Hack"), + _("Small Speedup; may cause black screens, garbage graphics, SPS, etc...") ); + + m_check_vuMinMax->SetToolTip( pxE( ".Tooltips:Speedhacks:vuMinMax", + L"Uses SSE's Min/Max Floating Point Operations instead of custom logical Min/Max routines. " + L"Known to break Gran Tourismo 4, Tekken 5." + ) ); + + + m_check_vuFlagHack->SetValue(opts.vuFlagHack); + m_check_vuMinMax->SetValue(opts.vuMinMax); + + // ------------------------------------------------------------------------ + // All other hacks Section: + // ------------------------------------------------------------------------ + + m_check_intc = new pxCheckBox( this, _("Enable INTC Spin Detection"), + _("Huge speedup for some games, with almost no compatibility side effects. [Recommended]") ); + + m_check_intc->SetToolTip( pxE( ".Tooltips:Speedhacks:INTC", + L"This hack works best for games that use the INTC Status register to wait for vsyncs, which includes primarily non-3D " + L"RPG titles. Games that do not use this method of vsync will see little or no speeup from this hack." + ) ); + + m_check_b1fc0 = new pxCheckBox( this, _("Enable BIFC0 Spin Detection"), + _("Moderate speedup for some games, with no known side effects. [Recommended]" ) ); + + m_check_b1fc0->SetToolTip( pxE( ".Tooltips:Speedhacks:BIFC0", + L"This hack works especially well for Final Fantasy X and Kingdom Hearts. BIFC0 is the address of a specific block of " + L"code in the EE kernel that's run repeatedly when the EE is waiting for the IOP to complete a task. This hack detects " + L"that and responds by fast-forwarding the EE until the IOP signals that the task is complete." + ) ); + + m_check_IOPx2 = new pxCheckBox( this, _("IOP x2 cycle rate hack"), + _("Small Speedup and works well with most games; may cause some games to hang during startup.") ); + + m_check_IOPx2->SetToolTip( pxE( ".Tooltips:Speedhacks:IOPx2", + L"Halves the cycle rate of the IOP, giving it an effective emulated speed of roughly 18 MHz. " + L"The speedup is very minor, so this hack is generally not recommended." + ) ); + + m_check_intc->SetValue(opts.IntcStat); + m_check_b1fc0->SetValue(opts.BIFC0); + m_check_IOPx2->SetValue(opts.IopCycleRate_X2); + + // ---------------------------------------------------------------------------- + // Layout Section (Sizers Bindings) + // ---------------------------------------------------------------------------- + wxBoxSizer& mainSizer = *new wxBoxSizer( wxVERTICAL ); wxFlexGridSizer& cycleHacksSizer = *new wxFlexGridSizer( 2 ); @@ -154,59 +215,13 @@ Panels::SpeedHacksPanel::SpeedHacksPanel( wxWindow& parent, int idealWidth ) : pxSetToolTip( m_slider_vustealer, tooltip ); pxSetToolTip( m_msg_vustealer, tooltip ); - // ------------------------------------------------------------------------ - // microVU Hacks Section: - // ------------------------------------------------------------------------ - m_check_vuFlagHack = &AddCheckBox(microVUSizer, _("mVU Flag Hack"), - _("Large Speedup and High Compatibility; may cause garbage graphics, SPS, etc..."), - pxE( ".Tooltips:Speedhacks:vuFlagHack", - L"Updates Status Flags only on blocks which will read them, instead of all the time. " - L"This is safe most of the time, and Super VU does something similar by default." - ) ); + microVUSizer.Add( m_check_vuFlagHack ); + microVUSizer.Add( m_check_vuMinMax ); - m_check_vuFlagHack->SetValue(opts.vuFlagHack); - - m_check_vuMinMax = &AddCheckBox(microVUSizer, _("mVU Min/Max Hack"), - _("Small Speedup; may cause black screens, garbage graphics, SPS, etc..."), - pxE( ".Tooltips:Speedhacks:vuMinMax", - L"Uses SSE's Min/Max Floating Point Operations instead of custom logical Min/Max routines. " - L"Known to break Gran Tourismo 4, Tekken 5." - ) ); - - m_check_vuMinMax->SetValue(opts.vuMinMax); - - // ------------------------------------------------------------------------ - // All other hacks Section: - // ------------------------------------------------------------------------ - - m_check_intc = &AddCheckBox(miscSizer, _("Enable INTC Spin Detection"), - _("Huge speedup for some games, with almost no compatibility side effects. [Recommended]"), - pxE( ".Tooltips:Speedhacks:INTC", - L"This hack works best for games that use the INTC Status register to wait for vsyncs, which includes primarily non-3D " - L"RPG titles. Games that do not use this method of vsync will see little or no speeup from this hack." - ) ); - - m_check_intc->SetValue(opts.IntcStat); - - m_check_b1fc0 = &AddCheckBox(miscSizer, _("Enable BIFC0 Spin Detection"), - _("Moderate speedup for some games, with no known side effects. [Recommended]" ), - pxE( ".Tooltips:Speedhacks:BIFC0", - L"This hack works especially well for Final Fantasy X and Kingdom Hearts. BIFC0 is the address of a specific block of " - L"code in the EE kernel that's run repeatedly when the EE is waiting for the IOP to complete a task. This hack detects " - L"that and responds by fast-forwarding the EE until the IOP signals that the task is complete." - ) ); - - m_check_b1fc0->SetValue(opts.BIFC0); - - m_check_IOPx2 = &AddCheckBox(miscSizer, _("IOP x2 cycle rate hack"), - _("Small Speedup and works well with most games; may cause some games to hang during startup."), - pxE( ".Tooltips:Speedhacks:IOPx2", - L"Halves the cycle rate of the IOP, giving it an effective emulated speed of roughly 18 MHz. " - L"The speedup is very minor, so this hack is generally not recommended." - ) ); - - m_check_IOPx2->SetValue(opts.IopCycleRate_X2); + miscSizer.Add( m_check_intc ); + miscSizer.Add( m_check_b1fc0 ); + miscSizer.Add( m_check_IOPx2 ); cycleHacksSizer.Add( &cyclerateSizer, SizerFlags::TopLevelBox() ); cycleHacksSizer.Add( &stealerSizer, SizerFlags::TopLevelBox() ); diff --git a/pcsx2/gui/Panels/VideoPanel.cpp b/pcsx2/gui/Panels/VideoPanel.cpp index 8b143c72f6..c3fd47d445 100644 --- a/pcsx2/gui/Panels/VideoPanel.cpp +++ b/pcsx2/gui/Panels/VideoPanel.cpp @@ -25,18 +25,20 @@ Panels::FramelimiterPanel::FramelimiterPanel( wxWindow& parent, int idealWidth ) { wxBoxSizer& mainSizer = *new wxBoxSizer( wxVERTICAL ); + m_check_LimiterDisable = new pxCheckBox( this, _("Disable Framelimiting"), + _("Useful for running benchmarks. Toggle this option in-game by pressing F4.") ); + + m_check_LimiterDisable->SetToolTip( pxE( ".Tooltip:Framelimiter:Disable", + L"Note that when Framelimiting is disabled, Turbo and SlowMotion modes will not " + L"be available either." + ) ); + AddStaticText( mainSizer, pxE( ".Framelimiter:Heading", L"The internal framelimiter regulates the speed of the virtual machine. Adjustment values below are in " L"percentages of the default region-based framerate, which can also be configured below." ) ); - m_check_LimiterDisable = &AddCheckBox( mainSizer, _("Disable Framelimiting"), - _("Useful for running benchmarks. Toggle this option in-game by pressing F4."), - pxE( ".Tooltip:Framelimiter:Disable", - L"Note that when Framelimiting is disabled, Turbo and SlowMotion modes will not " - L"be available either." - ) - ); + mainSizer.Add( m_check_LimiterDisable ); m_spin_NominalPct = new wxSpinCtrl( this ); m_spin_SlomoPct = new wxSpinCtrl( this ); @@ -107,15 +109,12 @@ void Panels::FramelimiterPanel::Apply() Panels::VideoPanel::VideoPanel( wxWindow& parent, int idealWidth ) : BaseApplicableConfigPanel( &parent, idealWidth ) { - wxBoxSizer& mainSizer = *new wxBoxSizer( wxVERTICAL ); - - m_check_CloseGS = &AddCheckBox( mainSizer, _("Hide GS window on Suspend"), - wxEmptyString, // subtext - pxE( ".Tooltip:Video:HideGS", - L"Completely closes the often large and bulky GS window when pressing " - L"ESC or suspending the emulator. That way it won't get *in* the way!" - ) - ); + m_check_CloseGS = new pxCheckBox( this, _("Hide GS window on Suspend") ); + + m_check_CloseGS->SetToolTip( pxE( ".Tooltip:Video:HideGS", + L"Completely closes the often large and bulky GS window when pressing " + L"ESC or suspending the emulator. That way it won't get *in* the way!" + ) ); /*&AddCheckBox( mainSizer, _(""), wxEmptyString, // subtext @@ -127,10 +126,12 @@ Panels::VideoPanel::VideoPanel( wxWindow& parent, int idealWidth ) : m_check_CloseGS->SetValue( g_Conf->CloseGSonEsc ); + wxBoxSizer& mainSizer = *new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer& limitSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("Framelimiter") ); limitSizer.Add( new FramelimiterPanel( *this, idealWidth - 32 ) ); + mainSizer.Add( m_check_CloseGS ); mainSizer.Add( &limitSizer ); SetSizer( &mainSizer ); diff --git a/pcsx2/gui/wxHelpers.cpp b/pcsx2/gui/wxHelpers.cpp index fb0e90a38d..96c4cf781b 100644 --- a/pcsx2/gui/wxHelpers.cpp +++ b/pcsx2/gui/wxHelpers.cpp @@ -335,10 +335,10 @@ wxPanelWithHelpers::wxPanelWithHelpers( wxWindow* parent, const wxPoint& pos, co // // Static subtext, if specified, is displayed below the checkbox and is indented accordingly. // -wxCheckBox& wxPanelWithHelpers::AddCheckBox( wxSizer& sizer, const wxString& label, const wxString& subtext, const wxString& tooltip ) +/*wxCheckBox& wxPanelWithHelpers::AddCheckBox( wxSizer& sizer, const wxString& label, const wxString& subtext, const wxString& tooltip ) { return wxHelpers::AddCheckBoxTo( this, sizer, label, subtext, tooltip, GetIdealWidth()-8 ); -} +}*/ // ------------------------------------------------------------------------ // Creates a static text box that generally "makes sense" in a free-flowing layout. Specifically, this diff --git a/pcsx2/gui/wxHelpers.h b/pcsx2/gui/wxHelpers.h index 43872ad4fc..3fb94b4798 100644 --- a/pcsx2/gui/wxHelpers.h +++ b/pcsx2/gui/wxHelpers.h @@ -80,7 +80,7 @@ public: //wxRadioButton& NewSpinCtrl( const wxString& label, const wxString& subtext=wxEmptyString, const wxString& tooltip=wxEmptyString ); - wxCheckBox& AddCheckBox( wxSizer& sizer, const wxString& label, const wxString& subtext=wxEmptyString, const wxString& tooltip=wxEmptyString ); + //wxCheckBox& AddCheckBox( wxSizer& sizer, const wxString& label, const wxString& subtext=wxEmptyString, const wxString& tooltip=wxEmptyString ); wxRadioButton& AddRadioButton( wxSizer& sizer, const wxString& label, const wxString& subtext=wxEmptyString, const wxString& tooltip=wxEmptyString ); wxStaticText& AddStaticText(wxSizer& sizer, const wxString& label, int alignFlags=wxALIGN_CENTRE, int size=wxDefaultCoord ); @@ -114,6 +114,7 @@ public: pxCheckBox& SetToolTip( const wxString& tip ); pxCheckBox& SetValue( bool val ); bool GetValue() const; + bool IsChecked() const { pxAssert( m_checkbox != NULL ); return m_checkbox->IsChecked(); } operator wxCheckBox&() { pxAssert( m_checkbox != NULL ); return *m_checkbox; } operator const wxCheckBox&() const { pxAssert( m_checkbox != NULL ); return *m_checkbox; }