From 0489ccd4208cd8a6e0dd7f74a409d44d1072e5cd Mon Sep 17 00:00:00 2001 From: hrydgard Date: Fri, 20 Mar 2009 17:14:42 +0000 Subject: [PATCH] nJoy SDL, linux: fix some warnings and a bug. untested :p git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2691 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp | 6 ++--- .../Plugin_nJoy_SDL/Src/GUI/ConfigBox.h | 24 ++++++++++++------- .../Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp | 2 +- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp index 903ed5bc3c..0f7ac26d88 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp @@ -363,7 +363,7 @@ void ConfigBox::ToBlank(bool ToBlank) { for(int i = IDB_ANALOG_MAIN_X; i <= IDB_BUTTONHALFPRESS; i++) #ifndef _WIN32 - if(GetButtonText(i, j).ToAscii() == "-1") SetButtonText(i, "", j); + if(!strcmp(GetButtonText(i, j), "-1")) SetButtonText(i, "", j); #else if(GetButtonText(i, j) == "-1") SetButtonText(i, "", j); #endif @@ -381,7 +381,7 @@ void ConfigBox::ToBlank(bool ToBlank) /////////////////////////////////////////////////////////////////////////////////// // Change settings // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ -void ConfigBox::SetButtonTextAll(int id, char text[128]) +void ConfigBox::SetButtonTextAll(int id, const char *text) { for (int i = 0; i < 4; i++) { @@ -589,7 +589,7 @@ void ConfigBox::UpdateGUI(int _notebookpage) // Paint the background // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ -void ConfigBox::OnPaint( wxPaintEvent &event ) +void ConfigBox::OnPaint(wxPaintEvent &event) { event.Skip(); diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h index f11fe8f3c3..8351e0141e 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h @@ -191,9 +191,9 @@ class ConfigBox : public wxDialog int notebookpage; bool ControlsCreated; #ifdef RERECORDING - wxStaticBoxSizer *m_SizeRecording[4]; - wxCheckBox *m_CheckRecording[4], *m_CheckPlayback[4]; - wxButton *m_BtnSaveRecording[4]; + wxStaticBoxSizer *m_SizeRecording[4]; + wxCheckBox *m_CheckRecording[4], *m_CheckPlayback[4]; + wxButton *m_BtnSaveRecording[4]; #endif private: @@ -315,17 +315,24 @@ class ConfigBox : public wxDialog void CancelClick(wxCommandEvent& event); void DoSave(bool ChangePad = false, int Slot = -1); - void DoChangeJoystick(); void PadOpen(int Open); void PadClose(int Close); + void DoChangeJoystick(); + + void PadOpen(int Open); + void PadClose(int Close); + void UpdateGUI(int _notebookpage); void ChangeSettings(wxCommandEvent& event); void ComboChange(wxCommandEvent& event); void OnClose(wxCloseEvent& event); - void CreateGUIControls(); void CreateAdvancedControls(int i); + void CreateGUIControls(); + void CreateAdvancedControls(int i); void SizeWindow(); - wxBitmap CreateBitmap(); wxBitmap CreateBitmapDot(); - void PadGetStatus(); void Update(); + wxBitmap CreateBitmap(); + wxBitmap CreateBitmapDot(); + void PadGetStatus(); + void Update(); void UpdateGUIButtonMapping(int controller); void SaveButtonMapping(int controller, bool DontChangeId = false, int FromSlot = -1); @@ -342,7 +349,8 @@ class ConfigBox : public wxDialog void OnPaint(wxPaintEvent &event); - void SetButtonText(int id, char text[128], int Page = -1); void SetButtonTextAll(int id, char text[128]); + void SetButtonText(int id, const char *text, int Page = -1); + void SetButtonTextAll(int id, const char *text); wxString GetButtonText(int id, int Page = -1); void OnKeyDown(wxKeyEvent& event); }; diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp index 7f9bb14f8d..23fed32685 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp @@ -170,7 +170,7 @@ void ConfigBox::SaveButtonMapping(int controller, bool DontChangeId, int FromSlo // Update the textbox for the buttons // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ -void ConfigBox::SetButtonText(int id, char text[128], int Page) +void ConfigBox::SetButtonText(int id, const char *text, int Page) { // Set controller value int controller;