diff --git a/common/include/Utilities/wxGuiTools.h b/common/include/Utilities/wxGuiTools.h index fb37627eee..0a125c692f 100644 --- a/common/include/Utilities/wxGuiTools.h +++ b/common/include/Utilities/wxGuiTools.h @@ -292,7 +292,8 @@ namespace pxSizerFlags }; BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE( pxEvt_OnThreadCleanup, -1 ); + // Added to the event queue by pxDialogWithHelpers + DECLARE_EVENT_TYPE( pxEvt_OnDialogCreated, -1 ) END_DECLARE_EVENT_TYPES() // -------------------------------------------------------------------------------------- @@ -321,6 +322,12 @@ public: virtual int ShowModal(); virtual bool Show( bool show=true ); + // Must return the same thing as GetNameStatic; a name ideal for use in uniquely + // identifying dialogs. (this version is the 'instance' version, which is called + // by BaseConfigurationDialog to assign the wxWidgets dialog name, and for saving + // screenshots to disk) + virtual wxString GetDialogName() const; + virtual pxStaticText* Text( const wxString& label ); virtual pxStaticHeading* Heading( const wxString& label ); @@ -330,7 +337,7 @@ public: bool HasIdealWidth() const { return m_idealWidth != wxDefaultCoord; } protected: - void OnActivate(wxActivateEvent& evt); + void OnDialogCreated( wxCommandEvent& evt ); void OnOkCancel(wxCommandEvent& evt); void OnCloseWindow(wxCloseEvent& event); }; diff --git a/common/src/Utilities/wxHelpers.cpp b/common/src/Utilities/wxHelpers.cpp index 340e87169e..b45b8cf0b9 100644 --- a/common/src/Utilities/wxHelpers.cpp +++ b/common/src/Utilities/wxHelpers.cpp @@ -25,8 +25,6 @@ using namespace pxSizerFlags; -DEFINE_EVENT_TYPE( pxEvt_OnThreadCleanup ); - // -------------------------------------------------------------------------------------- // BaseDeletableObject Implementation // -------------------------------------------------------------------------------------- @@ -103,6 +101,8 @@ bool pxDialogExists( const wxString& name ) // wxDialogWithHelpers Class Implementations // ===================================================================================================== +DEFINE_EVENT_TYPE( pxEvt_OnDialogCreated ) + IMPLEMENT_DYNAMIC_CLASS(wxDialogWithHelpers, wxDialog) wxDialogWithHelpers::wxDialogWithHelpers() @@ -150,11 +150,27 @@ void wxDialogWithHelpers::Init() // an updated version will fix it later. I tried to fix it using a manual Connect but it // didn't do any good. (problem could also be my Co-Linux / x-window manager) - //Connect( wxEVT_ACTIVATE, wxActivateEventHandler(wxDialogWithHelpers::OnActivate) ); + Connect( pxEvt_OnDialogCreated, wxCommandEventHandler (wxDialogWithHelpers::OnDialogCreated) ); Connect( wxID_OK, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (wxDialogWithHelpers::OnOkCancel) ); Connect( wxID_CANCEL, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (wxDialogWithHelpers::OnOkCancel) ); Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler (wxDialogWithHelpers::OnCloseWindow) ); + + wxCommandEvent createEvent( pxEvt_OnDialogCreated ); + createEvent.SetId( GetId() ); + AddPendingEvent( createEvent ); +} + +void wxDialogWithHelpers::OnDialogCreated( wxCommandEvent& evt ) +{ + evt.Skip(); + if( (evt.GetId() == GetId()) && !GetDialogName().IsEmpty() ) + SetName( L"Dialog:" + GetDialogName() ); +} + +wxString wxDialogWithHelpers::GetDialogName() const +{ + return wxEmptyString; } void wxDialogWithHelpers::SmartCenterFit() @@ -221,12 +237,6 @@ void wxDialogWithHelpers::OnOkCancel( wxCommandEvent& evt ) evt.Skip(); } - -void wxDialogWithHelpers::OnActivate(wxActivateEvent& evt) -{ - //evt.Skip(); -} - void wxDialogWithHelpers::AddOkCancel( wxSizer &sizer, bool hasApply ) { wxStdDialogButtonSizer& s_buttons( *new wxStdDialogButtonSizer() ); diff --git a/pcsx2/gui/ApplyState.h b/pcsx2/gui/ApplyState.h index 457aa42d24..0dad2d1218 100644 --- a/pcsx2/gui/ApplyState.h +++ b/pcsx2/gui/ApplyState.h @@ -24,7 +24,6 @@ class BaseApplicableConfigPanel; class BaseApplicableDialog; BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE( pxEvt_OnWindowCreated, -1 ) DECLARE_EVENT_TYPE( pxEvt_ApplySettings, -1 ) END_DECLARE_EVENT_TYPES() @@ -138,7 +137,6 @@ protected: BaseApplicableDialog(wxWindow* parent, const wxString& title, wxOrientation sizerOrient ); void OnSettingsApplied( wxCommandEvent& evt ); - void OnWindowCreated( wxCommandEvent& evt ); // Note: This method *will* be called automatically after a successful Apply, but will not // be called after a failed Apply (canceled due to error). diff --git a/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp b/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp index fa4bac5f54..5f2ed27e0c 100644 --- a/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp +++ b/pcsx2/gui/Dialogs/BaseConfigurationDialog.cpp @@ -28,7 +28,6 @@ #include #include -DEFINE_EVENT_TYPE( pxEvt_OnWindowCreated ) DEFINE_EVENT_TYPE( pxEvt_ApplySettings ) using namespace Panels; @@ -69,7 +68,9 @@ wxString BaseApplicableDialog::GetDialogName() const void BaseApplicableDialog::Init() { - Connect( pxEvt_OnWindowCreated, wxCommandEventHandler (BaseApplicableDialog::OnWindowCreated) ); + SetExtraStyle(GetExtraStyle() | wxMINIMIZE_BOX ); + SetExtraStyle(GetExtraStyle() & ~wxTOPLEVEL_EX_DIALOG); + Connect( pxEvt_ApplySettings, wxCommandEventHandler (BaseApplicableDialog::OnSettingsApplied) ); wxCommandEvent applyEvent( pxEvt_ApplySettings ); @@ -83,12 +84,6 @@ void BaseApplicableDialog::OnSettingsApplied( wxCommandEvent& evt ) if( evt.GetId() == GetId() ) AppStatusEvent_OnSettingsApplied(); } -void BaseApplicableDialog::OnWindowCreated( wxCommandEvent& evt ) -{ - evt.Skip(); - if( evt.GetId() == GetId() ) SetName( L"Dialog:" + GetDialogName() ); -} - // -------------------------------------------------------------------------------------- // BaseConfigurationDialog Implementations diff --git a/pcsx2/gui/Panels/BiosSelectorPanel.cpp b/pcsx2/gui/Panels/BiosSelectorPanel.cpp index 5866931117..521d01b34f 100644 --- a/pcsx2/gui/Panels/BiosSelectorPanel.cpp +++ b/pcsx2/gui/Panels/BiosSelectorPanel.cpp @@ -33,7 +33,6 @@ Panels::BaseSelectorPanel::BaseSelectorPanel( wxWindow* parent ) : BaseApplicableConfigPanel( parent, wxVERTICAL ) { Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler (BaseSelectorPanel::OnFolderChanged) ); - //Connect( wxEVT_ACTIVATE, wxActivateEventHandler (BaseSelectorPanel::OnActivate) ); Connect( wxEVT_SHOW, wxShowEventHandler (BaseSelectorPanel::OnShow) ); } @@ -41,13 +40,6 @@ Panels::BaseSelectorPanel::~BaseSelectorPanel() throw() { } -void Panels::BaseSelectorPanel::OnActivate(wxActivateEvent& evt) -{ - evt.Skip(); - if( !evt.GetActive() ) return; - OnShown(); -} - void Panels::BaseSelectorPanel::OnShow(wxShowEvent& evt) { evt.Skip(); diff --git a/pcsx2/gui/Panels/ConfigurationPanels.h b/pcsx2/gui/Panels/ConfigurationPanels.h index ab86ebfa54..f87e6a273b 100644 --- a/pcsx2/gui/Panels/ConfigurationPanels.h +++ b/pcsx2/gui/Panels/ConfigurationPanels.h @@ -386,7 +386,6 @@ namespace Panels protected: virtual void DoRefresh()=0; virtual bool ValidateEnumerationStatus()=0; - void OnActivate(wxActivateEvent& evt); void OnShow(wxShowEvent& evt); }; diff --git a/pcsx2/gui/Panels/MemoryCardListView.cpp b/pcsx2/gui/Panels/MemoryCardListView.cpp index c953e93fc6..0a6d1eb34b 100644 --- a/pcsx2/gui/Panels/MemoryCardListView.cpp +++ b/pcsx2/gui/Panels/MemoryCardListView.cpp @@ -85,10 +85,10 @@ wxString MemoryCardListView_Simple::OnGetItemText(long item, long column) const { case McdColS_PortSlot: return wxsFormat( L"%u/%u", m_CardProvider->GetPort(item)+1, m_CardProvider->GetSlot(item)+1); case McdColS_Status: return it.IsPresent ? ( it.IsEnabled ? _("Enabled") : _("Disabled")) : _("Missing"); - case McdColS_Size: return it.IsPresent ? wxsFormat( L"%u MB", it.SizeInMB ) : wxT("N/A"); + case McdColS_Size: return it.IsPresent ? wxsFormat( L"%u MB", it.SizeInMB ) : (wxString)_("N/A"); case McdColS_Formatted: return it.IsFormatted ? _("Yes") : _("No"); - case McdColS_DateModified: return it.DateModified.FormatDate(); - case McdColS_DateCreated: return it.DateCreated.FormatDate(); + case McdColS_DateModified: return it.IsPresent ? it.DateModified.FormatDate() : (wxString)_("N/A"); + case McdColS_DateCreated: return it.IsPresent ? it.DateCreated.FormatDate() : (wxString)_("N/A"); //case McdCol_Path: return it.Filename.GetPath(); } diff --git a/plugins/GSdx/GSDevice11.cpp b/plugins/GSdx/GSDevice11.cpp index 5072e58cd0..8ff33db718 100644 --- a/plugins/GSdx/GSDevice11.cpp +++ b/plugins/GSdx/GSDevice11.cpp @@ -30,14 +30,14 @@ // --------------------------------------------------------------------------------- // Code 'Borrowed' from Microsoft's DXGI sources -- Modified to suit our needs. --air -static IDXGIFactory* m_DXGIFactory = NULL; -static bool m_D3D11Available = false; +static IDXGIFactory* m_DXGIFactory = NULL; +static bool m_D3D11Available = false; static HMODULE s_hModD3D11 = NULL; -static FnPtr_D3D11CreateDevice s_DynamicD3D11CreateDevice = NULL; +static FnPtr_D3D11CreateDevice s_DynamicD3D11CreateDevice = NULL; static HMODULE s_hModDXGI = NULL; -static FnPtr_CreateDXGIFactory s_DynamicCreateDXGIFactory = NULL; +static FnPtr_CreateDXGIFactory s_DynamicCreateDXGIFactory = NULL; static bool DXUT_EnsureD3D11APIs( void ) @@ -63,7 +63,7 @@ static bool DXUT_EnsureD3D11APIs( void ) if( s_hModD3D11 != NULL ) { - s_DynamicD3D11CreateDevice = (FnPtr_D3D11CreateDevice)GetProcAddress( s_hModD3D11, "D3D11CreateDevice" ); + s_DynamicD3D11CreateDevice = (FnPtr_D3D11CreateDevice)GetProcAddress( s_hModD3D11, "D3D11CreateDevice" ); } return ( s_DynamicD3D11CreateDevice != NULL ); @@ -181,6 +181,8 @@ bool GSDevice11::Create(GSWnd* wnd) hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, flags, levels, countof(levels), D3D11_SDK_VERSION, &scd, &m_swapchain, &m_dev, &level, &m_ctx); // hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, flags, NULL, 0, D3D11_SDK_VERSION, &scd, &m_swapchain, &m_dev, &level, &m_ctx); + //return false; + if(FAILED(hr)) return false; if(!SetFeatureLevel(level, true)) diff --git a/plugins/spu2-x/src/Timestretcher.cpp b/plugins/spu2-x/src/Timestretcher.cpp index fbbe8ed9cd..ad12dca170 100644 --- a/plugins/spu2-x/src/Timestretcher.cpp +++ b/plugins/spu2-x/src/Timestretcher.cpp @@ -200,7 +200,7 @@ void SndBuffer::UpdateTempoChangeSoundTouch() } } -extern int TickInterval; +extern uint TickInterval; void SndBuffer::UpdateTempoChangeAsyncMixing() { float statusPct = GetStatusPct(); diff --git a/plugins/spu2-x/src/spu2sys.cpp b/plugins/spu2-x/src/spu2sys.cpp index 9186767d0b..f0a1f99d68 100644 --- a/plugins/spu2-x/src/spu2sys.cpp +++ b/plugins/spu2-x/src/spu2sys.cpp @@ -269,7 +269,7 @@ void V_Voice::Stop() ADSR.Phase = 0; } -int TickInterval = 768; +uint TickInterval = 768; static const int SanityInterval = 4800; //#define USE_ASYNC_MIXING