diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp index d4da5b95b6..2de52e66d8 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp @@ -41,6 +41,7 @@ Config::Config() { //memset(this, 0, sizeof(Config)); // Clear the memory bSaveByID.resize(4); // Set vector size + bSquareToCircle.resize(4); // Set vector size } @@ -231,7 +232,7 @@ void Config::Save(bool CheckedForDuplicates) file.Set(SectionName.c_str(), "eventnum", joysticks[i].eventnum); file.Set(SectionName.c_str(), "Diagonal", g_Config.SDiagonal); - file.Set(SectionName.c_str(), "SquareToCircle", g_Config.bSquareToCircle); + file.Set(SectionName.c_str(), "SquareToCircle", g_Config.bSquareToCircle.at(i)); } file.Save("nJoy.ini"); @@ -304,7 +305,7 @@ void Config::Load(bool config) file.Get(SectionName.c_str(), "eventnum", &joysticks[i].eventnum, 0); file.Get(SectionName.c_str(), "Diagonal", &g_Config.SDiagonal, "100%"); - file.Get(SectionName.c_str(), "SquareToCircle", &g_Config.bSquareToCircle, false); + file.Get(SectionName.c_str(), "SquareToCircle", &Tmp, false); g_Config.bSquareToCircle.at(i) = Tmp; } } diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.h b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.h index 211adce329..9f69a5e23a 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.h +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.h @@ -31,7 +31,7 @@ struct Config // Joystick std::string SDiagonal; - bool bSquareToCircle; + std::vector bSquareToCircle; }; extern Config g_Config; diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp index 9056899370..dee12d91c3 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigAdvanced.cpp @@ -80,7 +80,7 @@ void ConfigBox::PadGetStatus() // Get adjusted values int main_x_after = main_x, main_y_after = main_y; - if(g_Config.bSquareToCircle) + if(g_Config.bSquareToCircle.at(notebookpage)) { std::vector main_xy = Pad_Square_to_Circle(main_x, main_y); main_x_after = main_xy.at(0); diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp index f6c10fa1d8..ac4e656471 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp @@ -225,7 +225,7 @@ void ConfigBox::ChangeSettings( wxCommandEvent& event ) g_Config.SDiagonal = m_CoBDiagonal[notebookpage]->GetLabel().mb_str(); case IDCB_MAINSTICK_S_TO_C: - g_Config.bSquareToCircle = m_CBS_to_C[notebookpage]->IsChecked(); + g_Config.bSquareToCircle.at(notebookpage) = m_CBS_to_C[notebookpage]->IsChecked(); } } @@ -265,8 +265,8 @@ void ConfigBox::DoEnableDisable(int _notebookpage) m_CBShowAdvanced[_notebookpage]->SetValue(g_Config.bShowAdvanced); // Advanced settings - m_CoBDiagonal[notebookpage]->SetValue(wxString::FromAscii(g_Config.SDiagonal.c_str())); - m_CBS_to_C[notebookpage]->SetValue(g_Config.bSquareToCircle); + m_CoBDiagonal[_notebookpage]->SetValue(wxString::FromAscii(g_Config.SDiagonal.c_str())); + m_CBS_to_C[_notebookpage]->SetValue(g_Config.bSquareToCircle.at(_notebookpage)); m_Controller[_notebookpage]->Refresh(); // Repaint the background diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp index fdd3e0f18f..b157e712b1 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp @@ -401,7 +401,7 @@ void PAD_GetStatus(u8 _numPAD, SPADStatus* _pPADStatus) int i_sub_stick_y = -joystate[_numPAD].axis[CTL_SUB_Y]; // Check if we should make adjustments - if(g_Config.bSquareToCircle) + if(g_Config.bSquareToCircle.at(_numPAD)) { std::vector main_xy = Pad_Square_to_Circle(i_main_stick_x, i_main_stick_y); i_main_stick_x = main_xy.at(0);