From 2a236a4631c2b51ab2f0710dc5054a6f73063891 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Sat, 11 Jul 2009 00:27:32 +0000 Subject: [PATCH] remove PAD_GetAttachedPads() from PadSimple and nJoy (and plugin specs). It hasn't done anything except get in the way/cause confusion since changing SI devices was added. Also I declare PadSimpleEvent and nJoy .4 as dead/rotting code. someone can feel free to prove me wrong...but know they are on my hitlist :p git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3739 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/PluginPAD.cpp | 33 +++++------ Source/Core/Common/Src/PluginPAD.h | 2 - Source/Core/InputCommon/Src/SDL.h | 1 - Source/PluginSpecs/pluginspecs_pad.h | 8 --- .../Plugin_PadSimple/Src/GUI/ConfigDlg.cpp | 9 +-- .../Plugin_PadSimple/Src/GUI/ConfigDlg.h | 2 - .../Plugin_PadSimple/Src/PadSimple.cpp | 20 ------- .../Plugins/Plugin_PadSimple/Src/PadSimple.h | 1 - Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp | 4 +- .../Src/GUI/ConfigAdvanced.cpp | 16 ----- .../Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp | 59 +------------------ .../Plugin_nJoy_SDL/Src/GUI/ConfigBox.h | 7 +-- .../Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp | 9 +-- Source/Plugins/Plugin_nJoy_SDL/Src/Rumble.cpp | 4 +- Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp | 35 +++-------- 15 files changed, 34 insertions(+), 176 deletions(-) diff --git a/Source/Core/Common/Src/PluginPAD.cpp b/Source/Core/Common/Src/PluginPAD.cpp index 0eb96b7281..8ce529e04c 100644 --- a/Source/Core/Common/Src/PluginPAD.cpp +++ b/Source/Core/Common/Src/PluginPAD.cpp @@ -19,23 +19,22 @@ namespace Common { - PluginPAD::PluginPAD(const char *_Filename) : CPlugin(_Filename), validPAD(false) - { - PAD_GetStatus = reinterpret_cast - (LoadSymbol("PAD_GetStatus")); - PAD_Input = reinterpret_cast - (LoadSymbol("PAD_Input")); - PAD_Rumble = reinterpret_cast - (LoadSymbol("PAD_Rumble")); - PAD_GetAttachedPads = reinterpret_cast - (LoadSymbol("PAD_GetAttachedPads")); - if ((PAD_GetStatus != 0) && - (PAD_Input != 0) && - (PAD_Rumble != 0) && - (PAD_GetAttachedPads != 0)) - validPAD = true; - } +PluginPAD::PluginPAD(const char *_Filename) : CPlugin(_Filename), validPAD(false) +{ + PAD_GetStatus = reinterpret_cast + (LoadSymbol("PAD_GetStatus")); + PAD_Input = reinterpret_cast + (LoadSymbol("PAD_Input")); + PAD_Rumble = reinterpret_cast + (LoadSymbol("PAD_Rumble")); + + if ((PAD_GetStatus != 0) && + (PAD_Input != 0) && + (PAD_Rumble != 0)) + validPAD = true; +} + +PluginPAD::~PluginPAD() {} - PluginPAD::~PluginPAD() {} } // Namespace diff --git a/Source/Core/Common/Src/PluginPAD.h b/Source/Core/Common/Src/PluginPAD.h index 29db050a50..c3adaa8bc6 100644 --- a/Source/Core/Common/Src/PluginPAD.h +++ b/Source/Core/Common/Src/PluginPAD.h @@ -26,7 +26,6 @@ namespace Common { typedef void (__cdecl* TPAD_GetStatus)(u8, SPADStatus*); typedef void (__cdecl* TPAD_Input)(u16, u8); typedef void (__cdecl* TPAD_Rumble)(u8, unsigned int, unsigned int); -typedef unsigned int (__cdecl* TPAD_GetAttachedPads)(); class PluginPAD : public CPlugin { public: @@ -37,7 +36,6 @@ public: TPAD_GetStatus PAD_GetStatus; TPAD_Input PAD_Input; TPAD_Rumble PAD_Rumble; - TPAD_GetAttachedPads PAD_GetAttachedPads; private: bool validPAD; diff --git a/Source/Core/InputCommon/Src/SDL.h b/Source/Core/InputCommon/Src/SDL.h index 46d3b5ddb0..1143daf0fb 100644 --- a/Source/Core/InputCommon/Src/SDL.h +++ b/Source/Core/InputCommon/Src/SDL.h @@ -85,7 +85,6 @@ struct CONTROLLER_MAPPING // GC PAD MAPPING int dpad2[4]; // (See above) int axis[6]; // (See above) int halfpress; // (See above) - int enabled; // Pad attached? int deadzone; // Deadzone... what else? int ID; // SDL joystick device ID int controllertype; // Hat: Hat or custom buttons diff --git a/Source/PluginSpecs/pluginspecs_pad.h b/Source/PluginSpecs/pluginspecs_pad.h index aa1b8e4a2f..161d0c1063 100644 --- a/Source/PluginSpecs/pluginspecs_pad.h +++ b/Source/PluginSpecs/pluginspecs_pad.h @@ -80,13 +80,5 @@ EXPORT void CALL PAD_Input(u16 _Key, u8 _UpDown); // EXPORT void CALL PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength); -// __________________________________________________________________________________________________ -// Function: PAD_GetAttachedPads -// Purpose: Get mask of attached pads (eg: controller 1 & 4 -> 0x9) -// input: none -// output: number of pads -// -EXPORT unsigned int CALL PAD_GetAttachedPads(); - #include "ExportEpilog.h" #endif diff --git a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp index 56de37908d..f48f4c66f4 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp +++ b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.cpp @@ -31,7 +31,6 @@ BEGIN_EVENT_TABLE(PADConfigDialogSimple,wxDialog) EVT_BUTTON(ID_CLOSE,PADConfigDialogSimple::OnCloseClick) EVT_BUTTON(ID_PAD_ABOUT,PADConfigDialogSimple::DllAbout) - EVT_CHECKBOX(ID_ATTACHED,PADConfigDialogSimple::ControllerSettingsChanged) EVT_CHECKBOX(ID_X360PAD,PADConfigDialogSimple::ControllerSettingsChanged) EVT_CHOICE(ID_X360PAD_CHOICE,PADConfigDialogSimple::ControllerSettingsChanged) EVT_CHECKBOX(ID_RUMBLE,PADConfigDialogSimple::ControllerSettingsChanged) @@ -175,13 +174,11 @@ void PADConfigDialogSimple::CreateGUIControls() sDevice[i] = new wxBoxSizer(wxHORIZONTAL); sbDevice[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("Controller Settings")); - m_Attached[i] = new wxCheckBox(m_Controller[i], ID_ATTACHED, wxT("Controller attached"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_Disable[i] = new wxCheckBox(m_Controller[i], ID_DISABLE, wxT("Disable when Dolphin is not in focus"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); - sbDevice[i]->Add(m_Attached[i], 0, wxEXPAND|wxALL, 1); sbDevice[i]->Add(m_Disable[i], 0, wxEXPAND|wxALL, 1); #ifdef _WIN32 - m_SizeXInput[i] = new wxStaticBoxSizer(wxVERTICAL, m_Controller[i], wxT("XInput Pad")); + m_SizeXInput[i] = new wxStaticBoxSizer(wxHORIZONTAL, m_Controller[i], wxT("XInput Pad")); m_X360Pad[i] = new wxCheckBox(m_Controller[i], ID_X360PAD, wxT("Enable X360Pad"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_X360PadC[i] = new wxChoice(m_Controller[i], ID_X360PAD_CHOICE, wxDefaultPosition, wxDefaultSize, arrayStringFor_X360Pad, 0, wxDefaultValidator); m_Rumble[i] = new wxCheckBox(m_Controller[i], ID_RUMBLE, wxT("Enable rumble"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); @@ -191,7 +188,6 @@ void PADConfigDialogSimple::CreateGUIControls() m_SizeXInput[i]->Add(m_Rumble[i], 0, wxEXPAND | wxALL, 1); #endif // Set values - m_Attached[i]->SetValue(pad[i].bAttached); m_Disable[i]->SetValue(pad[i].bDisable); #ifdef _WIN32 @@ -398,9 +394,6 @@ void PADConfigDialogSimple::ControllerSettingsChanged(wxCommandEvent& event) switch (event.GetId()) { // General settings - case ID_ATTACHED: - pad[page].bAttached = m_Attached[page]->GetValue(); - break; case ID_DISABLE: pad[page].bDisable = m_Disable[page]->GetValue(); break; diff --git a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h index 1962145359..4692939eb8 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h +++ b/Source/Plugins/Plugin_PadSimple/Src/GUI/ConfigDlg.h @@ -63,7 +63,6 @@ class PADConfigDialogSimple : public wxDialog wxArrayString arrayStringFor_X360Pad; wxCheckBox *m_X360Pad[4]; wxChoice *m_X360PadC[4]; - wxCheckBox *m_Attached[4]; wxCheckBox *m_Disable[4]; wxCheckBox *m_Rumble[4]; @@ -115,7 +114,6 @@ class PADConfigDialogSimple : public wxDialog ID_SAVE_RECORDING, // General settings - ID_ATTACHED, ID_DISABLE, ID_PAD_ABOUT }; diff --git a/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp b/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp index 58a1cb322e..a2ab1e1fc0 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp +++ b/Source/Plugins/Plugin_PadSimple/Src/PadSimple.cpp @@ -823,24 +823,6 @@ void PAD_Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength) #endif } -unsigned int PAD_GetAttachedPads() -{ - unsigned int connected = 0; - - LoadConfig(); - - if(pad[0].bAttached) - connected |= 1; - if(pad[1].bAttached) - connected |= 2; - if(pad[2].bAttached) - connected |= 4; - if(pad[3].bAttached) - connected |= 8; - - return connected; -} - //****************************************************************************** // Load and save the configuration //****************************************************************************** @@ -936,7 +918,6 @@ void LoadConfig() sprintf(SectionName, "PAD%i", i+1); file.Get(SectionName, "UseXPad", &pad[i].bEnableXPad, i==0); - file.Get(SectionName, "Attached", &pad[i].bAttached, i==0); file.Get(SectionName, "DisableOnBackground", &pad[i].bDisable, false); file.Get(SectionName, "Rumble", &pad[i].bRumble, true); file.Get(SectionName, "RumbleStrength", &pad[i].RumbleStrength, 8000); @@ -972,7 +953,6 @@ void SaveConfig() sprintf(SectionName, "PAD%i", i+1); file.Set(SectionName, "UseXPad", pad[i].bEnableXPad); - file.Set(SectionName, "Attached", pad[i].bAttached); file.Set(SectionName, "DisableOnBackground", pad[i].bDisable); file.Set(SectionName, "Rumble", pad[i].bRumble); file.Set(SectionName, "RumbleStrength", pad[i].RumbleStrength); diff --git a/Source/Plugins/Plugin_PadSimple/Src/PadSimple.h b/Source/Plugins/Plugin_PadSimple/Src/PadSimple.h index 041bb1077b..7f4dcba433 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/PadSimple.h +++ b/Source/Plugins/Plugin_PadSimple/Src/PadSimple.h @@ -78,7 +78,6 @@ static const char* controlNames[] = struct SPads { bool bEnableXPad; // Use an XPad in addition to the keyboard? - bool bAttached; // Pad is "attached" to the gamecube/wii bool bDisable; // Disabled when dolphin isn't in focus bool bRumble; // Rumble for xpad unsigned int RumbleStrength; // Rumble strength diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp index 5bb142f7a2..32b091c7d9 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp @@ -127,7 +127,6 @@ void Config::Save(int Slot) // Slot specific settings only // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ std::string SectionName = StringFromFormat("PAD%i", i+1); - file.Set(SectionName.c_str(), "enabled", PadMapping[i].enabled); // Save the physical device ID file.Set(SectionName.c_str(), "joy_id", PadMapping[i].ID); @@ -228,10 +227,9 @@ void Config::Load(bool ChangePad, bool ChangeSaveByID) std::string SectionName = StringFromFormat("PAD%i", i+1); // Don't update this when we are loading settings from the PADConfigDialognJoy - if(!ChangePad) + if (!ChangePad) { file.Get(SectionName.c_str(), "joy_id", &PadMapping[i].ID, 0); - file.Get(SectionName.c_str(), "enabled", &PadMapping[i].enabled, 1); } // ================================================================== diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp index af00e2a4fd..d3a37bc82b 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp @@ -58,15 +58,6 @@ void PADConfigDialognJoy::PadGetStatus() return; } - // Return if it's not enabled - if (!PadMapping[notebookpage].enabled) - { - m_TStatusIn[notebookpage]->SetLabel(wxT("Not enabled")); m_TStatusOut[notebookpage]->SetLabel(wxT("Not enabled")); - m_TStatusInC[notebookpage]->SetLabel(wxT("Not enabled")); m_TStatusOutC[notebookpage]->SetLabel(wxT("Not enabled")); - m_TStatusTriggers[notebookpage]->SetLabel(wxT("Not enabled")); - return; - } - // Get physical device status int PhysicalDevice = PadMapping[notebookpage].ID; int TriggerType = PadMapping[notebookpage].triggertype; @@ -171,9 +162,6 @@ void PADConfigDialognJoy::PadGetStatus() // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ std::string ShowStatus(int VirtualController) { - // Check if it's enabled - if (!PadMapping[VirtualController].enabled) return StringFromFormat("%i disabled", VirtualController); - // Save the physical device int PhysicalDevice = PadMapping[VirtualController].ID; @@ -221,9 +209,7 @@ std::string ShowStatus(int VirtualController) } return StringFromFormat( - //"Version: %i.%i.%i\n" "All pads:\n" - "Enabled: %i %i %i %i\n" "ID: %i %i %i %i\n" "Controllertype: %i %i %i %i\n" "SquareToCircle: %i %i %i %i\n\n" @@ -237,8 +223,6 @@ std::string ShowStatus(int VirtualController) "Hats: %s\n" "But: %s\n" "Device: Ax: %i Balls:%i Hats:%i But:%i", - //Version.major, Version.minor, Version.patch, - PadMapping[0].enabled, PadMapping[1].enabled, PadMapping[2].enabled, PadMapping[3].enabled, PadMapping[0].ID, PadMapping[1].ID, PadMapping[2].ID, PadMapping[3].ID, PadMapping[0].controllertype, PadMapping[1].controllertype, PadMapping[2].controllertype, PadMapping[3].controllertype, PadMapping[0].bSquareToCircle, PadMapping[1].bSquareToCircle, PadMapping[2].bSquareToCircle, PadMapping[3].bSquareToCircle, diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp index 4d60302e57..b0e2416016 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp @@ -56,9 +56,8 @@ BEGIN_EVENT_TABLE(PADConfigDialognJoy,wxDialog) EVT_BUTTON(ID_CANCEL, PADConfigDialognJoy::CancelClick) EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, PADConfigDialognJoy::NotebookPageChanged) - // Change and enable or disable gamepad + // Change gamepad EVT_COMBOBOX(IDC_JOYNAME, PADConfigDialognJoy::ChangeSettings) - EVT_CHECKBOX(IDC_JOYATTACH, PADConfigDialognJoy::ChangeSettings) // Other settings EVT_CHECKBOX(IDC_SAVEBYID, PADConfigDialognJoy::ChangeSettings) @@ -298,18 +297,12 @@ void PADConfigDialognJoy::OnSaveById() the plugin. Joyinfo[].joy is only used the first time the pads are checked. */ void PADConfigDialognJoy::DoChangeJoystick() { - // Close the current pad, unless it's used by another slot - //if (PadMapping[notebookpage].enabled) PadClose(notebookpage); - // Before changing the pad we save potential changes to the current pad (to support SaveByID) DoSave(true); // Load the settings for the new Id g_Config.Load(true); UpdateGUI(notebookpage); // Update the GUI - - // Open the new pad - if (PadMapping[notebookpage].enabled) PadOpen(notebookpage); } void PADConfigDialognJoy::PadOpen(int Open) // Open for slot 1, 2, 3 or 4 { @@ -481,15 +474,6 @@ void PADConfigDialognJoy::ChangeSettings( wxCommandEvent& event ) case IDC_JOYNAME: DoChangeJoystick(); break; - - case IDC_JOYATTACH: - // We will enable this device - int Enable = PadMapping[notebookpage].enabled = !PadMapping[notebookpage].enabled; - // Close or open pad handle - if(Enable) PadOpen(notebookpage); else PadClose(notebookpage); - // Update the GUI - UpdateGUI(notebookpage); - return; // Don't save this for all slots } // Update all slots that use this device @@ -550,25 +534,6 @@ void PADConfigDialognJoy::UpdateGUI(int _notebookpage) m_CheckPlayback[_notebookpage]->SetValue(g_Config.bPlayback); #endif - // There is no FindItem in linux so this doesn't work - #ifdef _WIN32 - // Disabled pages - bool Enabled = PadMapping[_notebookpage].enabled == 1 ? true : false; - - // Enable or disable all buttons - for(int i = IDB_ANALOG_MAIN_X; i <= IDB_BUTTONHALFPRESS; i++) - m_Controller[_notebookpage]->FindItem(i)->Enable(Enabled); - // Controller type settings - m_Controller[_notebookpage]->FindItem(IDC_DEADZONE)->Enable(Enabled); - m_Controller[_notebookpage]->FindItem(IDC_CONTROLTYPE)->Enable(Enabled); - m_Controller[_notebookpage]->FindItem(IDC_TRIGGERTYPE)->Enable(Enabled && XInput); - m_Controller[_notebookpage]->FindItem(IDCB_MAINSTICK_RADIUS)->Enable(Enabled); - m_Controller[_notebookpage]->FindItem(IDCB_MAINSTICK_CB_RADIUS)->Enable(Enabled); - m_Controller[_notebookpage]->FindItem(IDCB_MAINSTICK_DIAGONAL)->Enable(Enabled); - m_Controller[_notebookpage]->FindItem(IDCB_MAINSTICK_S_TO_C)->Enable(Enabled); - m_Controller[_notebookpage]->FindItem(IDCB_FILTER_SETTINGS)->Enable(Enabled); - #endif - // Replace the harder to understand -1 with "" for the sake of user friendliness ToBlank(); @@ -597,10 +562,7 @@ void PADConfigDialognJoy::OnPaint(wxPaintEvent &event) wxPaintDC dcWin(m_pKeys[notebookpage]); PrepareDC( dcWin ); - if(PadMapping[notebookpage].enabled) - dcWin.DrawBitmap( WxStaticBitmap1_BITMAP, 94, 0, true ); - else - dcWin.DrawBitmap( WxStaticBitmap1_BITMAPGray, 94, 0, true ); + dcWin.DrawBitmap( WxStaticBitmap1_BITMAP, 94, 0, true ); } // Populate the config window @@ -650,11 +612,6 @@ void PADConfigDialognJoy::CreateGUIControls() // Define bitmap for EVT_PAINT WxStaticBitmap1_BITMAP = wxBitmap(ConfigBox_WxStaticBitmap1_XPM); - // Gray version - wxImage WxImageGray = WxStaticBitmap1_BITMAP.ConvertToImage(); - WxImageGray = WxImageGray.ConvertToGreyscale(); - WxStaticBitmap1_BITMAPGray = wxBitmap(WxImageGray); - // Search for devices and add them to the device list wxArrayString arrayStringFor_Joyname; // The string array if(NumGoodPads > 0) @@ -808,16 +765,12 @@ void PADConfigDialognJoy::CreateGUIControls() // Groups #ifdef _WIN32 m_Joyname[i] = new wxComboBox(m_Controller[i], IDC_JOYNAME, arrayStringFor_Joyname[0], wxDefaultPosition, wxSize(476, 21), arrayStringFor_Joyname, wxCB_READONLY); - m_Joyattach[i] = new wxCheckBox(m_Controller[i], IDC_JOYATTACH, wxT("Controller attached"), wxDefaultPosition, wxSize(109, 25)); #else m_Joyname[i] = new wxComboBox(m_Controller[i], IDC_JOYNAME, arrayStringFor_Joyname[0], wxDefaultPosition, wxSize(450, 25), arrayStringFor_Joyname, 0, wxDefaultValidator, wxT("m_Joyname")); - m_Joyattach[i] = new wxCheckBox(m_Controller[i], IDC_JOYATTACH, wxT("Controller attached"), wxDefaultPosition, wxSize(140, 25), 0, wxDefaultValidator, wxT("Controller attached")); #endif - m_Joyattach[i]->SetToolTip(wxString::Format(wxT("Decide if Controller %i shall be detected by the game."), i + 1)); m_gJoyname[i] = new wxStaticBoxSizer (wxHORIZONTAL, m_Controller[i], wxT("Controller")); m_gJoyname[i]->Add(m_Joyname[i], 0, (wxLEFT | wxRIGHT), 5); - m_gJoyname[i]->Add(m_Joyattach[i], 0, (wxRIGHT | wxLEFT | wxBOTTOM), 1); m_Joyname[i]->SetToolTip(wxT("Save your settings and configure another joypad")); @@ -1042,14 +995,6 @@ void PADConfigDialognJoy::CreateGUIControls() // Show or hide it. We have to do this after we add it to its sizer m_sMainRight[i]->Show(g_Config.bShowAdvanced); - // Don't allow these changes when running - if(g_EmulatorRunning) - { - //m_Joyname[i]->Enable(false); - m_Joyattach[i]->Enable(false); - //m_ControlType[i]->Enable(false); - } - // Update GUI UpdateGUI(i); } // end of loop diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h index cbb57da374..a6d65bfc40 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.h @@ -90,7 +90,7 @@ class PADConfigDialognJoy : public wxDialog wxBoxSizer * m_MainSizer; wxPanel *m_pKeys[4], *m_pInStatus[4], *m_pOutStatus[4], *m_pInStatusC[4], *m_pOutStatusC[4]; - wxBitmap WxStaticBitmap1_BITMAP, WxStaticBitmap1_BITMAPGray; + wxBitmap WxStaticBitmap1_BITMAP; wxStaticBoxSizer * m_sKeys[4]; wxBoxSizer *m_sMain[4], *m_sMainLeft[4], *m_sMainRight[4]; @@ -101,8 +101,7 @@ class PADConfigDialognJoy : public wxDialog wxComboBox *m_Joyname[4]; wxComboBox *m_ControlType[4], *m_TriggerType[4]; wxComboBox *m_Deadzone[4]; - - wxCheckBox *m_Joyattach[4]; // Attached pad + wxStaticBoxSizer *m_gJoyname[4]; wxStaticBoxSizer *m_gExtrasettings[4]; // Extra settings @@ -218,7 +217,7 @@ class PADConfigDialognJoy : public wxDialog ID_KEYSPANEL1, ID_KEYSPANEL2, ID_KEYSPANEL3, ID_KEYSPANEL4, - IDG_JOYSTICK, IDC_JOYNAME, IDC_JOYATTACH, // Controller attached + IDG_JOYSTICK, IDC_JOYNAME, IDG_EXTRASETTINGS, IDC_DEADZONE, // Extra settings diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp index 1552ab5e1f..564fe5c08a 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigJoypad.cpp @@ -53,9 +53,6 @@ void PADConfigDialognJoy::UpdateGUIButtonMapping(int controller) // Update selected gamepad m_Joyname[controller]->SetSelection(PadMapping[controller].ID); - // Update the enabled checkbox - m_Joyattach[controller]->SetValue(PadMapping[controller].enabled == 1 ? true : false); - tmp << PadMapping[controller].buttons[InputCommon::CTL_L_SHOULDER]; m_JoyShoulderL[controller]->SetValue(tmp); tmp.clear(); tmp << PadMapping[controller].buttons[InputCommon::CTL_R_SHOULDER]; m_JoyShoulderR[controller]->SetValue(tmp); tmp.clear(); @@ -110,8 +107,7 @@ void PADConfigDialognJoy::UpdateGUIButtonMapping(int controller) } /* Populate the PadMapping array with the dialog items settings (for example - selected joystick, enabled or disabled status and so on) */ -// ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ + selected joystick and so on) */ void PADConfigDialognJoy::SaveButtonMapping(int controller, bool DontChangeId, int FromSlot) { // Temporary storage @@ -124,9 +120,8 @@ void PADConfigDialognJoy::SaveButtonMapping(int controller, bool DontChangeId, i // Replace "" with "-1" in the GUI controls ToBlank(false); - // Set enabled or disable status and other settings + // Set other settings if(!DontChangeId) PadMapping[controller].ID = m_Joyname[FromSlot]->GetSelection(); - if(FromSlot == controller) PadMapping[controller].enabled = m_Joyattach[FromSlot]->GetValue(); // Only enable one PadMapping[controller].controllertype = m_ControlType[FromSlot]->GetSelection(); PadMapping[controller].triggertype = m_TriggerType[FromSlot]->GetSelection(); PadMapping[controller].deadzone = m_Deadzone[FromSlot]->GetSelection(); diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/Rumble.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/Rumble.cpp index 925324e570..e115c733d1 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/Rumble.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/Rumble.cpp @@ -343,10 +343,8 @@ BOOL CALLBACK EnumFFDevicesCallback(const DIDEVICEINSTANCE* pInst, VOID* pContex { // a DInput device is created even if rumble is disabled on startup // this way, you can toggle the rumble setting while in game - if (PadMapping[i].enabled) // && PadMapping[i].rumble - { + //if (PadMapping[i].enabled) // && PadMapping[i].rumble pRumble[i].g_pDevice = pDevice; // everything looks good, save the DInput device - } } } diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp index bef32d029b..36d57fcce1 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp @@ -311,7 +311,7 @@ void Shutdown() vector elements or any bad devices */ for (int i = 0; i < 4; i++) { - if (PadMapping[i].enabled && joyinfo.size() > (u32)PadMapping[i].ID) + if (joyinfo.size() > (u32)PadMapping[i].ID) if (joyinfo.at(PadMapping[i].ID).Good) if(SDL_JoystickOpened(PadMapping[i].ID)) { @@ -376,25 +376,6 @@ void DoState(unsigned char **ptr, int mode) #endif } - -// Set PAD attached pads -// ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ -unsigned int PAD_GetAttachedPads() -{ - unsigned int connected = 0; - - g_Config.Load(); - - if (PadMapping[0].enabled) connected |= 1; - if (PadMapping[1].enabled) connected |= 2; - if (PadMapping[2].enabled) connected |= 4; - if (PadMapping[3].enabled) connected |= 8; - - //INFO_LOG(CONSOLE, "PAD_GetAttachedPads: %i %i %i %i\n", PadMapping[0].enabled, PadMapping[1].enabled, PadMapping[2].enabled, PadMapping[3].enabled); - - return connected; -} - // Set PAD status // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻ @@ -404,9 +385,9 @@ void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus) { //INFO_LOG(CONSOLE, "PAD_GetStatus(): %i %i %i\n", _numPAD, PadMapping[_numPAD].enabled, PadState[_numPAD].joy); - /* Check if the pad is enabled and avaliable, currently we don't disable pads just because they are + /* Check if the pad is avaliable, currently we don't disable pads just because they are disconnected */ - if (!PadMapping[_numPAD].enabled || !PadState[_numPAD].joy) return; + if (!PadState[_numPAD].joy) return; // ------------------------------------------- // Play back input instead of accepting any user input @@ -629,7 +610,7 @@ bool Search_Devices(std::vector &_joyinfo, int &_N // Update the PadState[].joy handle for (int i = 0; i < 4; i++) { - if (PadMapping[i].enabled && joyinfo.size() > (u32)PadMapping[i].ID) + if (joyinfo.size() > (u32)PadMapping[i].ID) if(joyinfo.at(PadMapping[i].ID).Good) PadState[i].joy = SDL_JoystickOpen(PadMapping[i].ID); } @@ -644,10 +625,10 @@ bool Search_Devices(std::vector &_joyinfo, int &_N // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ bool ReloadDLL() { - if ( (PadMapping[0].enabled && PadState[0].joy == NULL) - || (PadMapping[1].enabled && PadState[1].joy == NULL) - || (PadMapping[2].enabled && PadState[2].joy == NULL) - || (PadMapping[3].enabled && PadState[3].joy == NULL)) + if ( (PadState[0].joy == NULL) + || (PadState[1].joy == NULL) + || (PadState[2].joy == NULL) + || (PadState[3].joy == NULL)) { // Check if it was an error and not just no pads connected std::string StrError = SDL_GetError();